aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-11-19 16:33:31 +0000
committerdrh <drh@noemail.net>2015-11-19 16:33:31 +0000
commit1a1d3cd2f3b9d9dadf50fe84c839e7d7c8b00488 (patch)
tree2f1ea201b01c9a23748348f47f2de068802c29b3 /src/select.c
parent05bdfa4a6fe5c2dbb69d0d2c2d7d3358bb925785 (diff)
downloadsqlite-1a1d3cd2f3b9d9dadf50fe84c839e7d7c8b00488.tar.gz
sqlite-1a1d3cd2f3b9d9dadf50fe84c839e7d7c8b00488.zip
Create the new TK_ASTERISK token to represent the "*" in "SELECT *". Formerly
that operator was TK_ALL, which was also used for UNION ALL. Less confusion if they operator symbols are distinct. FossilOrigin-Name: 201ac6d449431dadc6b29faecd68b559bd64bc9f
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/select.c b/src/select.c
index 793171f93..2cf190b34 100644
--- a/src/select.c
+++ b/src/select.c
@@ -118,7 +118,7 @@ Select *sqlite3SelectNew(
memset(pNew, 0, sizeof(*pNew));
}
if( pEList==0 ){
- pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0));
+ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ASTERISK,0));
}
pNew->pEList = pEList;
if( pSrc==0 ) pSrc = sqlite3DbMallocZero(db, sizeof(*pSrc));
@@ -3938,7 +3938,7 @@ static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){
if( pNewSrc==0 ) return WRC_Abort;
*pNew = *p;
p->pSrc = pNewSrc;
- p->pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ALL, 0));
+ p->pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ASTERISK, 0));
p->op = TK_SELECT;
p->pWhere = 0;
pNew->pGroupBy = 0;
@@ -4279,19 +4279,20 @@ static int selectExpander(Walker *pWalker, Select *p){
/* For every "*" that occurs in the column list, insert the names of
** all columns in all tables. And for every TABLE.* insert the names
** of all columns in TABLE. The parser inserted a special expression
- ** with the TK_ALL operator for each "*" that it found in the column list.
- ** The following code just has to locate the TK_ALL expressions and expand
- ** each one to the list of all columns in all tables.
+ ** with the TK_ASTERISK operator for each "*" that it found in the column
+ ** list. The following code just has to locate the TK_ASTERISK
+ ** expressions and expand each one to the list of all columns in
+ ** all tables.
**
** The first loop just checks to see if there are any "*" operators
** that need expanding.
*/
for(k=0; k<pEList->nExpr; k++){
pE = pEList->a[k].pExpr;
- if( pE->op==TK_ALL ) break;
+ if( pE->op==TK_ASTERISK ) break;
assert( pE->op!=TK_DOT || pE->pRight!=0 );
assert( pE->op!=TK_DOT || (pE->pLeft!=0 && pE->pLeft->op==TK_ID) );
- if( pE->op==TK_DOT && pE->pRight->op==TK_ALL ) break;
+ if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break;
}
if( k<pEList->nExpr ){
/*
@@ -4309,7 +4310,9 @@ static int selectExpander(Walker *pWalker, Select *p){
pE = a[k].pExpr;
pRight = pE->pRight;
assert( pE->op!=TK_DOT || pRight!=0 );
- if( pE->op!=TK_ALL && (pE->op!=TK_DOT || pRight->op!=TK_ALL) ){
+ if( pE->op!=TK_ASTERISK
+ && (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK)
+ ){
/* This particular expression does not need to be expanded.
*/
pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr);