diff options
author | mistachkin <mistachkin@noemail.net> | 2012-04-18 05:57:38 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2012-04-18 05:57:38 +0000 |
commit | a749486e31f49b468fb48c9b42ac9d44530bae1a (patch) | |
tree | d8a33079142317e5fe70a9ed52bf604477af6e3a /src/select.c | |
parent | a6ff857437e621761348a2148418ca1b41308ecd (diff) | |
parent | 374fdce485ab55739dfd307ac00a59ebe8ce8d25 (diff) | |
download | sqlite-a749486e31f49b468fb48c9b42ac9d44530bae1a.tar.gz sqlite-a749486e31f49b468fb48c9b42ac9d44530bae1a.zip |
Import all the latest trunk changes into the WinRT branch. Refactor and/or remove WinCE-specific macros and functions used for file locking to improve clarity of presentation.
FossilOrigin-Name: ad5cd15f49b286896f94ab1ff207077beee40e12
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/select.c b/src/select.c index c22501367..835d9fd9c 100644 --- a/src/select.c +++ b/src/select.c @@ -1258,9 +1258,17 @@ static int selectColumnsFromExprList( char *zName; /* Column name */ int nName; /* Size of name in zName[] */ - *pnCol = nCol = pEList ? pEList->nExpr : 0; - aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); - if( aCol==0 ) return SQLITE_NOMEM; + if( pEList ){ + nCol = pEList->nExpr; + aCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); + testcase( aCol==0 ); + }else{ + nCol = 0; + aCol = 0; + } + *pnCol = nCol; + *paCol = aCol; + for(i=0, pCol=aCol; i<nCol; i++, pCol++){ /* Get an appropriate name for the column */ @@ -2843,7 +2851,8 @@ static int flattenSubquery( /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; - sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); + TESTONLY(i =) sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); + testcase( i==SQLITE_DENY ); pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions |