1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Earlier detection of a host of errors in CREATE TABLE, such the CREATE TABLE

statement itself fails, rather than generating an error on the first attempted
use of the created table.

FossilOrigin-Name: 348fa7aaf7958b3fb689ed023d946064ae8d92718a497a346e95114a2410cbf5
This commit is contained in:
drh
2023-10-13 22:19:23 +00:00
parent cc67a62fa0
commit 9132b8816a
5 changed files with 30 additions and 12 deletions

View File

@@ -6906,18 +6906,31 @@ case OP_CreateBtree: { /* out2 */
/* Opcode: SqlExec * * * P4 *
**
** Run the SQL statement or statements specified in the P4 string.
** Disable Auth and Trace callbacks while those statements are running if
** P1 is true.
*/
case OP_SqlExec: {
char *zErr;
sqlite3_xauth xAuth;
u8 mTrace;
sqlite3VdbeIncrWriteCounter(p, 0);
db->nSqlExec++;
zErr = 0;
xAuth = db->xAuth;
mTrace = db->mTrace;
if( pOp->p1 ){
db->xAuth = 0;
db->mTrace = 0;
}
rc = sqlite3_exec(db, pOp->p4.z, 0, 0, &zErr);
db->nSqlExec--;
db->xAuth = xAuth;
db->mTrace = mTrace;
if( rc || zErr ){
sqlite3VdbeError(p, "%s", zErr);
sqlite3_free(zErr);
if( rc==SQLITE_NOMEM ) goto no_mem;
goto abort_due_to_error;
}
break;