mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Upgrade bundled libsqlite to 2.8.9
This commit is contained in:
parent
2cf3cb6407
commit
a4ea8eb44e
37 changed files with 5000 additions and 6182 deletions
|
@ -688,7 +688,7 @@ void sqliteGenerateConstraintChecks(
|
|||
char *zMsg = 0;
|
||||
sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
|
||||
sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
|
||||
" may not be NULL", 0);
|
||||
" may not be NULL", (char*)0);
|
||||
sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC);
|
||||
break;
|
||||
}
|
||||
|
@ -817,8 +817,30 @@ void sqliteGenerateConstraintChecks(
|
|||
case OE_Rollback:
|
||||
case OE_Abort:
|
||||
case OE_Fail: {
|
||||
int j, n1, n2;
|
||||
char zErrMsg[200];
|
||||
strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column ");
|
||||
n1 = strlen(zErrMsg);
|
||||
for(j=0; j<pIdx->nColumn && n1<sizeof(zErrMsg)-30; j++){
|
||||
char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
|
||||
n2 = strlen(zCol);
|
||||
if( j>0 ){
|
||||
strcpy(&zErrMsg[n1], ", ");
|
||||
n1 += 2;
|
||||
}
|
||||
if( n1+n2>sizeof(zErrMsg)-30 ){
|
||||
strcpy(&zErrMsg[n1], "...");
|
||||
n1 += 3;
|
||||
break;
|
||||
}else{
|
||||
strcpy(&zErrMsg[n1], zCol);
|
||||
n1 += n2;
|
||||
}
|
||||
}
|
||||
strcpy(&zErrMsg[n1],
|
||||
pIdx->nColumn>1 ? " are not unique" : " is not unique");
|
||||
sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
|
||||
sqliteVdbeChangeP3(v, -1, "uniqueness constraint failed", P3_STATIC);
|
||||
sqliteVdbeChangeP3(v, -1, sqliteStrDup(zErrMsg), P3_DYNAMIC);
|
||||
break;
|
||||
}
|
||||
case OE_Ignore: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue