aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c577
1 files changed, 290 insertions, 287 deletions
diff --git a/src/select.c b/src/select.c
index 5e64d47b9..bd3d7ae51 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.161 2004/03/13 14:00:36 drh Exp $
+** $Id: select.c,v 1.162 2004/05/08 08:23:32 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -21,7 +21,7 @@
** Allocate a new Select structure and return a pointer to that
** structure.
*/
-Select *sqliteSelectNew(
+Select *sqlite3SelectNew(
ExprList *pEList, /* which columns to include in the result */
SrcList *pSrc, /* the FROM clause -- which tables to scan */
Expr *pWhere, /* the WHERE clause */
@@ -35,15 +35,15 @@ Select *sqliteSelectNew(
Select *pNew;
pNew = sqliteMalloc( sizeof(*pNew) );
if( pNew==0 ){
- sqliteExprListDelete(pEList);
- sqliteSrcListDelete(pSrc);
- sqliteExprDelete(pWhere);
- sqliteExprListDelete(pGroupBy);
- sqliteExprDelete(pHaving);
- sqliteExprListDelete(pOrderBy);
+ sqlite3ExprListDelete(pEList);
+ sqlite3SrcListDelete(pSrc);
+ sqlite3ExprDelete(pWhere);
+ sqlite3ExprListDelete(pGroupBy);
+ sqlite3ExprDelete(pHaving);
+ sqlite3ExprListDelete(pOrderBy);
}else{
if( pEList==0 ){
- pEList = sqliteExprListAppend(0, sqliteExpr(TK_ALL,0,0,0), 0);
+ pEList = sqlite3ExprListAppend(0, sqlite3Expr(TK_ALL,0,0,0), 0);
}
pNew->pEList = pEList;
pNew->pSrc = pSrc;
@@ -77,7 +77,7 @@ Select *sqliteSelectNew(
** If an illegal or unsupported join type is seen, then still return
** a join type, but put an error in the pParse structure.
*/
-int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
+int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
int jointype = 0;
Token *apAll[3];
Token *p;
@@ -102,7 +102,7 @@ int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
p = apAll[i];
for(j=0; j<sizeof(keywords)/sizeof(keywords[0]); j++){
if( p->n==keywords[j].nChar
- && sqliteStrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){
+ && sqlite3StrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){
jointype |= keywords[j].code;
break;
}
@@ -120,12 +120,12 @@ int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
char *zSp1 = " ", *zSp2 = " ";
if( pB==0 ){ pB = &dummy; zSp1 = 0; }
if( pC==0 ){ pC = &dummy; zSp2 = 0; }
- sqliteSetNString(&pParse->zErrMsg, "unknown or unsupported join type: ", 0,
+ sqlite3SetNString(&pParse->zErrMsg, "unknown or unsupported join type: ", 0,
pA->z, pA->n, zSp1, 1, pB->z, pB->n, zSp2, 1, pC->z, pC->n, 0);
pParse->nErr++;
jointype = JT_INNER;
}else if( jointype & JT_RIGHT ){
- sqliteErrorMsg(pParse,
+ sqlite3ErrorMsg(pParse,
"RIGHT and FULL OUTER JOINs are not currently supported");
jointype = JT_INNER;
}
@@ -139,7 +139,7 @@ int sqliteJoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
static int columnIndex(Table *pTab, const char *zCol){
int i;
for(i=0; i<pTab->nCol; i++){
- if( sqliteStrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;
+ if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;
}
return -1;
}
@@ -162,20 +162,20 @@ static void addWhereTerm(
dummy.z = zCol;
dummy.n = strlen(zCol);
dummy.dyn = 0;
- pE1a = sqliteExpr(TK_ID, 0, 0, &dummy);
- pE2a = sqliteExpr(TK_ID, 0, 0, &dummy);
+ pE1a = sqlite3Expr(TK_ID, 0, 0, &dummy);
+ pE2a = sqlite3Expr(TK_ID, 0, 0, &dummy);
dummy.z = pTab1->zName;
dummy.n = strlen(dummy.z);
- pE1b = sqliteExpr(TK_ID, 0, 0, &dummy);
+ pE1b = sqlite3Expr(TK_ID, 0, 0, &dummy);
dummy.z = pTab2->zName;
dummy.n = strlen(dummy.z);
- pE2b = sqliteExpr(TK_ID, 0, 0, &dummy);
- pE1c = sqliteExpr(TK_DOT, pE1b, pE1a, 0);
- pE2c = sqliteExpr(TK_DOT, pE2b, pE2a, 0);
- pE = sqliteExpr(TK_EQ, pE1c, pE2c, 0);
+ pE2b = sqlite3Expr(TK_ID, 0, 0, &dummy);
+ pE1c = sqlite3Expr(TK_DOT, pE1b, pE1a, 0);
+ pE2c = sqlite3Expr(TK_DOT, pE2b, pE2a, 0);
+ pE = sqlite3Expr(TK_EQ, pE1c, pE2c, 0);
ExprSetProperty(pE, EP_FromJoin);
if( *ppExpr ){
- *ppExpr = sqliteExpr(TK_AND, *ppExpr, pE, 0);
+ *ppExpr = sqlite3Expr(TK_AND, *ppExpr, pE, 0);
}else{
*ppExpr = pE;
}
@@ -222,7 +222,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
if( pTerm->jointype & JT_NATURAL ){
Table *pTab;
if( pTerm->pOn || pTerm->pUsing ){
- sqliteErrorMsg(pParse, "a NATURAL join may not have "
+ sqlite3ErrorMsg(pParse, "a NATURAL join may not have "
"an ON or USING clause", 0);
return 1;
}
@@ -237,7 +237,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
/* Disallow both ON and USING clauses in the same join
*/
if( pTerm->pOn && pTerm->pUsing ){
- sqliteErrorMsg(pParse, "cannot have both ON and USING "
+ sqlite3ErrorMsg(pParse, "cannot have both ON and USING "
"clauses in the same join");
return 1;
}
@@ -250,7 +250,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
if( p->pWhere==0 ){
p->pWhere = pTerm->pOn;
}else{
- p->pWhere = sqliteExpr(TK_AND, p->pWhere, pTerm->pOn, 0);
+ p->pWhere = sqlite3Expr(TK_AND, p->pWhere, pTerm->pOn, 0);
}
pTerm->pOn = 0;
}
@@ -270,7 +270,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
for(j=0; j<pList->nId; j++){
if( columnIndex(pTerm->pTab, pList->a[j].zName)<0 ||
columnIndex(pOther->pTab, pList->a[j].zName)<0 ){
- sqliteErrorMsg(pParse, "cannot join using column %s - column "
+ sqlite3ErrorMsg(pParse, "cannot join using column %s - column "
"not present in both tables", pList->a[j].zName);
return 1;
}
@@ -284,15 +284,15 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
/*
** Delete the given Select structure and all of its substructures.
*/
-void sqliteSelectDelete(Select *p){
+void sqlite3SelectDelete(Select *p){
if( p==0 ) return;
- sqliteExprListDelete(p->pEList);
- sqliteSrcListDelete(p->pSrc);
- sqliteExprDelete(p->pWhere);
- sqliteExprListDelete(p->pGroupBy);
- sqliteExprDelete(p->pHaving);
- sqliteExprListDelete(p->pOrderBy);
- sqliteSelectDelete(p->pPrior);
+ sqlite3ExprListDelete(p->pEList);
+ sqlite3SrcListDelete(p->pSrc);
+ sqlite3ExprDelete(p->pWhere);
+ sqlite3ExprListDelete(p->pGroupBy);
+ sqlite3ExprDelete(p->pHaving);
+ sqlite3ExprListDelete(p->pOrderBy);
+ sqlite3SelectDelete(p->pPrior);
sqliteFree(p->zSelect);
sqliteFree(p);
}
@@ -325,7 +325,7 @@ static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){
}else if( (order & SQLITE_SO_TYPEMASK)==SQLITE_SO_NUM ){
type = SQLITE_SO_NUM;
}else if( pParse->db->file_format>=4 ){
- type = sqliteExprType(pOrderBy->a[i].pExpr);
+ type = sqlite3ExprType(pOrderBy->a[i].pExpr);
}else{
type = SQLITE_SO_NUM;
}
@@ -335,11 +335,11 @@ static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){
c = type==SQLITE_SO_TEXT ? 'D' : '-';
}
zSortOrder[i] = c;
- sqliteExprCode(pParse, pOrderBy->a[i].pExpr);
+ sqlite3ExprCode(pParse, pOrderBy->a[i].pExpr);
}
zSortOrder[pOrderBy->nExpr] = 0;
- sqliteVdbeOp3(v, OP_SortMakeKey, pOrderBy->nExpr, 0, zSortOrder, P3_DYNAMIC);
- sqliteVdbeAddOp(v, OP_SortPut, 0, 0);
+ sqlite3VdbeOp3(v, OP_SortMakeKey, pOrderBy->nExpr, 0, zSortOrder, P3_DYNAMIC);
+ sqlite3VdbeAddOp(v, OP_SortPut, 0, 0);
}
/*
@@ -350,18 +350,18 @@ static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){
** fields of the key to be generated should be treated as numeric
** or as text. See the OP_MakeKey and OP_MakeIdxKey opcode
** documentation for additional information about the P3 string.
-** See also the sqliteAddIdxKeyType() routine.
+** See also the sqlite3AddIdxKeyType() routine.
*/
-void sqliteAddKeyType(Vdbe *v, ExprList *pEList){
+void sqlite3AddKeyType(Vdbe *v, ExprList *pEList){
int nColumn = pEList->nExpr;
char *zType = sqliteMalloc( nColumn+1 );
int i;
if( zType==0 ) return;
for(i=0; i<nColumn; i++){
- zType[i] = sqliteExprType(pEList->a[i].pExpr)==SQLITE_SO_NUM ? 'n' : 't';
+ zType[i] = sqlite3ExprType(pEList->a[i].pExpr)==SQLITE_SO_NUM ? 'n' : 't';
}
zType[i] = 0;
- sqliteVdbeChangeP3(v, -1, zType, P3_DYNAMIC);
+ sqlite3VdbeChangeP3(v, -1, zType, P3_DYNAMIC);
}
/*
@@ -397,12 +397,12 @@ static int selectInnerLoop(
*/
if( pOrderBy==0 ){
if( p->iOffset>=0 ){
- int addr = sqliteVdbeCurrentAddr(v);
- sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+2);
- sqliteVdbeAddOp(v, OP_Goto, 0, iContinue);
+ int addr = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iOffset, addr+2);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iContinue);
}
if( p->iLimit>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak);
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak);
}
}
@@ -410,12 +410,12 @@ static int selectInnerLoop(
*/
if( nColumn>0 ){
for(i=0; i<nColumn; i++){
- sqliteVdbeAddOp(v, OP_Column, srcTab, i);
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, i);
}
}else{
nColumn = pEList->nExpr;
for(i=0; i<pEList->nExpr; i++){
- sqliteExprCode(pParse, pEList->a[i].pExpr);
+ sqlite3ExprCode(pParse, pEList->a[i].pExpr);
}
}
@@ -425,15 +425,15 @@ static int selectInnerLoop(
*/
if( distinct>=0 && pEList && pEList->nExpr>0 ){
#if NULL_ALWAYS_DISTINCT
- sqliteVdbeAddOp(v, OP_IsNull, -pEList->nExpr, sqliteVdbeCurrentAddr(v)+7);
+ sqlite3VdbeAddOp(v, OP_IsNull, -pEList->nExpr, sqlite3VdbeCurrentAddr(v)+7);
#endif
- sqliteVdbeAddOp(v, OP_MakeKey, pEList->nExpr, 1);
- if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pEList);
- sqliteVdbeAddOp(v, OP_Distinct, distinct, sqliteVdbeCurrentAddr(v)+3);
- sqliteVdbeAddOp(v, OP_Pop, pEList->nExpr+1, 0);
- sqliteVdbeAddOp(v, OP_Goto, 0, iContinue);
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_PutStrKey, distinct, 0);
+ sqlite3VdbeAddOp(v, OP_MakeKey, pEList->nExpr, 1);
+ if( pParse->db->file_format>=4 ) sqlite3AddKeyType(v, pEList);
+ sqlite3VdbeAddOp(v, OP_Distinct, distinct, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, pEList->nExpr+1, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iContinue);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_PutStrKey, distinct, 0);
}
switch( eDest ){
@@ -441,9 +441,9 @@ static int selectInnerLoop(
** table iParm.
*/
case SRT_Union: {
- sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_PutStrKey, iParm, 0);
break;
}
@@ -451,13 +451,13 @@ static int selectInnerLoop(
*/
case SRT_Table:
case SRT_TempTable: {
- sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
if( pOrderBy ){
pushOntoSorter(pParse, v, pOrderBy);
}else{
- sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0);
- sqliteVdbeAddOp(v, OP_Pull, 1, 0);
- sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_NewRecno, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_PutIntKey, iParm, 0);
}
break;
}
@@ -468,9 +468,9 @@ static int selectInnerLoop(
*/
case SRT_Except: {
int addr;
- addr = sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
- sqliteVdbeAddOp(v, OP_NotFound, iParm, addr+3);
- sqliteVdbeAddOp(v, OP_Delete, iParm, 0);
+ addr = sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ sqlite3VdbeAddOp(v, OP_NotFound, iParm, addr+3);
+ sqlite3VdbeAddOp(v, OP_Delete, iParm, 0);
break;
}
@@ -479,19 +479,19 @@ static int selectInnerLoop(
** item into the set table with bogus data.
*/
case SRT_Set: {
- int addr1 = sqliteVdbeCurrentAddr(v);
+ int addr1 = sqlite3VdbeCurrentAddr(v);
int addr2;
assert( nColumn==1 );
- sqliteVdbeAddOp(v, OP_NotNull, -1, addr1+3);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
- addr2 = sqliteVdbeAddOp(v, OP_Goto, 0, 0);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, addr1+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);
if( pOrderBy ){
pushOntoSorter(pParse, v, pOrderBy);
}else{
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_PutStrKey, iParm, 0);
}
- sqliteVdbeChangeP2(v, addr2, sqliteVdbeCurrentAddr(v));
+ sqlite3VdbeChangeP2(v, addr2, sqlite3VdbeCurrentAddr(v));
break;
}
@@ -504,8 +504,8 @@ static int selectInnerLoop(
if( pOrderBy ){
pushOntoSorter(pParse, v, pOrderBy);
}else{
- sqliteVdbeAddOp(v, OP_MemStore, iParm, 1);
- sqliteVdbeAddOp(v, OP_Goto, 0, iBreak);
+ sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iBreak);
}
break;
}
@@ -515,11 +515,11 @@ static int selectInnerLoop(
case SRT_Callback:
case SRT_Sorter: {
if( pOrderBy ){
- sqliteVdbeAddOp(v, OP_SortMakeRec, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_SortMakeRec, nColumn, 0);
pushOntoSorter(pParse, v, pOrderBy);
}else{
assert( eDest==SRT_Callback );
- sqliteVdbeAddOp(v, OP_Callback, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, nColumn, 0);
}
break;
}
@@ -529,10 +529,10 @@ static int selectInnerLoop(
*/
case SRT_Subroutine: {
if( pOrderBy ){
- sqliteVdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
pushOntoSorter(pParse, v, pOrderBy);
}else{
- sqliteVdbeAddOp(v, OP_Gosub, 0, iParm);
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm);
}
break;
}
@@ -544,7 +544,7 @@ static int selectInnerLoop(
*/
default: {
assert( eDest==SRT_Discard );
- sqliteVdbeAddOp(v, OP_Pop, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
break;
}
}
@@ -564,54 +564,54 @@ static void generateSortTail(
int eDest, /* Write the sorted results here */
int iParm /* Optional parameter associated with eDest */
){
- int end1 = sqliteVdbeMakeLabel(v);
- int end2 = sqliteVdbeMakeLabel(v);
+ int end1 = sqlite3VdbeMakeLabel(v);
+ int end2 = sqlite3VdbeMakeLabel(v);
int addr;
if( eDest==SRT_Sorter ) return;
- sqliteVdbeAddOp(v, OP_Sort, 0, 0);
- addr = sqliteVdbeAddOp(v, OP_SortNext, 0, end1);
+ sqlite3VdbeAddOp(v, OP_Sort, 0, 0);
+ addr = sqlite3VdbeAddOp(v, OP_SortNext, 0, end1);
if( p->iOffset>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+4);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
- sqliteVdbeAddOp(v, OP_Goto, 0, addr);
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iOffset, addr+4);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr);
}
if( p->iLimit>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, end2);
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iLimit, end2);
}
switch( eDest ){
case SRT_Callback: {
- sqliteVdbeAddOp(v, OP_SortCallback, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_SortCallback, nColumn, 0);
break;
}
case SRT_Table:
case SRT_TempTable: {
- sqliteVdbeAddOp(v, OP_NewRecno, iParm, 0);
- sqliteVdbeAddOp(v, OP_Pull, 1, 0);
- sqliteVdbeAddOp(v, OP_PutIntKey, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_NewRecno, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_PutIntKey, iParm, 0);
break;
}
case SRT_Set: {
assert( nColumn==1 );
- sqliteVdbeAddOp(v, OP_NotNull, -1, sqliteVdbeCurrentAddr(v)+3);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
- sqliteVdbeAddOp(v, OP_Goto, 0, sqliteVdbeCurrentAddr(v)+3);
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_PutStrKey, iParm, 0);
break;
}
case SRT_Mem: {
assert( nColumn==1 );
- sqliteVdbeAddOp(v, OP_MemStore, iParm, 1);
- sqliteVdbeAddOp(v, OP_Goto, 0, end1);
+ sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, end1);
break;
}
case SRT_Subroutine: {
int i;
for(i=0; i<nColumn; i++){
- sqliteVdbeAddOp(v, OP_Column, -1-i, i);
+ sqlite3VdbeAddOp(v, OP_Column, -1-i, i);
}
- sqliteVdbeAddOp(v, OP_Gosub, 0, iParm);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
break;
}
default: {
@@ -619,11 +619,11 @@ static void generateSortTail(
break;
}
}
- sqliteVdbeAddOp(v, OP_Goto, 0, addr);
- sqliteVdbeResolveLabel(v, end2);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
- sqliteVdbeResolveLabel(v, end1);
- sqliteVdbeAddOp(v, OP_SortReset, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr);
+ sqlite3VdbeResolveLabel(v, end2);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeResolveLabel(v, end1);
+ sqlite3VdbeAddOp(v, OP_SortReset, 0, 0);
}
/*
@@ -666,13 +666,13 @@ static void generateColumnTypes(
zType = pTab->aCol[iCol].zType;
}
}else{
- if( sqliteExprType(p)==SQLITE_SO_TEXT ){
+ if( sqlite3ExprType(p)==SQLITE_SO_TEXT ){
zType = "TEXT";
}else{
zType = "NUMERIC";
}
}
- sqliteVdbeOp3(v, OP_ColumnName, i + pEList->nExpr, 0, zType, 0);
+ sqlite3VdbeOp3(v, OP_ColumnName, i + pEList->nExpr, 0, zType, 0);
}
}
@@ -703,7 +703,7 @@ static void generateColumnNames(
if( p==0 ) continue;
if( pEList->a[i].zName ){
char *zName = pEList->a[i].zName;
- sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0);
+ sqlite3VdbeOp3(v, OP_ColumnName, i, p2, zName, 0);
continue;
}
if( p->op==TK_COLUMN && pTabList ){
@@ -721,27 +721,27 @@ static void generateColumnNames(
zCol = pTab->aCol[iCol].zName;
}
if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){
- int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n);
- sqliteVdbeCompressSpace(v, addr);
+ int addr = sqlite3VdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n);
+ sqlite3VdbeCompressSpace(v, addr);
}else if( fullNames || (!shortNames && pTabList->nSrc>1) ){
char *zName = 0;
char *zTab;
zTab = pTabList->a[j].zAlias;
if( fullNames || zTab==0 ) zTab = pTab->zName;
- sqliteSetString(&zName, zTab, ".", zCol, 0);
- sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, P3_DYNAMIC);
+ sqlite3SetString(&zName, zTab, ".", zCol, 0);
+ sqlite3VdbeOp3(v, OP_ColumnName, i, p2, zName, P3_DYNAMIC);
}else{
- sqliteVdbeOp3(v, OP_ColumnName, i, p2, zCol, 0);
+ sqlite3VdbeOp3(v, OP_ColumnName, i, p2, zCol, 0);
}
}else if( p->span.z && p->span.z[0] ){
- int addr = sqliteVdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n);
- sqliteVdbeCompressSpace(v, addr);
+ int addr = sqlite3VdbeOp3(v,OP_ColumnName, i, p2, p->span.z, p->span.n);
+ sqlite3VdbeCompressSpace(v, addr);
}else{
char zName[30];
assert( p->op!=TK_COLUMN || pTabList==0 );
sprintf(zName, "column%d", i+1);
- sqliteVdbeOp3(v, OP_ColumnName, i, p2, zName, 0);
+ sqlite3VdbeOp3(v, OP_ColumnName, i, p2, zName, 0);
}
}
}
@@ -769,7 +769,7 @@ static int fillInColumnList(Parse*, Select*);
** Given a SELECT statement, generate a Table structure that describes
** the result set of that SELECT.
*/
-Table *sqliteResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
+Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
Table *pTab;
int i, j;
ExprList *pEList;
@@ -794,19 +794,19 @@ Table *sqliteResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
}else if( (p=pEList->a[i].pExpr)->op==TK_DOT
&& (pR=p->pRight)!=0 && pR->token.z && pR->token.z[0] ){
int cnt;
- sqliteSetNString(&aCol[i].zName, pR->token.z, pR->token.n, 0);
+ sqlite3SetNString(&aCol[i].zName, pR->token.z, pR->token.n, 0);
for(j=cnt=0; j<i; j++){
- if( sqliteStrICmp(aCol[j].zName, aCol[i].zName)==0 ){
+ if( sqlite3StrICmp(aCol[j].zName, aCol[i].zName)==0 ){
int n;
char zBuf[30];
sprintf(zBuf,"_%d",++cnt);
n = strlen(zBuf);
- sqliteSetNString(&aCol[i].zName, pR->token.z, pR->token.n, zBuf, n,0);
+ sqlite3SetNString(&aCol[i].zName, pR->token.z, pR->token.n, zBuf, n,0);
j = -1;
}
}
}else if( p->span.z && p->span.z[0] ){
- sqliteSetNString(&pTab->aCol[i].zName, p->span.z, p->span.n, 0);
+ sqlite3SetNString(&pTab->aCol[i].zName, p->span.z, p->span.n, 0);
}else{
char zBuf[30];
sprintf(zBuf, "column%d", i+1);
@@ -863,10 +863,10 @@ static int fillInColumnList(Parse *pParse, Select *p){
char zFakeName[60];
sprintf(zFakeName, "sqlite_subquery_%p_",
(void*)pTabList->a[i].pSelect);
- sqliteSetString(&pTabList->a[i].zAlias, zFakeName, 0);
+ sqlite3SetString(&pTabList->a[i].zAlias, zFakeName, 0);
}
pTabList->a[i].pTab = pTab =
- sqliteResultSetOfSelect(pParse, pTabList->a[i].zAlias,
+ sqlite3ResultSetOfSelect(pParse, pTabList->a[i].zAlias,
pTabList->a[i].pSelect);
if( pTab==0 ){
return 1;
@@ -879,13 +879,13 @@ static int fillInColumnList(Parse *pParse, Select *p){
}else{
/* An ordinary table or view name in the FROM clause */
pTabList->a[i].pTab = pTab =
- sqliteLocateTable(pParse,pTabList->a[i].zName,pTabList->a[i].zDatabase);
+ sqlite3LocateTable(pParse,pTabList->a[i].zName,pTabList->a[i].zDatabase);
if( pTab==0 ){
return 1;
}
if( pTab->pSelect ){
/* We reach here if the named table is a really a view */
- if( sqliteViewGetColumnNames(pParse, pTab) ){
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
return 1;
}
/* If pTabList->a[i].pSelect!=0 it means we are dealing with a
@@ -894,7 +894,7 @@ static int fillInColumnList(Parse *pParse, Select *p){
** in the inner view.
*/
if( pTabList->a[i].pSelect==0 ){
- pTabList->a[i].pSelect = sqliteSelectDup(pTab->pSelect);
+ pTabList->a[i].pSelect = sqlite3SelectDup(pTab->pSelect);
}
}
}
@@ -935,7 +935,7 @@ static int fillInColumnList(Parse *pParse, Select *p){
(pE->op!=TK_DOT || pE->pRight==0 || pE->pRight->op!=TK_ALL) ){
/* This particular expression does not need to be expanded.
*/
- pNew = sqliteExprListAppend(pNew, a[k].pExpr, 0);
+ pNew = sqlite3ExprListAppend(pNew, a[k].pExpr, 0);
pNew->a[pNew->nExpr-1].zName = a[k].zName;
a[k].pExpr = 0;
a[k].zName = 0;
@@ -956,7 +956,7 @@ static int fillInColumnList(Parse *pParse, Select *p){
zTabName = pTab->zName;
}
if( pName && (zTabName==0 || zTabName[0]==0 ||
- sqliteStrNICmp(pName->z, zTabName, pName->n)!=0 ||
+ sqlite3StrNICmp(pName->z, zTabName, pName->n)!=0 ||
zTabName[pName->n]!=0) ){
continue;
}
@@ -971,24 +971,24 @@ static int fillInColumnList(Parse *pParse, Select *p){
** table on the right */
continue;
}
- if( i>0 && sqliteIdListIndex(pTabList->a[i-1].pUsing, zName)>=0 ){
+ if( i>0 && sqlite3IdListIndex(pTabList->a[i-1].pUsing, zName)>=0 ){
/* In a join with a USING clause, omit columns in the
** using clause from the table on the right. */
continue;
}
- pRight = sqliteExpr(TK_ID, 0, 0, 0);
+ pRight = sqlite3Expr(TK_ID, 0, 0, 0);
if( pRight==0 ) break;
pRight->token.z = zName;
pRight->token.n = strlen(zName);
pRight->token.dyn = 0;
if( zTabName && pTabList->nSrc>1 ){
- pLeft = sqliteExpr(TK_ID, 0, 0, 0);
- pExpr = sqliteExpr(TK_DOT, pLeft, pRight, 0);
+ pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
+ pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0);
if( pExpr==0 ) break;
pLeft->token.z = zTabName;
pLeft->token.n = strlen(zTabName);
pLeft->token.dyn = 0;
- sqliteSetString((char**)&pExpr->span.z, zTabName, ".", zName, 0);
+ sqlite3SetString((char**)&pExpr->span.z, zTabName, ".", zName, 0);
pExpr->span.n = strlen(pExpr->span.z);
pExpr->span.dyn = 1;
pExpr->token.z = 0;
@@ -998,20 +998,20 @@ static int fillInColumnList(Parse *pParse, Select *p){
pExpr = pRight;
pExpr->span = pExpr->token;
}
- pNew = sqliteExprListAppend(pNew, pExpr, 0);
+ pNew = sqlite3ExprListAppend(pNew, pExpr, 0);
}
}
if( !tableSeen ){
if( pName ){
- sqliteErrorMsg(pParse, "no such table: %T", pName);
+ sqlite3ErrorMsg(pParse, "no such table: %T", pName);
}else{
- sqliteErrorMsg(pParse, "no tables specified");
+ sqlite3ErrorMsg(pParse, "no tables specified");
}
rc = 1;
}
}
}
- sqliteExprListDelete(pEList);
+ sqlite3ExprListDelete(pEList);
p->pEList = pNew;
}
return rc;
@@ -1030,7 +1030,7 @@ static int fillInColumnList(Parse *pParse, Select *p){
** will be left pointing to a deallocated Table structure after the
** DROP and a coredump will occur the next time the VIEW is used.
*/
-void sqliteSelectUnbind(Select *p){
+void sqlite3SelectUnbind(Select *p){
int i;
SrcList *pSrc = p->pSrc;
Table *pTab;
@@ -1038,11 +1038,11 @@ void sqliteSelectUnbind(Select *p){
for(i=0; i<pSrc->nSrc; i++){
if( (pTab = pSrc->a[i].pTab)!=0 ){
if( pTab->isTransient ){
- sqliteDeleteTable(0, pTab);
+ sqlite3DeleteTable(0, pTab);
}
pSrc->a[i].pTab = 0;
if( pSrc->a[i].pSelect ){
- sqliteSelectUnbind(pSrc->a[i].pSelect);
+ sqlite3SelectUnbind(pSrc->a[i].pSelect);
}
}
}
@@ -1096,9 +1096,9 @@ static int matchOrderbyToColumn(
Expr *pE = pOrderBy->a[i].pExpr;
int iCol = -1;
if( pOrderBy->a[i].done ) continue;
- if( sqliteExprIsInteger(pE, &iCol) ){
+ if( sqlite3ExprIsInteger(pE, &iCol) ){
if( iCol<=0 || iCol>pEList->nExpr ){
- sqliteErrorMsg(pParse,
+ sqlite3ErrorMsg(pParse,
"ORDER BY position %d should be between 1 and %d",
iCol, pEList->nExpr);
nErr++;
@@ -1113,13 +1113,13 @@ static int matchOrderbyToColumn(
zName = pEList->a[j].zName;
assert( pE->token.z );
zLabel = sqliteStrNDup(pE->token.z, pE->token.n);
- sqliteDequote(zLabel);
- if( sqliteStrICmp(zName, zLabel)==0 ){
+ sqlite3Dequote(zLabel);
+ if( sqlite3StrICmp(zName, zLabel)==0 ){
iCol = j;
}
sqliteFree(zLabel);
}
- if( iCol<0 && sqliteExprCompare(pE, pEList->a[j].pExpr) ){
+ if( iCol<0 && sqlite3ExprCompare(pE, pEList->a[j].pExpr) ){
iCol = j;
}
}
@@ -1130,7 +1130,7 @@ static int matchOrderbyToColumn(
pOrderBy->a[i].done = 1;
}
if( iCol<0 && mustComplete ){
- sqliteErrorMsg(pParse,
+ sqlite3ErrorMsg(pParse,
"ORDER BY term number %d does not match any result column", i+1);
nErr++;
break;
@@ -1143,10 +1143,10 @@ static int matchOrderbyToColumn(
** Get a VDBE for the given parser context. Create a new one if necessary.
** If an error occurs, return NULL and leave a message in pParse.
*/
-Vdbe *sqliteGetVdbe(Parse *pParse){
+Vdbe *sqlite3GetVdbe(Parse *pParse){
Vdbe *v = pParse->pVdbe;
if( v==0 ){
- v = pParse->pVdbe = sqliteVdbeCreate(pParse->db);
+ v = pParse->pVdbe = sqlite3VdbeCreate(pParse->db);
}
return v;
}
@@ -1195,7 +1195,7 @@ static void multiSelectSortOrder(Select *p, ExprList *pOrderBy){
if( pE->dataType==SQLITE_SO_NUM ) continue;
assert( pE->iColumn>=0 );
if( pEList->nExpr>pE->iColumn ){
- pE->dataType = sqliteExprType(pEList->a[pE->iColumn].pExpr);
+ pE->dataType = sqlite3ExprType(pEList->a[pE->iColumn].pExpr);
}
}
}
@@ -1230,18 +1230,18 @@ static void computeLimitRegisters(Parse *pParse, Select *p){
*/
if( p->nLimit>=0 ){
int iMem = pParse->nMem++;
- Vdbe *v = sqliteGetVdbe(pParse);
+ Vdbe *v = sqlite3GetVdbe(pParse);
if( v==0 ) return;
- sqliteVdbeAddOp(v, OP_Integer, -p->nLimit, 0);
- sqliteVdbeAddOp(v, OP_MemStore, iMem, 1);
+ sqlite3VdbeAddOp(v, OP_Integer, -p->nLimit, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1);
p->iLimit = iMem;
}
if( p->nOffset>0 ){
int iMem = pParse->nMem++;
- Vdbe *v = sqliteGetVdbe(pParse);
+ Vdbe *v = sqlite3GetVdbe(pParse);
if( v==0 ) return;
- sqliteVdbeAddOp(v, OP_Integer, -p->nOffset, 0);
- sqliteVdbeAddOp(v, OP_MemStore, iMem, 1);
+ sqlite3VdbeAddOp(v, OP_Integer, -p->nOffset, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1);
p->iOffset = iMem;
}
}
@@ -1287,25 +1287,25 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
if( p==0 || p->pPrior==0 ) return 1;
pPrior = p->pPrior;
if( pPrior->pOrderBy ){
- sqliteErrorMsg(pParse,"ORDER BY clause should come after %s not before",
+ sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",
selectOpName(p->op));
return 1;
}
if( pPrior->nLimit>=0 || pPrior->nOffset>0 ){
- sqliteErrorMsg(pParse,"LIMIT clause should come after %s not before",
+ sqlite3ErrorMsg(pParse,"LIMIT clause should come after %s not before",
selectOpName(p->op));
return 1;
}
/* Make sure we have a valid query engine. If not, create a new one.
*/
- v = sqliteGetVdbe(pParse);
+ v = sqlite3GetVdbe(pParse);
if( v==0 ) return 1;
/* Create the destination temporary table if necessary
*/
if( eDest==SRT_TempTable ){
- sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
eDest = SRT_Table;
}
@@ -1316,14 +1316,14 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
if( p->pOrderBy==0 ){
pPrior->nLimit = p->nLimit;
pPrior->nOffset = p->nOffset;
- rc = sqliteSelect(pParse, pPrior, eDest, iParm, 0, 0, 0);
+ rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0);
if( rc ) return rc;
p->pPrior = 0;
p->iLimit = pPrior->iLimit;
p->iOffset = pPrior->iOffset;
p->nLimit = -1;
p->nOffset = 0;
- rc = sqliteSelect(pParse, p, eDest, iParm, 0, 0, 0);
+ rc = sqlite3Select(pParse, p, eDest, iParm, 0, 0, 0);
p->pPrior = pPrior;
if( rc ) return rc;
break;
@@ -1354,16 +1354,16 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
return 1;
}
if( p->op!=TK_ALL ){
- sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 1);
- sqliteVdbeAddOp(v, OP_KeyAsData, unionTab, 1);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, unionTab, 1);
+ sqlite3VdbeAddOp(v, OP_KeyAsData, unionTab, 1);
}else{
- sqliteVdbeAddOp(v, OP_OpenTemp, unionTab, 0);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, unionTab, 0);
}
}
/* Code the SELECT statements to our left
*/
- rc = sqliteSelect(pParse, pPrior, priorOp, unionTab, 0, 0, 0);
+ rc = sqlite3Select(pParse, pPrior, priorOp, unionTab, 0, 0, 0);
if( rc ) return rc;
/* Code the current SELECT statement
@@ -1380,7 +1380,7 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
p->nLimit = -1;
nOffset = p->nOffset;
p->nOffset = 0;
- rc = sqliteSelect(pParse, p, op, unionTab, 0, 0, 0);
+ rc = sqlite3Select(pParse, p, op, unionTab, 0, 0, 0);
p->pPrior = pPrior;
p->pOrderBy = pOrderBy;
p->nLimit = nLimit;
@@ -1397,20 +1397,20 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
generateColumnNames(pParse, 0, p->pEList);
generateColumnTypes(pParse, p->pSrc, p->pEList);
}
- iBreak = sqliteVdbeMakeLabel(v);
- iCont = sqliteVdbeMakeLabel(v);
- sqliteVdbeAddOp(v, OP_Rewind, unionTab, iBreak);
+ iBreak = sqlite3VdbeMakeLabel(v);
+ iCont = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, unionTab, iBreak);
computeLimitRegisters(pParse, p);
- iStart = sqliteVdbeCurrentAddr(v);
+ iStart = sqlite3VdbeCurrentAddr(v);
multiSelectSortOrder(p, p->pOrderBy);
rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr,
p->pOrderBy, -1, eDest, iParm,
iCont, iBreak);
if( rc ) return 1;
- sqliteVdbeResolveLabel(v, iCont);
- sqliteVdbeAddOp(v, OP_Next, unionTab, iStart);
- sqliteVdbeResolveLabel(v, iBreak);
- sqliteVdbeAddOp(v, OP_Close, unionTab, 0);
+ sqlite3VdbeResolveLabel(v, iCont);
+ sqlite3VdbeAddOp(v, OP_Next, unionTab, iStart);
+ sqlite3VdbeResolveLabel(v, iBreak);
+ sqlite3VdbeAddOp(v, OP_Close, unionTab, 0);
if( p->pOrderBy ){
generateSortTail(p, v, p->pEList->nExpr, eDest, iParm);
}
@@ -1431,24 +1431,24 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
if( p->pOrderBy && matchOrderbyToColumn(pParse,p,p->pOrderBy,tab1,1) ){
return 1;
}
- sqliteVdbeAddOp(v, OP_OpenTemp, tab1, 1);
- sqliteVdbeAddOp(v, OP_KeyAsData, tab1, 1);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, tab1, 1);
+ sqlite3VdbeAddOp(v, OP_KeyAsData, tab1, 1);
/* Code the SELECTs to our left into temporary table "tab1".
*/
- rc = sqliteSelect(pParse, pPrior, SRT_Union, tab1, 0, 0, 0);
+ rc = sqlite3Select(pParse, pPrior, SRT_Union, tab1, 0, 0, 0);
if( rc ) return rc;
/* Code the current SELECT into temporary table "tab2"
*/
- sqliteVdbeAddOp(v, OP_OpenTemp, tab2, 1);
- sqliteVdbeAddOp(v, OP_KeyAsData, tab2, 1);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, tab2, 1);
+ sqlite3VdbeAddOp(v, OP_KeyAsData, tab2, 1);
p->pPrior = 0;
nLimit = p->nLimit;
p->nLimit = -1;
nOffset = p->nOffset;
p->nOffset = 0;
- rc = sqliteSelect(pParse, p, SRT_Union, tab2, 0, 0, 0);
+ rc = sqlite3Select(pParse, p, SRT_Union, tab2, 0, 0, 0);
p->pPrior = pPrior;
p->nLimit = nLimit;
p->nOffset = nOffset;
@@ -1462,22 +1462,22 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
generateColumnNames(pParse, 0, p->pEList);
generateColumnTypes(pParse, p->pSrc, p->pEList);
}
- iBreak = sqliteVdbeMakeLabel(v);
- iCont = sqliteVdbeMakeLabel(v);
- sqliteVdbeAddOp(v, OP_Rewind, tab1, iBreak);
+ iBreak = sqlite3VdbeMakeLabel(v);
+ iCont = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, tab1, iBreak);
computeLimitRegisters(pParse, p);
- iStart = sqliteVdbeAddOp(v, OP_FullKey, tab1, 0);
- sqliteVdbeAddOp(v, OP_NotFound, tab2, iCont);
+ iStart = sqlite3VdbeAddOp(v, OP_FullKey, tab1, 0);
+ sqlite3VdbeAddOp(v, OP_NotFound, tab2, iCont);
multiSelectSortOrder(p, p->pOrderBy);
rc = selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr,
p->pOrderBy, -1, eDest, iParm,
iCont, iBreak);
if( rc ) return 1;
- sqliteVdbeResolveLabel(v, iCont);
- sqliteVdbeAddOp(v, OP_Next, tab1, iStart);
- sqliteVdbeResolveLabel(v, iBreak);
- sqliteVdbeAddOp(v, OP_Close, tab2, 0);
- sqliteVdbeAddOp(v, OP_Close, tab1, 0);
+ sqlite3VdbeResolveLabel(v, iCont);
+ sqlite3VdbeAddOp(v, OP_Next, tab1, iStart);
+ sqlite3VdbeResolveLabel(v, iBreak);
+ sqlite3VdbeAddOp(v, OP_Close, tab2, 0);
+ sqlite3VdbeAddOp(v, OP_Close, tab1, 0);
if( p->pOrderBy ){
generateSortTail(p, v, p->pEList->nExpr, eDest, iParm);
}
@@ -1486,7 +1486,7 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){
}
assert( p->pEList && pPrior->pEList );
if( p->pEList->nExpr!=pPrior->pEList->nExpr ){
- sqliteErrorMsg(pParse, "SELECTs to the left and right of %s"
+ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
" do not have the same number of result columns", selectOpName(p->op));
return 1;
}
@@ -1521,16 +1521,16 @@ static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){
pExpr->op = pNew->op;
pExpr->dataType = pNew->dataType;
assert( pExpr->pLeft==0 );
- pExpr->pLeft = sqliteExprDup(pNew->pLeft);
+ pExpr->pLeft = sqlite3ExprDup(pNew->pLeft);
assert( pExpr->pRight==0 );
- pExpr->pRight = sqliteExprDup(pNew->pRight);
+ pExpr->pRight = sqlite3ExprDup(pNew->pRight);
assert( pExpr->pList==0 );
- pExpr->pList = sqliteExprListDup(pNew->pList);
+ pExpr->pList = sqlite3ExprListDup(pNew->pList);
pExpr->iTable = pNew->iTable;
pExpr->iColumn = pNew->iColumn;
pExpr->iAgg = pNew->iAgg;
- sqliteTokenCopy(&pExpr->token, &pNew->token);
- sqliteTokenCopy(&pExpr->span, &pNew->span);
+ sqlite3TokenCopy(&pExpr->token, &pNew->token);
+ sqlite3TokenCopy(&pExpr->span, &pNew->span);
}
}else{
substExpr(pExpr->pLeft, iTable, pEList);
@@ -1701,7 +1701,7 @@ static int flattenSubquery(
int jointype = pSrc->a[iFrom].jointype;
if( pSrc->a[iFrom].pTab && pSrc->a[iFrom].pTab->isTransient ){
- sqliteDeleteTable(0, pSrc->a[iFrom].pTab);
+ sqlite3DeleteTable(0, pSrc->a[iFrom].pTab);
}
sqliteFree(pSrc->a[iFrom].zDatabase);
sqliteFree(pSrc->a[iFrom].zName);
@@ -1709,7 +1709,7 @@ static int flattenSubquery(
if( nSubSrc>1 ){
int extra = nSubSrc - 1;
for(i=1; i<nSubSrc; i++){
- pSrc = sqliteSrcListAppend(pSrc, 0, 0);
+ pSrc = sqlite3SrcListAppend(pSrc, 0, 0);
}
p->pSrc = pSrc;
for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){
@@ -1755,7 +1755,7 @@ static int flattenSubquery(
substExprList(p->pOrderBy, iParent, pSub->pEList);
}
if( pSub->pWhere ){
- pWhere = sqliteExprDup(pSub->pWhere);
+ pWhere = sqlite3ExprDup(pSub->pWhere);
}else{
pWhere = 0;
}
@@ -1765,21 +1765,21 @@ static int flattenSubquery(
p->pWhere = pWhere;
substExpr(p->pHaving, iParent, pSub->pEList);
if( pSub->pHaving ){
- Expr *pHaving = sqliteExprDup(pSub->pHaving);
+ Expr *pHaving = sqlite3ExprDup(pSub->pHaving);
if( p->pHaving ){
- p->pHaving = sqliteExpr(TK_AND, p->pHaving, pHaving, 0);
+ p->pHaving = sqlite3Expr(TK_AND, p->pHaving, pHaving, 0);
}else{
p->pHaving = pHaving;
}
}
assert( p->pGroupBy==0 );
- p->pGroupBy = sqliteExprListDup(pSub->pGroupBy);
+ p->pGroupBy = sqlite3ExprListDup(pSub->pGroupBy);
}else if( p->pWhere==0 ){
p->pWhere = pWhere;
}else{
substExpr(p->pWhere, iParent, pSub->pEList);
if( pWhere ){
- p->pWhere = sqliteExpr(TK_AND, p->pWhere, pWhere, 0);
+ p->pWhere = sqlite3Expr(TK_AND, p->pWhere, pWhere, 0);
}
}
@@ -1803,7 +1803,7 @@ static int flattenSubquery(
/* Finially, delete what is left of the subquery and return
** success.
*/
- sqliteSelectDelete(pSub);
+ sqlite3SelectDelete(pSub);
return 1;
}
@@ -1824,7 +1824,7 @@ static int flattenSubquery(
** be the min() or max() of a single column of the table. The column
** in the min() or max() function must be indexed.
**
-** The parameters to this routine are the same as for sqliteSelect().
+** The parameters to this routine are the same as for sqlite3Select().
** See the header comment on that routine for additional information.
*/
static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
@@ -1854,9 +1854,9 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
pList = pExpr->pList;
if( pList==0 || pList->nExpr!=1 ) return 0;
if( pExpr->token.n!=3 ) return 0;
- if( sqliteStrNICmp(pExpr->token.z,"min",3)==0 ){
+ if( sqlite3StrNICmp(pExpr->token.z,"min",3)==0 ){
seekOp = OP_Rewind;
- }else if( sqliteStrNICmp(pExpr->token.z,"max",3)==0 ){
+ }else if( sqlite3StrNICmp(pExpr->token.z,"max",3)==0 ){
seekOp = OP_Last;
}else{
return 0;
@@ -1886,7 +1886,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
** step is skipped if the output is going to a table or a memory cell.
** The column names have already been generated in the calling function.
*/
- v = sqliteGetVdbe(pParse);
+ v = sqlite3GetVdbe(pParse);
if( v==0 ) return 0;
if( eDest==SRT_Callback ){
generateColumnTypes(pParse, p->pSrc, p->pEList);
@@ -1895,7 +1895,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
/* If the output is destined for a temporary table, open that table.
*/
if( eDest==SRT_TempTable ){
- sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
}
/* Generating code to find the min or the max. Basically all we have
@@ -1903,31 +1903,31 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
** the min() or max() is on the INTEGER PRIMARY KEY, then find the first
** or last entry in the main table.
*/
- sqliteCodeVerifySchema(pParse, pTab->iDb);
+ sqlite3CodeVerifySchema(pParse, pTab->iDb);
base = pSrc->a[0].iCursor;
computeLimitRegisters(pParse, p);
if( pSrc->a[0].pSelect==0 ){
- sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
- sqliteVdbeOp3(v, OP_OpenRead, base, pTab->tnum, pTab->zName, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenRead, base, pTab->tnum, pTab->zName, 0);
}
- cont = sqliteVdbeMakeLabel(v);
+ cont = sqlite3VdbeMakeLabel(v);
if( pIdx==0 ){
- sqliteVdbeAddOp(v, seekOp, base, 0);
+ sqlite3VdbeAddOp(v, seekOp, base, 0);
}else{
- sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
- sqliteVdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum, pIdx->zName, P3_STATIC);
- sqliteVdbeAddOp(v, seekOp, base+1, 0);
- sqliteVdbeAddOp(v, OP_IdxRecno, base+1, 0);
- sqliteVdbeAddOp(v, OP_Close, base+1, 0);
- sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum, pIdx->zName, P3_STATIC);
+ sqlite3VdbeAddOp(v, seekOp, base+1, 0);
+ sqlite3VdbeAddOp(v, OP_IdxRecno, base+1, 0);
+ sqlite3VdbeAddOp(v, OP_Close, base+1, 0);
+ sqlite3VdbeAddOp(v, OP_MoveTo, base, 0);
}
eList.nExpr = 1;
memset(&eListItem, 0, sizeof(eListItem));
eList.a = &eListItem;
eList.a[0].pExpr = pExpr;
selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, cont, cont);
- sqliteVdbeResolveLabel(v, cont);
- sqliteVdbeAddOp(v, OP_Close, base, 0);
+ sqlite3VdbeResolveLabel(v, cont);
+ sqlite3VdbeAddOp(v, OP_Close, base, 0);
return 1;
}
@@ -1984,7 +1984,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
** the second element in a three-way join, the parentTab parameter will
** be 1 (the 2nd value of a 0-indexed array.)
*/
-int sqliteSelect(
+int sqlite3Select(
Parse *pParse, /* The parser context */
Select *p, /* The SELECT statement being coded. */
int eDest, /* How to dispose of the results */
@@ -2008,7 +2008,7 @@ int sqliteSelect(
int rc = 1; /* Value to return from this function */
if( sqlite_malloc_failed || pParse->nErr || p==0 ) return 1;
- if( sqliteAuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
+ if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
/* If there is are a sequence of queries, do the earlier ones first.
*/
@@ -2027,7 +2027,7 @@ int sqliteSelect(
/* Allocate VDBE cursors for each table in the FROM clause
*/
- sqliteSrcListAssignCursors(pParse, pTabList);
+ sqlite3SrcListAssignCursors(pParse, pTabList);
/*
** Do not even attempt to generate any code if we have already seen
@@ -2050,7 +2050,7 @@ int sqliteSelect(
** only a single column may be output.
*/
if( (eDest==SRT_Mem || eDest==SRT_Set) && pEList->nExpr>1 ){
- sqliteErrorMsg(pParse, "only a single result allowed for "
+ sqlite3ErrorMsg(pParse, "only a single result allowed for "
"a SELECT that is part of an expression");
goto select_end;
}
@@ -2073,30 +2073,30 @@ int sqliteSelect(
** Resolve the column names and do a semantics check on all the expressions.
*/
for(i=0; i<pEList->nExpr; i++){
- if( sqliteExprResolveIds(pParse, pTabList, 0, pEList->a[i].pExpr) ){
+ if( sqlite3ExprResolveIds(pParse, pTabList, 0, pEList->a[i].pExpr) ){
goto select_end;
}
- if( sqliteExprCheck(pParse, pEList->a[i].pExpr, 1, &isAgg) ){
+ if( sqlite3ExprCheck(pParse, pEList->a[i].pExpr, 1, &isAgg) ){
goto select_end;
}
}
if( pWhere ){
- if( sqliteExprResolveIds(pParse, pTabList, pEList, pWhere) ){
+ if( sqlite3ExprResolveIds(pParse, pTabList, pEList, pWhere) ){
goto select_end;
}
- if( sqliteExprCheck(pParse, pWhere, 0, 0) ){
+ if( sqlite3ExprCheck(pParse, pWhere, 0, 0) ){
goto select_end;
}
}
if( pHaving ){
if( pGroupBy==0 ){
- sqliteErrorMsg(pParse, "a GROUP BY clause is required before HAVING");
+ sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING");
goto select_end;
}
- if( sqliteExprResolveIds(pParse, pTabList, pEList, pHaving) ){
+ if( sqlite3ExprResolveIds(pParse, pTabList, pEList, pHaving) ){
goto select_end;
}
- if( sqliteExprCheck(pParse, pHaving, 1, &isAgg) ){
+ if( sqlite3ExprCheck(pParse, pHaving, 1, &isAgg) ){
goto select_end;
}
}
@@ -2104,23 +2104,23 @@ int sqliteSelect(
for(i=0; i<pOrderBy->nExpr; i++){
int iCol;
Expr *pE = pOrderBy->a[i].pExpr;
- if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){
- sqliteExprDelete(pE);
- pE = pOrderBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr);
+ if( sqlite3ExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){
+ sqlite3ExprDelete(pE);
+ pE = pOrderBy->a[i].pExpr = sqlite3ExprDup(pEList->a[iCol-1].pExpr);
}
- if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){
+ if( sqlite3ExprResolveIds(pParse, pTabList, pEList, pE) ){
goto select_end;
}
- if( sqliteExprCheck(pParse, pE, isAgg, 0) ){
+ if( sqlite3ExprCheck(pParse, pE, isAgg, 0) ){
goto select_end;
}
- if( sqliteExprIsConstant(pE) ){
- if( sqliteExprIsInteger(pE, &iCol)==0 ){
- sqliteErrorMsg(pParse,
+ if( sqlite3ExprIsConstant(pE) ){
+ if( sqlite3ExprIsInteger(pE, &iCol)==0 ){
+ sqlite3ErrorMsg(pParse,
"ORDER BY terms must not be non-integer constants");
goto select_end;
}else if( iCol<=0 || iCol>pEList->nExpr ){
- sqliteErrorMsg(pParse,
+ sqlite3ErrorMsg(pParse,
"ORDER BY column number %d out of range - should be "
"between 1 and %d", iCol, pEList->nExpr);
goto select_end;
@@ -2132,23 +2132,23 @@ int sqliteSelect(
for(i=0; i<pGroupBy->nExpr; i++){
int iCol;
Expr *pE = pGroupBy->a[i].pExpr;
- if( sqliteExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){
- sqliteExprDelete(pE);
- pE = pGroupBy->a[i].pExpr = sqliteExprDup(pEList->a[iCol-1].pExpr);
+ if( sqlite3ExprIsInteger(pE, &iCol) && iCol>0 && iCol<=pEList->nExpr ){
+ sqlite3ExprDelete(pE);
+ pE = pGroupBy->a[i].pExpr = sqlite3ExprDup(pEList->a[iCol-1].pExpr);
}
- if( sqliteExprResolveIds(pParse, pTabList, pEList, pE) ){
+ if( sqlite3ExprResolveIds(pParse, pTabList, pEList, pE) ){
goto select_end;
}
- if( sqliteExprCheck(pParse, pE, isAgg, 0) ){
+ if( sqlite3ExprCheck(pParse, pE, isAgg, 0) ){
goto select_end;
}
- if( sqliteExprIsConstant(pE) ){
- if( sqliteExprIsInteger(pE, &iCol)==0 ){
- sqliteErrorMsg(pParse,
+ if( sqlite3ExprIsConstant(pE) ){
+ if( sqlite3ExprIsInteger(pE, &iCol)==0 ){
+ sqlite3ErrorMsg(pParse,
"GROUP BY terms must not be non-integer constants");
goto select_end;
}else if( iCol<=0 || iCol>pEList->nExpr ){
- sqliteErrorMsg(pParse,
+ sqlite3ErrorMsg(pParse,
"GROUP BY column number %d out of range - should be "
"between 1 and %d", iCol, pEList->nExpr);
goto select_end;
@@ -2159,7 +2159,7 @@ int sqliteSelect(
/* Begin generating code.
*/
- v = sqliteGetVdbe(pParse);
+ v = sqlite3GetVdbe(pParse);
if( v==0 ) goto select_end;
/* Identify column names if we will be using them in a callback. This
@@ -2183,7 +2183,7 @@ int sqliteSelect(
}else{
needRestoreContext = 0;
}
- sqliteSelect(pParse, pTabList->a[i].pSelect, SRT_TempTable,
+ sqlite3Select(pParse, pTabList->a[i].pSelect, SRT_TempTable,
pTabList->a[i].iCursor, p, i, &isAgg);
if( needRestoreContext ){
pParse->zAuthContext = zSavedAuthContext;
@@ -2235,7 +2235,7 @@ int sqliteSelect(
/* If the output is destined for a temporary table, open that table.
*/
if( eDest==SRT_TempTable ){
- sqliteVdbeAddOp(v, OP_OpenTemp, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, iParm, 0);
}
/* Do an analysis of aggregate expressions.
@@ -2245,23 +2245,23 @@ int sqliteSelect(
assert( pParse->nAgg==0 );
isAgg = 1;
for(i=0; i<pEList->nExpr; i++){
- if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){
+ if( sqlite3ExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){
goto select_end;
}
}
if( pGroupBy ){
for(i=0; i<pGroupBy->nExpr; i++){
- if( sqliteExprAnalyzeAggregates(pParse, pGroupBy->a[i].pExpr) ){
+ if( sqlite3ExprAnalyzeAggregates(pParse, pGroupBy->a[i].pExpr) ){
goto select_end;
}
}
}
- if( pHaving && sqliteExprAnalyzeAggregates(pParse, pHaving) ){
+ if( pHaving && sqlite3ExprAnalyzeAggregates(pParse, pHaving) ){
goto select_end;
}
if( pOrderBy ){
for(i=0; i<pOrderBy->nExpr; i++){
- if( sqliteExprAnalyzeAggregates(pParse, pOrderBy->a[i].pExpr) ){
+ if( sqlite3ExprAnalyzeAggregates(pParse, pOrderBy->a[i].pExpr) ){
goto select_end;
}
}
@@ -2271,38 +2271,38 @@ int sqliteSelect(
/* Reset the aggregator
*/
if( isAgg ){
- sqliteVdbeAddOp(v, OP_AggReset, 0, pParse->nAgg);
+ sqlite3VdbeAddOp(v, OP_AggReset, 0, pParse->nAgg);
for(i=0; i<pParse->nAgg; i++){
FuncDef *pFunc;
if( (pFunc = pParse->aAgg[i].pFunc)!=0 && pFunc->xFinalize!=0 ){
- sqliteVdbeOp3(v, OP_AggInit, 0, i, (char*)pFunc, P3_POINTER);
+ sqlite3VdbeOp3(v, OP_AggInit, 0, i, (char*)pFunc, P3_POINTER);
}
}
if( pGroupBy==0 ){
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_AggFocus, 0, 0);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_AggFocus, 0, 0);
}
}
/* Initialize the memory cell to NULL
*/
if( eDest==SRT_Mem ){
- sqliteVdbeAddOp(v, OP_String, 0, 0);
- sqliteVdbeAddOp(v, OP_MemStore, iParm, 1);
+ sqlite3VdbeAddOp(v, OP_String, 0, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
}
/* Open a temporary table to use for the distinct set.
*/
if( isDistinct ){
distinct = pParse->nTab++;
- sqliteVdbeAddOp(v, OP_OpenTemp, distinct, 1);
+ sqlite3VdbeAddOp(v, OP_OpenTemp, distinct, 1);
}else{
distinct = -1;
}
/* Begin the database scan
*/
- pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 0,
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0,
pGroupBy ? 0 : &pOrderBy);
if( pWInfo==0 ) goto select_end;
@@ -2324,18 +2324,18 @@ int sqliteSelect(
if( pGroupBy ){
int lbl1;
for(i=0; i<pGroupBy->nExpr; i++){
- sqliteExprCode(pParse, pGroupBy->a[i].pExpr);
+ sqlite3ExprCode(pParse, pGroupBy->a[i].pExpr);
}
- sqliteVdbeAddOp(v, OP_MakeKey, pGroupBy->nExpr, 0);
- if( pParse->db->file_format>=4 ) sqliteAddKeyType(v, pGroupBy);
- lbl1 = sqliteVdbeMakeLabel(v);
- sqliteVdbeAddOp(v, OP_AggFocus, 0, lbl1);
+ sqlite3VdbeAddOp(v, OP_MakeKey, pGroupBy->nExpr, 0);
+ if( pParse->db->file_format>=4 ) sqlite3AddKeyType(v, pGroupBy);
+ lbl1 = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_AggFocus, 0, lbl1);
for(i=0, pAgg=pParse->aAgg; i<pParse->nAgg; i++, pAgg++){
if( pAgg->isAgg ) continue;
- sqliteExprCode(pParse, pAgg->pExpr);
- sqliteVdbeAddOp(v, OP_AggSet, 0, i);
+ sqlite3ExprCode(pParse, pAgg->pExpr);
+ sqlite3VdbeAddOp(v, OP_AggSet, 0, i);
}
- sqliteVdbeResolveLabel(v, lbl1);
+ sqlite3VdbeResolveLabel(v, lbl1);
}
for(i=0, pAgg=pParse->aAgg; i<pParse->nAgg; i++, pAgg++){
Expr *pE;
@@ -2348,34 +2348,34 @@ int sqliteSelect(
pE = pAgg->pExpr;
assert( pE!=0 );
assert( pE->op==TK_AGG_FUNCTION );
- nExpr = sqliteExprCodeExprList(pParse, pE->pList, pDef->includeTypes);
- sqliteVdbeAddOp(v, OP_Integer, i, 0);
- sqliteVdbeOp3(v, OP_AggFunc, 0, nExpr, (char*)pDef, P3_POINTER);
+ nExpr = sqlite3ExprCodeExprList(pParse, pE->pList, pDef->includeTypes);
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeOp3(v, OP_AggFunc, 0, nExpr, (char*)pDef, P3_POINTER);
}
}
/* End the database scan loop.
*/
- sqliteWhereEnd(pWInfo);
+ sqlite3WhereEnd(pWInfo);
/* If we are processing aggregates, we need to set up a second loop
** over all of the aggregate values and process them.
*/
if( isAgg ){
- int endagg = sqliteVdbeMakeLabel(v);
+ int endagg = sqlite3VdbeMakeLabel(v);
int startagg;
- startagg = sqliteVdbeAddOp(v, OP_AggNext, 0, endagg);
+ startagg = sqlite3VdbeAddOp(v, OP_AggNext, 0, endagg);
pParse->useAgg = 1;
if( pHaving ){
- sqliteExprIfFalse(pParse, pHaving, startagg, 1);
+ sqlite3ExprIfFalse(pParse, pHaving, startagg, 1);
}
if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest,
iParm, startagg, endagg) ){
goto select_end;
}
- sqliteVdbeAddOp(v, OP_Goto, 0, startagg);
- sqliteVdbeResolveLabel(v, endagg);
- sqliteVdbeAddOp(v, OP_Noop, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, startagg);
+ sqlite3VdbeResolveLabel(v, endagg);
+ sqlite3VdbeAddOp(v, OP_Noop, 0, 0);
pParse->useAgg = 0;
}
@@ -2394,7 +2394,7 @@ int sqliteSelect(
if( pParent ){
assert( pParent->pSrc->nSrc>parentTab );
assert( pParent->pSrc->a[parentTab].pSelect==p );
- sqliteSelectDelete(p);
+ sqlite3SelectDelete(p);
pParent->pSrc->a[parentTab].pSelect = 0;
}
@@ -2410,3 +2410,6 @@ select_end:
sqliteAggregateInfoReset(pParse);
return rc;
}
+
+
+