aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/select.c b/src/select.c
index 145f319b0..d0fff323c 100644
--- a/src/select.c
+++ b/src/select.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.292 2006/01/10 17:58:23 danielk1977 Exp $
+** $Id: select.c,v 1.293 2006/01/11 21:41:22 drh Exp $
*/
#include "sqliteInt.h"
@@ -872,7 +872,8 @@ static void generateColumnNames(
#endif
assert( v!=0 );
- if( pParse->colNamesSet || v==0 || sqlite3ThreadData()->mallocFailed ) return;
+ if( pParse->colNamesSet || v==0
+ || sqlite3ThreadDataReadOnly()->mallocFailed ) return;
pParse->colNamesSet = 1;
fullNames = (db->flags & SQLITE_FullColNames)!=0;
shortNames = (db->flags & SQLITE_ShortColNames)!=0;
@@ -1001,7 +1002,7 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
zName = sqlite3MPrintf("column%d", i+1);
}
sqlite3Dequote(zName);
- if( sqlite3ThreadData()->mallocFailed ){
+ if( sqlite3ThreadDataReadOnly()->mallocFailed ){
sqliteFree(zName);
sqlite3DeleteTable(0, pTab);
return 0;
@@ -1073,7 +1074,9 @@ static int prepSelectStmt(Parse *pParse, Select *p){
Table *pTab;
struct SrcList_item *pFrom;
- if( p==0 || p->pSrc==0 || sqlite3ThreadData()->mallocFailed ) return 1;
+ if( p==0 || p->pSrc==0 || sqlite3ThreadDataReadOnly()->mallocFailed ){
+ return 1;
+ }
pTabList = p->pSrc;
pEList = p->pEList;
@@ -2690,7 +2693,9 @@ int sqlite3Select(
AggInfo sAggInfo; /* Information used by aggregate queries */
int iEnd; /* Address of the end of the query */
- if( sqlite3ThreadData()->mallocFailed || pParse->nErr || p==0 ) return 1;
+ if( p==0 || sqlite3ThreadDataReadOnly()->mallocFailed || pParse->nErr ){
+ return 1;
+ }
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
memset(&sAggInfo, 0, sizeof(sAggInfo));
@@ -2944,7 +2949,7 @@ int sqlite3Select(
goto select_end;
}
}
- if( sqlite3ThreadData()->mallocFailed ) goto select_end;
+ if( sqlite3ThreadDataReadOnly()->mallocFailed ) goto select_end;
/* Processing for aggregates with GROUP BY is very different and
** much more complex tha aggregates without a GROUP BY.