aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/btree.c1
-rw-r--r--src/build.c10
-rw-r--r--src/vdbe.c13
3 files changed, 21 insertions, 3 deletions
diff --git a/src/btree.c b/src/btree.c
index 1575d7d94..3c4f00d15 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -10708,6 +10708,7 @@ static int checkTreePage(
if( (rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0 ){
checkAppendMsg(pCheck,
"unable to get the page. error code=%d", rc);
+ if( rc==SQLITE_IOERR_NOMEM ) pCheck->rc = SQLITE_NOMEM;
goto end_of_check;
}
diff --git a/src/build.c b/src/build.c
index 0920b0f22..24f5d3f96 100644
--- a/src/build.c
+++ b/src/build.c
@@ -2921,12 +2921,16 @@ void sqlite3EndTable(
sqlite3VdbeAddParseSchemaOp(v, iDb,
sqlite3MPrintf(db, "tbl_name='%q' AND type!='trigger'", p->zName),0);
- /* Test for cycles in generated columns */
+ /* Test for cycles in generated columns and illegal expressions
+ ** in CHECK constraints and in DEFAULT clauses. */
if( p->tabFlags & TF_HasGenerated ){
- sqlite3VdbeAddOp4(v, OP_SqlExec, 0, 0, 0,
- sqlite3MPrintf(db, "SELECT*FROM\"%w\".\"%s\"",
+ sqlite3VdbeAddOp4(v, OP_SqlExec, 1, 0, 0,
+ sqlite3MPrintf(db, "SELECT*FROM\"%w\".\"%w\"",
db->aDb[iDb].zDbSName, p->zName), P4_DYNAMIC);
}
+ sqlite3VdbeAddOp4(v, OP_SqlExec, 1, 0, 0,
+ sqlite3MPrintf(db, "PRAGMA \"%w\".integrity_check(%Q)",
+ db->aDb[iDb].zDbSName, p->zName), P4_DYNAMIC);
}
/* Add the table to the in-memory representation of the database.
diff --git a/src/vdbe.c b/src/vdbe.c
index 00d365680..ce094f997 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -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;