aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2022-01-24 15:34:55 +0000
committerdrh <>2022-01-24 15:34:55 +0000
commitc692df2784db52587fdf2a2ae20340ad8e7fc034 (patch)
tree3ab1ebee2f4688a599475ef396c8397796cd54c3 /src/sqliteInt.h
parentb5d44732214816116942ac27ebcb062542b31296 (diff)
downloadsqlite-c692df2784db52587fdf2a2ae20340ad8e7fc034.tar.gz
sqlite-c692df2784db52587fdf2a2ae20340ad8e7fc034.zip
Make it so that any Parse object is always linked into the database conenction
while it is active. Hence, an OOM will cause Parse.nErr to be set. FossilOrigin-Name: 6a45d8fe8bfbc11a5b86d25237e1f8bccfb0f22f3dcaf004ba797aeb57b365ec
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 7fd0d81d0..7a266403f 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3585,6 +3585,7 @@ struct Parse {
**************************************************************************/
int aTempReg[8]; /* Holding area for temporary registers */
+ Parse *pOuterParse; /* Outer Parse object when nested */
Token sNameToken; /* Token with unqualified schema object name */
/************************************************************************
@@ -3635,7 +3636,8 @@ struct Parse {
/*
** Sizes and pointers of various parts of the Parse object.
*/
-#define PARSE_HDR_SZ offsetof(Parse,aTempReg) /* Recursive part w/o aColCache*/
+#define PARSE_HDR(X) (((char*)(X))+offsetof(Parse,zErrMsg))
+#define PARSE_HDR_SZ (offsetof(Parse,aTempReg)-offsetof(Parse,zErrMsg)) /* Recursive part w/o aColCache*/
#define PARSE_RECURSE_SZ offsetof(Parse,sLastToken) /* Recursive part */
#define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */
#define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
@@ -5096,7 +5098,8 @@ FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
-void sqlite3ParserReset(Parse*);
+void sqlite3ParseObjectInit(Parse*,sqlite3*);
+void sqlite3ParseObjectReset(Parse*);
void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
#ifdef SQLITE_ENABLE_NORMALIZE
char *sqlite3Normalize(Vdbe*, const char*);