aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-05-31 16:21:12 +0000
committerdrh <drh@noemail.net>2003-05-31 16:21:12 +0000
commitf26e09c87fd45fe3bb5aa4edacc9ea3f6325c884 (patch)
tree5f3a5c939757ced657ebcfbea9c0418fadb19677 /src/sqliteInt.h
parent8372b8d13442ad85ab76f6b1bf89532f45fdce59 (diff)
downloadsqlite-f26e09c87fd45fe3bb5aa4edacc9ea3f6325c884.tar.gz
sqlite-f26e09c87fd45fe3bb5aa4edacc9ea3f6325c884.zip
Tighter binding of views, triggers, and indices to their respective
databases. Ticket #323. Much more testing needs to be done to the sqliteFix...() routines in attach.c. (CVS 990) FossilOrigin-Name: 7202d4f1a8853368954a967b7ccca9d8a6645a2e
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 7836dbd7d..67d466926 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.188 2003/05/29 17:50:55 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.189 2003/05/31 16:21:13 drh Exp $
*/
#include "config.h"
#include "sqlite.h"
@@ -857,7 +857,6 @@ struct Parse {
** while generating expressions. Normally false */
u8 iDb; /* Index of database whose schema is being parsed */
u8 useCallback; /* True if callbacks should be used to report results */
- int useDb; /* Restrict references to tables in this database */
int newTnum; /* Table number to use when reparsing CREATE TABLEs */
int nErr; /* Number of errors seen */
int nTab; /* Number of previously allocated VDBE cursors */
@@ -905,6 +904,7 @@ struct Trigger {
IdList *pColumns; /* If this is an UPDATE OF <column-list> trigger,
the <column-list> is stored here */
int foreach; /* One of TK_ROW or TK_STATEMENT */
+ Token *pNameToken; /* Token containing zName. Use during parsing only */
TriggerStep *step_list; /* Link list of trigger program steps */
Trigger *pNext; /* Next trigger associated with the table */
@@ -1002,6 +1002,19 @@ struct TriggerStack {
};
/*
+** The following structure contains information used by the sqliteFix...
+** routines as they walk the parse tree to make database references
+** explicit.
+*/
+typedef struct DbFixer DbFixer;
+struct DbFixer {
+ Parse *pParse; /* The parsing context. Error messages written here */
+ const char *zDb; /* Make sure all objects are contained in this database */
+ const char *zType; /* Type of the container - used for error messages */
+ const Token *pName; /* Name of the container - used for error messages */
+};
+
+/*
* This global flag is set for performance testing of triggers. When it is set
* SQLite will perform the overhead of building new and old trigger references
* even when no triggers exist
@@ -1171,3 +1184,9 @@ void sqliteAttach(Parse*, Token*, Token*);
void sqliteDetach(Parse*, Token*);
int sqliteBtreeFactory(const sqlite *db, const char *zFilename,
int mode, int nPg, Btree **ppBtree);
+int sqliteFixInit(DbFixer*, Parse*, int, const char*, const Token*);
+int sqliteFixSrcList(DbFixer*, SrcList*);
+int sqliteFixSelect(DbFixer*, Select*);
+int sqliteFixExpr(DbFixer*, Expr*);
+int sqliteFixExprList(DbFixer*, ExprList*);
+int sqliteFixTriggerStep(DbFixer*, TriggerStep*);