aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/auth.c7
-rw-r--r--src/resolve.c5
-rw-r--r--src/sqliteInt.h2
-rw-r--r--src/trigger.c2
4 files changed, 6 insertions, 10 deletions
diff --git a/src/auth.c b/src/auth.c
index 83451c29a..48b1c42be 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -143,7 +143,6 @@ void sqlite3AuthRead(
Schema *pSchema, /* The schema of the expression */
SrcList *pTabList /* All table that pExpr might refer to */
){
- sqlite3 *db = pParse->db;
Table *pTab = 0; /* The table being read */
const char *zCol; /* Name of the column of the table */
int iSrc; /* Index in pTabList->a[] of table being read */
@@ -151,8 +150,8 @@ void sqlite3AuthRead(
int iCol; /* Index of column in table */
assert( pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER );
- assert( !IN_RENAME_OBJECT || db->xAuth==0 );
- if( db->xAuth==0 ) return;
+ assert( !IN_RENAME_OBJECT );
+ assert( pParse->db->xAuth!=0 );
iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
if( iDb<0 ){
/* An attempt to read a column out of a subquery or other
@@ -183,7 +182,7 @@ void sqlite3AuthRead(
}else{
zCol = "ROWID";
}
- assert( iDb>=0 && iDb<db->nDb );
+ assert( iDb>=0 && iDb<pParse->db->nDb );
if( SQLITE_IGNORE==sqlite3AuthReadCol(pParse, pTab->zName, zCol, iDb) ){
pExpr->op = TK_NULL;
}
diff --git a/src/resolve.c b/src/resolve.c
index 84ba82a11..720fdb760 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -112,7 +112,6 @@ static void resolveAlias(
}
sqlite3DbFree(db, pDup);
}
- ExprSetProperty(pExpr, EP_Alias);
}
@@ -429,7 +428,6 @@ static int lookupName(
pExpr->iTable = pNC->uNC.pUpsert->regData +
sqlite3TableColumnToStorage(pTab, iCol);
eNewExprOp = TK_REGISTER;
- ExprSetProperty(pExpr, EP_Alias);
}
}else
#endif /* SQLITE_OMIT_UPSERT */
@@ -636,8 +634,7 @@ lookupname_end:
if( cnt==1 ){
assert( pNC!=0 );
if( pParse->db->xAuth
- && !ExprHasProperty(pExpr, EP_Alias)
- && pExpr->op!=TK_REGISTER
+ && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
){
sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
}
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 7b22b6b3b..093ce7621 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2762,7 +2762,7 @@ struct Expr {
#define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
-#define EP_Alias 0x400000 /* Is an alias for a result set column */
+ /* 0x400000 // Available */
#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
diff --git a/src/trigger.c b/src/trigger.c
index 0893f790d..4f4bf9a97 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -862,7 +862,7 @@ static ExprList *sqlite3ExpandReturning(
}
}
}
- if( !db->mallocFailed && !pParse->colNamesSet ){
+ if( !db->mallocFailed ){
Vdbe *v = pParse->pVdbe;
assert( v!=0 );
sqlite3VdbeSetNumCols(v, pNew->nExpr);