diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-01-14 17:59:08 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-01-14 17:59:08 +0000 |
commit | b10c1ea43365df8fd31fab9083749dc86d1bd837 (patch) | |
tree | 00cdd4bed614e617182a6e896565747d0c5a0c2c | |
parent | 879184bd6da1af05921af7abcda5b0cd59044c75 (diff) | |
download | php-git-b10c1ea43365df8fd31fab9083749dc86d1bd837.tar.gz |
Upgrade bundled libsqlite to 2.8.11
36 files changed, 3403 insertions, 6411 deletions
diff --git a/ext/sqlite/config.m4 b/ext/sqlite/config.m4 index b099356a16..2e8fdd9586 100644 --- a/ext/sqlite/config.m4 +++ b/ext/sqlite/config.m4 @@ -60,6 +60,7 @@ if test "$PHP_SQLITE" != "no"; then libsqlite/src/update.c libsqlite/src/util.c libsqlite/src/vdbe.c \ libsqlite/src/attach.c libsqlite/src/btree_rb.c libsqlite/src/pragma.c \ libsqlite/src/vacuum.c libsqlite/src/copy.c \ + libsqlite/src/vdbeaux.c libsqlite/src/date.c \ libsqlite/src/where.c libsqlite/src/trigger.c" PHP_NEW_EXTENSION(sqlite, sqlite.c $sources, $ext_shared,,$PHP_SQLITE_CFLAGS) diff --git a/ext/sqlite/libsqlite/VERSION b/ext/sqlite/libsqlite/VERSION index 9f8d8a9164..38bc52136e 100644 --- a/ext/sqlite/libsqlite/VERSION +++ b/ext/sqlite/libsqlite/VERSION @@ -1 +1 @@ -2.8.3 +2.8.11 diff --git a/ext/sqlite/libsqlite/src/attach.c b/ext/sqlite/libsqlite/src/attach.c index 5b57e29e16..5269238e0f 100644 --- a/ext/sqlite/libsqlite/src/attach.c +++ b/ext/sqlite/libsqlite/src/attach.c @@ -64,7 +64,6 @@ void sqliteAttach(Parse *pParse, Token *pFilename, Token *pDbname){ sqliteErrorMsg(pParse, "database %z is already in use", zName); pParse->rc = SQLITE_ERROR; sqliteFree(zFile); - sqliteFree(zName); return; } } @@ -92,8 +91,16 @@ void sqliteAttach(Parse *pParse, Token *pFilename, Token *pDbname){ sqliteFree(zFile); db->flags &= ~SQLITE_Initialized; if( pParse->nErr ) return; - rc = sqliteInit(pParse->db, &pParse->zErrMsg); + if( rc==SQLITE_OK ){ + rc = sqliteInit(pParse->db, &pParse->zErrMsg); + } if( rc ){ + int i = db->nDb - 1; + assert( i>=2 ); + if( db->aDb[i].pBt ){ + sqliteBtreeClose(db->aDb[i].pBt); + db->aDb[i].pBt = 0; + } sqliteResetInternalSchema(db, 0); pParse->nErr++; pParse->rc = SQLITE_ERROR; diff --git a/ext/sqlite/libsqlite/src/auth.c b/ext/sqlite/libsqlite/src/auth.c index 547cd18f14..06b8126ae0 100644 --- a/ext/sqlite/libsqlite/src/auth.c +++ b/ext/sqlite/libsqlite/src/auth.c @@ -89,7 +89,7 @@ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ sprintf(zBuf, "(%d)", rc); sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf, " from the authorization function - should be SQLITE_OK, " - "SQLITE_IGNORE, or SQLITE_DENY", 0); + "SQLITE_IGNORE, or SQLITE_DENY", (char*)0); pParse->nErr++; pParse->rc = SQLITE_MISUSE; } @@ -151,10 +151,10 @@ void sqliteAuthRead( }else if( rc==SQLITE_DENY ){ if( db->nDb>2 || pExpr->iDb!=0 ){ sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".", - pTab->zName, ".", zCol, " is prohibited", 0); + pTab->zName, ".", zCol, " is prohibited", (char*)0); }else{ sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".", - zCol, " is prohibited", 0); + zCol, " is prohibited", (char*)0); } pParse->nErr++; pParse->rc = SQLITE_AUTH; @@ -184,7 +184,7 @@ int sqliteAuthCheck( } rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext); if( rc==SQLITE_DENY ){ - sqliteSetString(&pParse->zErrMsg, "not authorized", 0); + sqliteSetString(&pParse->zErrMsg, "not authorized", (char*)0); pParse->rc = SQLITE_AUTH; pParse->nErr++; }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ diff --git a/ext/sqlite/libsqlite/src/btree.c b/ext/sqlite/libsqlite/src/btree.c index 9f433f4036..1133b1a353 100644 --- a/ext/sqlite/libsqlite/src/btree.c +++ b/ext/sqlite/libsqlite/src/btree.c @@ -471,8 +471,10 @@ static int allocateSpace(Btree *pBt, MemPage *pPage, int nByte){ FreeBlk *p; u16 *pIdx; int start; - int cnt = 0; int iSize; +#ifndef NDEBUG + int cnt = 0; +#endif assert( sqlitepager_iswriteable(pPage) ); assert( nByte==ROUNDUP(nByte) ); @@ -1400,7 +1402,9 @@ static int moveToChild(BtCursor *pCur, int newPgno){ sqlitepager_unref(pCur->pPage); pCur->pPage = pNewPage; pCur->idx = 0; - if( pNewPage->nCell<1 ) return SQLITE_CORRUPT; + if( pNewPage->nCell<1 ){ + return SQLITE_CORRUPT; + } return SQLITE_OK; } @@ -3155,8 +3159,6 @@ struct IntegrityCk { Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ int nPage; /* Number of pages in the database */ int *anRef; /* Number of times each page is referenced */ - int nTreePage; /* Number of BTree pages */ - int nByte; /* Number of bytes of data stored on BTree pages */ char *zErrMsg; /* An error message. NULL of no errors seen. */ }; @@ -3167,10 +3169,10 @@ static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){ if( pCheck->zErrMsg ){ char *zOld = pCheck->zErrMsg; pCheck->zErrMsg = 0; - sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, 0); + sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0); sqliteFree(zOld); }else{ - sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, 0); + sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0); } } @@ -3401,11 +3403,6 @@ static int checkTreePage( } #endif - /* Update freespace totals. - */ - pCheck->nTreePage++; - pCheck->nByte += USABLE_SPACE - pPage->nFree; - sqlitepager_unref(pPage); return depth; } diff --git a/ext/sqlite/libsqlite/src/btree_rb.c b/ext/sqlite/libsqlite/src/btree_rb.c index 39a842032a..49009be830 100644 --- a/ext/sqlite/libsqlite/src/btree_rb.c +++ b/ext/sqlite/libsqlite/src/btree_rb.c @@ -13,7 +13,7 @@ ** ** This file implements an in-core database using Red-Black balanced ** binary trees. -** +** ** It was contributed to SQLite by anonymous on 2003-Feb-04 23:24:49 UTC. */ #include "btree.h" @@ -99,7 +99,9 @@ struct RbtCursor { BtRbTree *pTree; int iTree; /* Index of pTree in pRbtree */ BtRbNode *pNode; + RbtCursor *pShared; /* List of all cursors on the same Rbtree */ u8 eSkip; /* Determines if next step operation is a no-op */ + u8 wrFlag; /* True if this cursor is open for writing */ }; /* @@ -111,7 +113,8 @@ struct RbtCursor { #define SKIP_INVALID 3 /* Calls to Next() and Previous() are invalid */ struct BtRbTree { - BtRbNode *pHead; /* Head of the tree, or NULL */ + RbtCursor *pCursors; /* All cursors pointing to this tree */ + BtRbNode *pHead; /* Head of the tree, or NULL */ }; struct BtRbNode { @@ -139,6 +142,33 @@ static int memRbtreeNext(RbtCursor* pCur, int *pRes); static int memRbtreeLast(RbtCursor* pCur, int *pRes); static int memRbtreePrevious(RbtCursor* pCur, int *pRes); + +/* +** This routine checks all cursors that point to the same table +** as pCur points to. If any of those cursors were opened with +** wrFlag==0 then this routine returns SQLITE_LOCKED. If all +** cursors point to the same table were opened with wrFlag==1 +** then this routine returns SQLITE_OK. +** +** In addition to checking for read-locks (where a read-lock +** means a cursor opened with wrFlag==0) this routine also NULLs +** out the pNode field of all other cursors. +** This is necessary because an insert +** or delete might change erase the node out from under +** another cursor. +*/ +static int checkReadLocks(RbtCursor *pCur){ + RbtCursor *p; + assert( pCur->wrFlag ); + for(p=pCur->pTree->pCursors; p; p=p->pShared){ + if( p!=pCur ){ + if( p->wrFlag==0 ) return SQLITE_LOCKED; + p->pNode = 0; + } + } + return SQLITE_OK; +} + /* * The key-compare function for the red-black trees. Returns as follows: * @@ -235,7 +265,7 @@ static char *append_val(char * orig, char const * val) return sqliteStrDup( val ); } else{ char * ret = 0; - sqliteSetString(&ret, orig, val, 0); + sqliteSetString(&ret, orig, val, (char*)0); sqliteFree( orig ); return ret; } @@ -276,12 +306,16 @@ static char *append_node(char * orig, BtRbNode *pNode, int indent) /* * Print a representation of a node to stdout. This function is only included - * so you can call it from within a debugger if things get really bad. + * so you can call it from within a debugger if things get really bad. It + * is not called from anyplace in the code. */ static void print_node(BtRbNode *pNode) { char * str = append_node(0, pNode, 0); - printf(str); + printf("%s", str); + + /* Suppress a warning message about print_node() being unused */ + (void)print_node; } /* @@ -584,10 +618,12 @@ int sqliteRbtreeOpen( ){ Rbtree **ppRbtree = (Rbtree**)ppBtree; *ppRbtree = (Rbtree *)sqliteMalloc(sizeof(Rbtree)); + if( sqlite_malloc_failed ) goto open_no_mem; sqliteHashInit(&(*ppRbtree)->tblHash, SQLITE_HASH_INT, 0); /* Create a binary tree for the SQLITE_MASTER table at location 2 */ btreeCreateTable(*ppRbtree, 2); + if( sqlite_malloc_failed ) goto open_no_mem; (*ppRbtree)->next_idx = 3; (*ppRbtree)->pOps = &sqliteRbtreeOps; /* Set file type to 4; this is so that "attach ':memory:' as ...." does not @@ -596,6 +632,10 @@ int sqliteRbtreeOpen( (*ppRbtree)->aMetaData[2] = 4; return SQLITE_OK; + +open_no_mem: + *ppBtree = 0; + return SQLITE_NOMEM; } /* @@ -608,11 +648,13 @@ static int memRbtreeCreateTable(Rbtree* tree, int* n) *n = tree->next_idx++; btreeCreateTable(tree, *n); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; /* Set up the rollback structure (if we are not doing this as part of a * rollback) */ if( tree->eTransState != TRANS_ROLLBACK ){ BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); + if( pRollbackOp==0 ) return SQLITE_NOMEM; pRollbackOp->eOp = ROLLBACK_DROP; pRollbackOp->iTab = *n; btreeLogRollbackOp(tree, pRollbackOp); @@ -632,10 +674,12 @@ static int memRbtreeDropTable(Rbtree* tree, int n) memRbtreeClearTable(tree, n); pTree = sqliteHashInsert(&tree->tblHash, 0, n, 0); assert(pTree); + assert( pTree->pCursors==0 ); sqliteFree(pTree); if( tree->eTransState != TRANS_ROLLBACK ){ BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); + if( pRollbackOp==0 ) return SQLITE_NOMEM; pRollbackOp->eOp = ROLLBACK_CREATE; pRollbackOp->iTab = n; btreeLogRollbackOp(tree, pRollbackOp); @@ -664,7 +708,7 @@ static int memRbtreeKeyCompare(RbtCursor* pCur, const void *pKey, int nKey, /* * Get a new cursor for table iTable of the supplied Rbtree. The wrFlag - * parameter is ignored, all cursors are capable of write-operations. + * parameter indicates that the cursor is open for writing. * * Note that RbtCursor.eSkip and RbtCursor.pNode both initialize to 0. */ @@ -674,12 +718,18 @@ static int memRbtreeCursor( int wrFlag, RbtCursor **ppCur ){ + RbtCursor *pCur; assert(tree); - *ppCur = sqliteMalloc(sizeof(RbtCursor)); - (*ppCur)->pTree = sqliteHashFind(&tree->tblHash, 0, iTable); - (*ppCur)->pRbtree = tree; - (*ppCur)->iTree = iTable; - (*ppCur)->pOps = &sqliteRbtreeCursorOps; + pCur = *ppCur = sqliteMalloc(sizeof(RbtCursor)); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; + pCur->pTree = sqliteHashFind(&tree->tblHash, 0, iTable); + pCur->pRbtree = tree; + pCur->iTree = iTable; + pCur->pOps = &sqliteRbtreeCursorOps; + pCur->wrFlag = wrFlag; + pCur->pShared = pCur->pTree->pCursors; + pCur->pTree->pCursors = pCur; + assert( (*ppCur)->pTree ); return SQLITE_OK; @@ -707,9 +757,15 @@ static int memRbtreeInsert( ** not in a transaction */ assert( pCur->pRbtree->eTransState != TRANS_NONE ); + /* Make sure some other cursor isn't trying to read this same table */ + if( checkReadLocks(pCur) ){ + return SQLITE_LOCKED; /* The table pCur points to has a read lock */ + } + /* Take a copy of the input data now, in case we need it for the * replace case */ - pData = sqliteMalloc(nData); + pData = sqliteMallocRaw(nData); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; memcpy(pData, pDataInput, nData); /* Move the cursor to a node near the key to be inserted. If the key already @@ -726,8 +782,10 @@ static int memRbtreeInsert( memRbtreeMoveto( pCur, pKey, nKey, &match); if( match ){ BtRbNode *pNode = sqliteMalloc(sizeof(BtRbNode)); + if( pNode==0 ) return SQLITE_NOMEM; pNode->nKey = nKey; - pNode->pKey = sqliteMalloc(nKey); + pNode->pKey = sqliteMallocRaw(nKey); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; memcpy(pNode->pKey, pKey, nKey); pNode->nData = nData; pNode->pData = pData; @@ -759,10 +817,12 @@ static int memRbtreeInsert( /* Set up a rollback-op in case we have to roll this operation back */ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); + if( pOp==0 ) return SQLITE_NOMEM; pOp->eOp = ROLLBACK_DELETE; pOp->iTab = pCur->iTree; pOp->nKey = pNode->nKey; - pOp->pKey = sqliteMalloc( pOp->nKey ); + pOp->pKey = sqliteMallocRaw( pOp->nKey ); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; memcpy( pOp->pKey, pNode->pKey, pOp->nKey ); btreeLogRollbackOp(pCur->pRbtree, pOp); } @@ -774,9 +834,11 @@ static int memRbtreeInsert( /* Set up a rollback-op in case we have to roll this operation back */ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); + if( pOp==0 ) return SQLITE_NOMEM; pOp->iTab = pCur->iTree; pOp->nKey = pCur->pNode->nKey; - pOp->pKey = sqliteMalloc( pOp->nKey ); + pOp->pKey = sqliteMallocRaw( pOp->nKey ); + if( sqlite_malloc_failed ) return SQLITE_NOMEM; memcpy( pOp->pKey, pCur->pNode->pKey, pOp->nKey ); pOp->nData = pCur->pNode->nData; pOp->pData = pCur->pNode->pData; @@ -865,6 +927,11 @@ static int memRbtreeDelete(RbtCursor* pCur) ** not in a transaction */ assert( pCur->pRbtree->eTransState != TRANS_NONE ); + /* Make sure some other cursor isn't trying to read this same table */ + if( checkReadLocks(pCur) ){ + return SQLITE_LOCKED; /* The table pCur points to has a read lock */ + } + pZ = pCur->pNode; if( !pZ ){ return SQLITE_OK; @@ -874,6 +941,7 @@ static int memRbtreeDelete(RbtCursor* pCur) * deletion */ if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ BtRollbackOp *pOp = sqliteMalloc( sizeof(BtRollbackOp) ); + if( pOp==0 ) return SQLITE_NOMEM; pOp->iTab = pCur->iTree; pOp->nKey = pZ->nKey; pOp->pKey = pZ->pKey; @@ -978,7 +1046,8 @@ static int memRbtreeClearTable(Rbtree* tree, int n) sqliteFree( pNode->pKey ); sqliteFree( pNode->pData ); }else{ - BtRollbackOp *pRollbackOp = sqliteMalloc(sizeof(BtRollbackOp)); + BtRollbackOp *pRollbackOp = sqliteMallocRaw(sizeof(BtRollbackOp)); + if( pRollbackOp==0 ) return SQLITE_NOMEM; pRollbackOp->eOp = ROLLBACK_INSERT; pRollbackOp->iTab = n; pRollbackOp->nKey = pNode->nKey; @@ -1142,6 +1211,16 @@ static int memRbtreeData(RbtCursor *pCur, int offset, int amt, char *zBuf) static int memRbtreeCloseCursor(RbtCursor* pCur) { + if( pCur->pTree->pCursors==pCur ){ + pCur->pTree->pCursors = pCur->pShared; + }else{ + RbtCursor *p = pCur->pTree->pCursors; + while( p && p->pShared!=pCur ){ p = p->pShared; } + assert( p!=0 ); + if( p ){ + p->pShared = pCur->pShared; + } + } sqliteFree(pCur); return SQLITE_OK; } @@ -1176,21 +1255,6 @@ static char *memRbtreeIntegrityCheck(Rbtree* tree, int* aRoot, int nRoot) return msg; } -/* - * Close the supplied Rbtree. Delete everything associated with it. - */ -static int memRbtreeClose(Rbtree* tree) -{ - HashElem *p; - while( (p=sqliteHashFirst(&tree->tblHash))!=0 ){ - tree->eTransState = TRANS_ROLLBACK; - memRbtreeDropTable(tree, sqliteHashKeysize(p)); - } - sqliteHashClear(&tree->tblHash); - sqliteFree(tree); - return SQLITE_OK; -} - static int memRbtreeSetCacheSize(Rbtree* tree, int sz) { return SQLITE_OK; @@ -1235,6 +1299,22 @@ static int memRbtreeCommit(Rbtree* tree){ } /* + * Close the supplied Rbtree. Delete everything associated with it. + */ +static int memRbtreeClose(Rbtree* tree) +{ + HashElem *p; + memRbtreeCommit(tree); + while( (p=sqliteHashFirst(&tree->tblHash))!=0 ){ + tree->eTransState = TRANS_ROLLBACK; + memRbtreeDropTable(tree, sqliteHashKeysize(p)); + } + sqliteHashClear(&tree->tblHash); + sqliteFree(tree); + return SQLITE_OK; +} + +/* * Execute and delete the supplied rollback-list on pRbtree. */ static void execute_rollback_list(Rbtree *pRbtree, BtRollbackOp *pList) @@ -1244,6 +1324,7 @@ static void execute_rollback_list(Rbtree *pRbtree, BtRollbackOp *pList) int res; cur.pRbtree = pRbtree; + cur.wrFlag = 1; while( pList ){ switch( pList->eOp ){ case ROLLBACK_INSERT: @@ -1326,7 +1407,6 @@ static int memRbtreeRollbackCkpt(Rbtree* tree) tree->pCheckRollbackTail = 0; tree->eTransState = TRANS_INTRANSACTION; return SQLITE_OK; - return SQLITE_OK; } #ifdef SQLITE_TEST diff --git a/ext/sqlite/libsqlite/src/build.c b/ext/sqlite/libsqlite/src/build.c index 8eea830a0d..9d41db21ff 100644 --- a/ext/sqlite/libsqlite/src/build.c +++ b/ext/sqlite/libsqlite/src/build.c @@ -51,6 +51,7 @@ void sqliteBeginParse(Parse *pParse, int explainFlag){ DbClearProperty(db, i, DB_Cookie); } } + pParse->nVar = 0; } /* @@ -86,7 +87,8 @@ void sqliteExec(Parse *pParse){ if( v && pParse->nErr==0 ){ FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; sqliteVdbeTrace(v, trace); - sqliteVdbeMakeReady(v, xCallback, pParse->pArg, pParse->explain); + sqliteVdbeMakeReady(v, pParse->nVar, xCallback, pParse->pArg, + pParse->explain); if( pParse->useCallback ){ if( pParse->explain ){ rc = sqliteVdbeList(v); @@ -110,6 +112,7 @@ void sqliteExec(Parse *pParse){ pParse->nMem = 0; pParse->nSet = 0; pParse->nAgg = 0; + pParse->nVar = 0; } /* @@ -491,7 +494,7 @@ void sqliteStartTable( int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt); if( rc!=SQLITE_OK ){ sqliteSetString(&pParse->zErrMsg, "unable to open a temporary database " - "file for storing temporary tables", 0); + "file for storing temporary tables", (char*)0); pParse->nErr++; return; } @@ -525,7 +528,7 @@ void sqliteStartTable( if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 && (pIdx->iDb==0 || !pParse->initFlag) ){ sqliteSetString(&pParse->zErrMsg, "there is already an index named ", - zName, 0); + zName, (char*)0); sqliteFree(zName); pParse->nErr++; return; @@ -585,7 +588,7 @@ void sqliteAddColumn(Parse *pParse, Token *pName){ sqliteDequote(z); for(i=0; i<p->nCol; i++){ if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){ - sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, 0); + sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, (char*)0); pParse->nErr++; sqliteFree(z); return; @@ -702,21 +705,26 @@ void sqliteAddDefaultValue(Parse *pParse, Token *pVal, int minusFlag){ void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){ Table *pTab = pParse->pNewTable; char *zType = 0; - int iCol = -1; + int iCol = -1, i; if( pTab==0 ) goto primary_key_exit; if( pTab->hasPrimKey ){ sqliteSetString(&pParse->zErrMsg, "table \"", pTab->zName, - "\" has more than one primary key", 0); + "\" has more than one primary key", (char*)0); pParse->nErr++; goto primary_key_exit; } pTab->hasPrimKey = 1; if( pList==0 ){ iCol = pTab->nCol - 1; - }else if( pList->nId==1 ){ - for(iCol=0; iCol<pTab->nCol; iCol++){ - if( sqliteStrICmp(pList->a[0].zName, pTab->aCol[iCol].zName)==0 ) break; + pTab->aCol[iCol].isPrimKey = 1; + }else{ + for(i=0; i<pList->nId; i++){ + for(iCol=0; iCol<pTab->nCol; iCol++){ + if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ) break; + } + if( iCol<pTab->nCol ) pTab->aCol[iCol].isPrimKey = 1; } + if( pList->nId>1 ) iCol = -1; } if( iCol>=0 && iCol<pTab->nCol ){ zType = pTab->aCol[iCol].zType; @@ -726,7 +734,7 @@ void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){ pTab->iPKey = iCol; pTab->keyConf = onError; }else{ - sqliteCreateIndex(pParse, 0, 0, pList, onError, 0, 0, 0); + sqliteCreateIndex(pParse, 0, 0, pList, onError, 0, 0); pList = 0; } @@ -1076,7 +1084,7 @@ void sqliteCreateView( sEnd.z += sEnd.n; } sEnd.n = 0; - n = ((int)sEnd.z) - (int)pBegin->z; + n = (char *) sEnd.z - (char *) pBegin->z; z = pBegin->z; while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } sEnd.z = &z[n-1]; @@ -1117,7 +1125,7 @@ int sqliteViewGetColumnNames(Parse *pParse, Table *pTable){ */ if( pTable->nCol<0 ){ sqliteSetString(&pParse->zErrMsg, "view ", pTable->zName, - " is circularly defined", 0); + " is circularly defined", (char*)0); pParse->nErr++; return 1; } @@ -1261,19 +1269,19 @@ void sqliteDropTable(Parse *pParse, Token *pName, int isView){ #endif if( pTable->readOnly ){ sqliteSetString(&pParse->zErrMsg, "table ", pTable->zName, - " may not be dropped", 0); + " may not be dropped", (char*)0); pParse->nErr++; return; } if( isView && pTable->pSelect==0 ){ sqliteSetString(&pParse->zErrMsg, "use DROP TABLE to delete table ", - pTable->zName, 0); + pTable->zName, (char*)0); pParse->nErr++; return; } if( !isView && pTable->pSelect ){ sqliteSetString(&pParse->zErrMsg, "use DROP VIEW to delete view ", - pTable->zName, 0); + pTable->zName, (char*)0); pParse->nErr++; return; } @@ -1428,7 +1436,7 @@ void sqliteCreateForeignKey( }else if( pToCol && pToCol->nId!=pFromCol->nId ){ sqliteSetString(&pParse->zErrMsg, "number of columns in foreign key does not match the number of " - "columns in the referenced table", 0); + "columns in the referenced table", (char*)0); pParse->nErr++; goto fk_end; }else{ @@ -1466,7 +1474,7 @@ void sqliteCreateForeignKey( } if( j>=p->nCol ){ sqliteSetString(&pParse->zErrMsg, "unknown column \"", - pFromCol->a[i].zName, "\" in foreign key definition", 0); + pFromCol->a[i].zName, "\" in foreign key definition", (char*)0); pParse->nErr++; goto fk_end; } @@ -1529,7 +1537,6 @@ void sqliteCreateIndex( SrcList *pTable, /* Name of the table to index. Use pParse->pNewTable if 0 */ IdList *pList, /* A list of columns to be indexed */ int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - int isTemp, /* True if this is a temporary index */ Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */ Token *pEnd /* The ")" that closes the CREATE INDEX statement */ ){ @@ -1539,10 +1546,11 @@ void sqliteCreateIndex( int i, j; Token nullId; /* Fake token for an empty ID list */ DbFixer sFix; /* For assigning database names to pTable */ + int isTemp; /* True for a temporary index */ sqlite *db = pParse->db; if( pParse->nErr || sqlite_malloc_failed ) goto exit_create_index; - if( !isTemp && pParse->initFlag + if( pParse->initFlag && sqliteFixInit(&sFix, pParse, pParse->iDb, "index", pName) && sqliteFixSrcList(&sFix, pTable) ){ @@ -1563,24 +1571,22 @@ void sqliteCreateIndex( if( pTab==0 || pParse->nErr ) goto exit_create_index; if( pTab->readOnly ){ sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, - " may not be indexed", 0); + " may not be indexed", (char*)0); pParse->nErr++; goto exit_create_index; } - if( !isTemp && pTab->iDb>=2 && pParse->initFlag==0 ){ + if( pTab->iDb>=2 && pParse->initFlag==0 ){ sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, - " may not have non-temporary indices added", 0); + " may not have indices added", (char*)0); pParse->nErr++; goto exit_create_index; } if( pTab->pSelect ){ - sqliteSetString(&pParse->zErrMsg, "views may not be indexed", 0); + sqliteSetString(&pParse->zErrMsg, "views may not be indexed", (char*)0); pParse->nErr++; goto exit_create_index; } - if( pTab->iDb==1 ){ - isTemp = 1; - } + isTemp = pTab->iDb==1; /* ** Find the name of the index. Make sure there is not already another @@ -1602,13 +1608,13 @@ void sqliteCreateIndex( if( zName==0 ) goto exit_create_index; if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){ sqliteSetString(&pParse->zErrMsg, "index ", zName, - " already exists", 0); + " already exists", (char*)0); pParse->nErr++; goto exit_create_index; } if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){ sqliteSetString(&pParse->zErrMsg, "there is already a table named ", - zName, 0); + zName, (char*)0); pParse->nErr++; goto exit_create_index; } @@ -1619,7 +1625,7 @@ void sqliteCreateIndex( for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} sprintf(zBuf,"%d)",n); zName = 0; - sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, 0); + sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0); if( zName==0 ) goto exit_create_index; }else{ zName = sqliteStrNDup(pName->z, pName->n); @@ -1631,8 +1637,7 @@ void sqliteCreateIndex( { const char *zDb = db->aDb[pTab->iDb].zName; - assert( isTemp==0 || isTemp==1 ); - assert( pTab->iDb==pParse->iDb || isTemp==1 ); + assert( pTab->iDb==pParse->iDb || isTemp ); if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ goto exit_create_index; } @@ -1680,7 +1685,7 @@ void sqliteCreateIndex( } if( j>=pTab->nCol ){ sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, - " has no column named ", pList->a[i].zName, 0); + " has no column named ", pList->a[i].zName, (char*)0); pParse->nErr++; sqliteFree(pIndex); goto exit_create_index; @@ -1693,8 +1698,8 @@ void sqliteCreateIndex( */ if( !pParse->explain ){ Index *p; - p = sqliteHashInsert(&db->aDb[isTemp].idxHash, - pIndex->zName, strlen(zName)+1, pIndex); + p = sqliteHashInsert(&db->aDb[pIndex->iDb].idxHash, + pIndex->zName, strlen(pIndex->zName)+1, pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ sqliteFree(pIndex); @@ -1911,10 +1916,12 @@ IdList *sqliteIdListAppend(IdList *pList, Token *pToken){ if( pList==0 ){ pList = sqliteMalloc( sizeof(IdList) ); if( pList==0 ) return 0; + pList->nAlloc = 0; } - if( (pList->nId & 7)==0 ){ + if( pList->nId>=pList->nAlloc ){ struct IdList_item *a; - a = sqliteRealloc(pList->a, (pList->nId+8)*sizeof(pList->a[0]) ); + pList->nAlloc = pList->nAlloc*2 + 5; + a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0]) ); if( a==0 ){ sqliteIdListDelete(pList); return 0; @@ -1965,11 +1972,13 @@ SrcList *sqliteSrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){ if( pList==0 ){ pList = sqliteMalloc( sizeof(SrcList) ); if( pList==0 ) return 0; + pList->nAlloc = 1; } - if( (pList->nSrc & 7)==1 ){ + if( pList->nSrc>=pList->nAlloc ){ SrcList *pNew; + pList->nAlloc *= 2; pNew = sqliteRealloc(pList, - sizeof(*pList) + (pList->nSrc+8)*sizeof(pList->a[0]) ); + sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) ); if( pNew==0 ){ sqliteSrcListDelete(pList); return 0; diff --git a/ext/sqlite/libsqlite/src/encode.c b/ext/sqlite/libsqlite/src/encode.c index 71dfe71741..5614999ab9 100644 --- a/ext/sqlite/libsqlite/src/encode.c +++ b/ext/sqlite/libsqlite/src/encode.c @@ -38,13 +38,13 @@ ** ** If that were all the encoder did, it would work, but in certain cases ** it could double the size of the encoded string. For example, to -** encode a string of 100 0x27 character would require 100 instances of +** encode a string of 100 0x27 characters would require 100 instances of ** the 0x01 0x03 escape sequence resulting in a 200-character output. ** We would prefer to keep the size of the encoded string smaller than ** this. ** ** To minimize the encoding size, we first add a fixed offset value to each -** byte in the sequence. The addition is module 256. (That is to say, if +** byte in the sequence. The addition is modulo 256. (That is to say, if ** the sum of the original character value and the offset exceeds 256, then ** the higher order bits are truncated.) The offset is chosen to minimize ** the number of characters in the string that need to be escaped. For @@ -86,12 +86,12 @@ ** the encoded buffer from all characters in the output buffer. ** ** The only tricky part is step (1) - how to compute an offset value to -** minimize the size of the output buffer. This is accomplished to testing +** minimize the size of the output buffer. This is accomplished by testing ** all offset values and picking the one that results in the fewest number ** of escapes. To do that, we first scan the entire input and count the ** number of occurances of each character value in the input. Suppose ** the number of 0x00 characters is N(0), the number of occurances of 0x01 -** is N(1), and so forth up to the number of occurances of 0xff is N(256). +** is N(1), and so forth up to the number of occurances of 0xff is N(255). ** An offset of 0 is not allowed so we don't have to test it. The number ** of escapes required for an offset of 1 is N(1)+N(2)+N(40). The number ** of escapes required for an offset of 2 is N(2)+N(3)+N(41). And so forth. @@ -107,10 +107,10 @@ ** string back into its original binary. ** ** The result is written into a preallocated output buffer "out". -** "out" must be able to hold at least (256*n + 1262)/253 bytes. +** "out" must be able to hold at least 2 +(257*n)/254 bytes. ** In other words, the output will be expanded by as much as 3 -** bytes for every 253 bytes of input plus 2 bytes of fixed overhead. -** (This is approximately 2 + 1.019*n or about a 2% size increase.) +** bytes for every 254 bytes of input plus 2 bytes of fixed overhead. +** (This is approximately 2 + 1.0118*n or about a 1.2% size increase.) ** ** The return value is the number of characters in the encoded ** string, excluding the "\000" terminator. @@ -159,7 +159,7 @@ int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out){ /* ** Decode the string "in" into binary data and write it into "out". -** This routine reverses the encoded created by sqlite_encode_binary(). +** This routine reverses the encoding created by sqlite_encode_binary(). ** The output will always be a few bytes less than the input. The number ** of bytes of output is returned. If the input is not a well-formed ** encoding, -1 is returned. diff --git a/ext/sqlite/libsqlite/src/expr.c b/ext/sqlite/libsqlite/src/expr.c index d3b4cc69b1..273b3a0a01 100644 --- a/ext/sqlite/libsqlite/src/expr.c +++ b/ext/sqlite/libsqlite/src/expr.c @@ -160,7 +160,7 @@ ExprList *sqliteExprListDup(ExprList *p){ if( p==0 ) return 0; pNew = sqliteMalloc( sizeof(*pNew) ); if( pNew==0 ) return 0; - pNew->nExpr = p->nExpr; + pNew->nExpr = pNew->nAlloc = p->nExpr; pNew->a = sqliteMalloc( p->nExpr*sizeof(p->a[0]) ); if( pNew->a==0 ) return 0; for(i=0; i<p->nExpr; i++){ @@ -189,7 +189,7 @@ SrcList *sqliteSrcListDup(SrcList *p){ nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); pNew = sqliteMalloc( nByte ); if( pNew==0 ) return 0; - pNew->nSrc = p->nSrc; + pNew->nSrc = pNew->nAlloc = p->nSrc; for(i=0; i<p->nSrc; i++){ pNew->a[i].zDatabase = sqliteStrDup(p->a[i].zDatabase); pNew->a[i].zName = sqliteStrDup(p->a[i].zName); @@ -209,7 +209,7 @@ IdList *sqliteIdListDup(IdList *p){ if( p==0 ) return 0; pNew = sqliteMalloc( sizeof(*pNew) ); if( pNew==0 ) return 0; - pNew->nId = p->nId; + pNew->nId = pNew->nAlloc = p->nId; pNew->a = sqliteMalloc( p->nId*sizeof(p->a[0]) ); if( pNew->a==0 ) return 0; for(i=0; i<p->nId; i++){ @@ -235,6 +235,8 @@ Select *sqliteSelectDup(Select *p){ pNew->nLimit = p->nLimit; pNew->nOffset = p->nOffset; pNew->zSelect = 0; + pNew->iLimit = -1; + pNew->iOffset = -1; return pNew; } @@ -251,21 +253,22 @@ ExprList *sqliteExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){ sqliteExprDelete(pExpr); return 0; } + pList->nAlloc = 0; } - if( (pList->nExpr & 7)==0 ){ - int n = pList->nExpr + 8; + if( pList->nAlloc<=pList->nExpr ){ struct ExprList_item *a; - a = sqliteRealloc(pList->a, n*sizeof(pList->a[0])); + pList->nAlloc = pList->nAlloc*2 + 4; + a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0])); if( a==0 ){ sqliteExprDelete(pExpr); return pList; } pList->a = a; } - if( pExpr || pName ){ + if( pList->a && (pExpr || pName) ){ i = pList->nExpr++; + memset(&pList->a[i], 0, sizeof(pList->a[i])); pList->a[i].pExpr = pExpr; - pList->a[i].zName = 0; if( pName ){ sqliteSetNString(&pList->a[i].zName, pName->z, pName->n, 0); sqliteDequote(pList->a[i].zName); @@ -307,6 +310,7 @@ int sqliteExprIsConstant(Expr *p){ case TK_STRING: case TK_INTEGER: case TK_FLOAT: + case TK_VARIABLE: return 1; default: { if( p->pLeft && !sqliteExprIsConstant(p->pLeft) ) return 0; @@ -324,22 +328,26 @@ int sqliteExprIsConstant(Expr *p){ } /* -** If the given expression codes a constant integer, return 1 and put -** the value of the integer in *pValue. If the expression is not an -** integer, return 0 and leave *pValue unchanged. +** If the given expression codes a constant integer that is small enough +** to fit in a 32-bit integer, return 1 and put the value of the integer +** in *pValue. If the expression is not an integer or if it is too big +** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. */ int sqliteExprIsInteger(Expr *p, int *pValue){ switch( p->op ){ case TK_INTEGER: { - *pValue = atoi(p->token.z); - return 1; + if( sqliteFitsIn32Bits(p->token.z) ){ + *pValue = atoi(p->token.z); + return 1; + } + break; } case TK_STRING: { const char *z = p->token.z; int n = p->token.n; if( n>0 && z[0]=='-' ){ z++; n--; } while( n>0 && *z && isdigit(*z) ){ z++; n--; } - if( n==0 ){ + if( n==0 && sqliteFitsIn32Bits(p->token.z) ){ *pValue = atoi(p->token.z); return 1; } @@ -911,6 +919,7 @@ int sqliteExprType(Expr *p){ case TK_STRING: case TK_NULL: case TK_CONCAT: + case TK_VARIABLE: return SQLITE_SO_TEXT; case TK_LT: @@ -964,6 +973,8 @@ int sqliteExprType(Expr *p){ return SQLITE_SO_NUM; } +/* Run */ + /* ** Generate code into the current Vdbe to evaluate the given ** expression and leave the result on the top of stack. @@ -1009,16 +1020,10 @@ void sqliteExprCode(Parse *pParse, Expr *pExpr){ break; } case TK_INTEGER: { - int iVal = atoi(pExpr->token.z); - char zBuf[30]; - sprintf(zBuf,"%d",iVal); - if( strlen(zBuf)!=pExpr->token.n - || strncmp(pExpr->token.z,zBuf,pExpr->token.n)!=0 ){ - /* If the integer value cannot be represented exactly in 32 bits, - ** then code it as a string instead. */ + if( !sqliteFitsIn32Bits(pExpr->token.z) ){ sqliteVdbeAddOp(v, OP_String, 0, 0); }else{ - sqliteVdbeAddOp(v, OP_Integer, iVal, 0); + sqliteVdbeAddOp(v, OP_Integer, atoi(pExpr->token.z), 0); } sqliteVdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n); break; @@ -1040,6 +1045,10 @@ void sqliteExprCode(Parse *pParse, Expr *pExpr){ sqliteVdbeAddOp(v, OP_String, 0, 0); break; } + case TK_VARIABLE: { + sqliteVdbeAddOp(v, OP_Variable, pExpr->iTable, 0); + break; + } case TK_LT: case TK_LE: case TK_GT: @@ -1081,7 +1090,11 @@ void sqliteExprCode(Parse *pParse, Expr *pExpr){ case TK_UPLUS: { Expr *pLeft = pExpr->pLeft; if( pLeft && pLeft->op==TK_INTEGER ){ - sqliteVdbeAddOp(v, OP_Integer, atoi(pLeft->token.z), 0); + if( sqliteFitsIn32Bits(pLeft->token.z) ){ + sqliteVdbeAddOp(v, OP_Integer, atoi(pLeft->token.z), 0); + }else{ + sqliteVdbeAddOp(v, OP_String, 0, 0); + } sqliteVdbeChangeP3(v, -1, pLeft->token.z, pLeft->token.n); }else if( pLeft && pLeft->op==TK_FLOAT ){ sqliteVdbeAddOp(v, OP_String, 0, 0); @@ -1097,7 +1110,7 @@ void sqliteExprCode(Parse *pParse, Expr *pExpr){ Token *p = &pExpr->pLeft->token; char *z = sqliteMalloc( p->n + 2 ); sprintf(z, "-%.*s", p->n, p->z); - if( pExpr->pLeft->op==TK_INTEGER ){ + if( pExpr->pLeft->op==TK_INTEGER && sqliteFitsIn32Bits(z) ){ sqliteVdbeAddOp(v, OP_Integer, atoi(z), 0); }else{ sqliteVdbeAddOp(v, OP_String, 0, 0); diff --git a/ext/sqlite/libsqlite/src/func.c b/ext/sqlite/libsqlite/src/func.c index a1662abae2..c348db21c5 100644 --- a/ext/sqlite/libsqlite/src/func.c +++ b/ext/sqlite/libsqlite/src/func.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <assert.h> #include "sqliteInt.h" +#include "os.h" /* ** Implementation of the non-aggregate min() and max() functions @@ -121,13 +122,11 @@ static void substrFunc(sqlite_func *context, int argc, const char **argv){ p2 = len-p1; } #ifdef SQLITE_UTF8 - for(i=0; i<p1; i++){ - assert( z[i] ); + for(i=0; i<p1 && z[i]; i++){ if( (z[i]&0xc0)==0x80 ) p1++; } while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p1++; } - for(; i<p1+p2; i++){ - assert( z[i] ); + for(; i<p1+p2 && z[i]; i++){ if( (z[i]&0xc0)==0x80 ) p2++; } while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p2++; } @@ -148,7 +147,7 @@ static void roundFunc(sqlite_func *context, int argc, const char **argv){ n = argc==2 ? atoi(argv[1]) : 0; if( n>30 ) n = 30; if( n<0 ) n = 0; - r = atof(argv[0]); + r = sqliteAtoF(argv[0]); sprintf(zBuf,"%.*f",n,r); sqlite_set_result_string(context, zBuf, -1); } @@ -219,7 +218,9 @@ static void last_insert_rowid(sqlite_func *context, int arg, const char **argv){ */ static void likeFunc(sqlite_func *context, int arg, const char **argv){ if( argv[0]==0 || argv[1]==0 ) return; - sqlite_set_result_int(context, sqliteLikeCompare(argv[0], argv[1])); + sqlite_set_result_int(context, + sqliteLikeCompare((const unsigned char*)argv[0], + (const unsigned char*)argv[1])); } /* @@ -233,7 +234,9 @@ static void likeFunc(sqlite_func *context, int arg, const char **argv){ */ static void globFunc(sqlite_func *context, int arg, const char **argv){ if( argv[0]==0 || argv[1]==0 ) return; - sqlite_set_result_int(context, sqliteGlobCompare(argv[0], argv[1])); + sqlite_set_result_int(context, + sqliteGlobCompare((const unsigned char*)argv[0], + (const unsigned char*)argv[1])); } /* @@ -255,6 +258,43 @@ static void versionFunc(sqlite_func *context, int argc, const char **argv){ sqlite_set_result_string(context, sqlite_version, -1); } +/* +** EXPERIMENTAL - This is not an official function. The interface may +** change. This function may disappear. Do not write code that depends +** on this function. +** +** Implementation of the QUOTE() function. This function takes a single +** argument. If the argument is numeric, the return value is the same as +** the argument. If the argument is NULL, the return value is the string +** "NULL". Otherwise, the argument is enclosed in single quotes with +** single-quote escapes. +*/ +static void quoteFunc(sqlite_func *context, int argc, const char **argv){ + if( argc<1 ) return; + if( argv[0]==0 ){ + sqlite_set_result_string(context, "NULL", 4); + }else if( sqliteIsNumber(argv[0]) ){ + sqlite_set_result_string(context, argv[0], -1); + }else{ + int i,j,n; + char *z; + for(i=n=0; argv[0][i]; i++){ if( argv[0][i]=='\'' ) n++; } + z = sqliteMalloc( i+n+3 ); + if( z==0 ) return; + z[0] = '\''; + for(i=0, j=1; argv[0][i]; i++){ + z[j++] = argv[0][i]; + if( argv[0][i]=='\'' ){ + z[j++] = '\''; + } + } + z[j++] = '\''; + z[j] = 0; + sqlite_set_result_string(context, z, j); + sqliteFree(z); + } +} + #ifdef SQLITE_SOUNDEX /* ** Compute the soundex encoding of a word. @@ -290,7 +330,7 @@ static void soundexFunc(sqlite_func *context, int argc, const char **argv){ zResult[j] = 0; sqlite_set_result_string(context, zResult, 4); }else{ - sqlite_set_result_string(context, zResult, "?000", 4); + sqlite_set_result_string(context, "?000", 4); } } #endif @@ -355,7 +395,7 @@ static void sumStep(sqlite_func *context, int argc, const char **argv){ if( argc<1 ) return; p = sqlite_aggregate_context(context, sizeof(*p)); if( p && argv[0] ){ - p->sum += atof(argv[0]); + p->sum += sqliteAtoF(argv[0]); p->cnt++; } } @@ -393,7 +433,7 @@ static void stdDevStep(sqlite_func *context, int argc, const char **argv){ if( argc<1 ) return; p = sqlite_aggregate_context(context, sizeof(*p)); if( p && argv[0] ){ - x = atof(argv[0]); + x = sqliteAtoF(argv[0]); p->sum += x; p->sum2 += x*x; p->cnt++; @@ -529,6 +569,7 @@ void sqliteRegisterBuiltinFunctions(sqlite *db){ { "glob", 2, SQLITE_NUMERIC, globFunc }, { "nullif", 2, SQLITE_ARGS, nullifFunc }, { "sqlite_version",0,SQLITE_TEXT, versionFunc}, + { "quote", 1, SQLITE_ARGS, quoteFunc }, #ifdef SQLITE_SOUNDEX { "soundex", 1, SQLITE_TEXT, soundexFunc}, #endif @@ -570,4 +611,5 @@ void sqliteRegisterBuiltinFunctions(sqlite *db){ aAggs[i].nArg, aAggs[i].xStep, aAggs[i].xFinalize, 0); sqlite_function_type(db, aAggs[i].zName, aAggs[i].dataType); } + sqliteRegisterDateTimeFunctions(db); } diff --git a/ext/sqlite/libsqlite/src/hash.c b/ext/sqlite/libsqlite/src/hash.c index aa3bb81c44..77be2807b2 100644 --- a/ext/sqlite/libsqlite/src/hash.c +++ b/ext/sqlite/libsqlite/src/hash.c @@ -75,6 +75,7 @@ static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){ return n2 - n1; } +#if 0 /* NOT USED */ /* ** Hash and comparison functions when the mode is SQLITE_HASH_POINTER */ @@ -87,6 +88,7 @@ static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){ if( pKey1<pKey2 ) return -1; return 1; } +#endif /* ** Hash and comparison functions when the mode is SQLITE_HASH_STRING @@ -130,7 +132,7 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ static int (*hashFunction(int keyClass))(const void*,int){ switch( keyClass ){ case SQLITE_HASH_INT: return &intHash; - case SQLITE_HASH_POINTER: return &ptrHash; + /* case SQLITE_HASH_POINTER: return &ptrHash; // NOT USED */ case SQLITE_HASH_STRING: return &strHash; case SQLITE_HASH_BINARY: return &binHash;; default: break; @@ -147,7 +149,7 @@ static int (*hashFunction(int keyClass))(const void*,int){ static int (*compareFunction(int keyClass))(const void*,int,const void*,int){ switch( keyClass ){ case SQLITE_HASH_INT: return &intCompare; - case SQLITE_HASH_POINTER: return &ptrCompare; + /* case SQLITE_HASH_POINTER: return &ptrCompare; // NOT USED */ case SQLITE_HASH_STRING: return &strCompare; case SQLITE_HASH_BINARY: return &binCompare; default: break; diff --git a/ext/sqlite/libsqlite/src/hash.h b/ext/sqlite/libsqlite/src/hash.h index 053fa70cad..5f6335e1c8 100644 --- a/ext/sqlite/libsqlite/src/hash.h +++ b/ext/sqlite/libsqlite/src/hash.h @@ -71,7 +71,7 @@ struct HashElem { ** if the copyKey parameter to HashInit is 1. */ #define SQLITE_HASH_INT 1 -#define SQLITE_HASH_POINTER 2 +/* #define SQLITE_HASH_POINTER 2 // NOT USED */ #define SQLITE_HASH_STRING 3 #define SQLITE_HASH_BINARY 4 diff --git a/ext/sqlite/libsqlite/src/insert.c b/ext/sqlite/libsqlite/src/insert.c index 07cb30440e..ab72cb761d 100644 --- a/ext/sqlite/libsqlite/src/insert.c +++ b/ext/sqlite/libsqlite/src/insert.c @@ -688,7 +688,7 @@ void sqliteGenerateConstraintChecks( char *zMsg = 0; sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName, - " may not be NULL", 0); + " may not be NULL", (char*)0); sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC); break; } @@ -817,8 +817,30 @@ void sqliteGenerateConstraintChecks( case OE_Rollback: case OE_Abort: case OE_Fail: { + int j, n1, n2; + char zErrMsg[200]; + strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column "); + n1 = strlen(zErrMsg); + for(j=0; j<pIdx->nColumn && n1<sizeof(zErrMsg)-30; j++){ + char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; + n2 = strlen(zCol); + if( j>0 ){ + strcpy(&zErrMsg[n1], ", "); + n1 += 2; + } + if( n1+n2>sizeof(zErrMsg)-30 ){ + strcpy(&zErrMsg[n1], "..."); + n1 += 3; + break; + }else{ + strcpy(&zErrMsg[n1], zCol); + n1 += n2; + } + } + strcpy(&zErrMsg[n1], + pIdx->nColumn>1 ? " are not unique" : " is not unique"); sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError); - sqliteVdbeChangeP3(v, -1, "uniqueness constraint failed", P3_STATIC); + sqliteVdbeChangeP3(v, -1, sqliteStrDup(zErrMsg), P3_DYNAMIC); break; } case OE_Ignore: { diff --git a/ext/sqlite/libsqlite/src/main.c b/ext/sqlite/libsqlite/src/main.c index e2d51d87df..e2b269738b 100644 --- a/ext/sqlite/libsqlite/src/main.c +++ b/ext/sqlite/libsqlite/src/main.c @@ -34,7 +34,7 @@ typedef struct { ** that the database is corrupt. */ static void corruptSchema(InitData *pData){ - sqliteSetString(pData->pzErrMsg, "malformed database schema", 0); + sqliteSetString(pData->pzErrMsg, "malformed database schema", (char*)0); } /* @@ -58,6 +58,7 @@ int sqliteInitCallback(void *pInit, int argc, char **argv, char **azColName){ int nErr = 0; assert( argc==5 ); + if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[0]==0 ){ corruptSchema(pData); return 1; @@ -149,7 +150,7 @@ int upgrade_3_callback(void *pInit, int argc, char **argv, char **NotUsed){ "DROP TABLE sqlite_x;", 0, 0, &zErr, argv[0], argv[0], argv[0]); if( zErr ){ - sqliteSetString(pData->pzErrMsg, zErr, 0); + sqliteSetString(pData->pzErrMsg, zErr, (char*)0); sqlite_freemem(zErr); } @@ -271,7 +272,7 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ if( db->aDb[iDb].pBt==0 ) return SQLITE_OK; rc = sqliteBtreeCursor(db->aDb[iDb].pBt, 2, 0, &curMain); if( rc ){ - sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); return rc; } @@ -279,7 +280,7 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ */ rc = sqliteBtreeGetMeta(db->aDb[iDb].pBt, meta); if( rc ){ - sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0); sqliteBtreeCloseCursor(curMain); return rc; } @@ -305,17 +306,17 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ db->file_format = 4; }else if( db->file_format>4 ){ sqliteBtreeCloseCursor(curMain); - sqliteSetString(pzErrMsg, "unsupported file format", 0); + sqliteSetString(pzErrMsg, "unsupported file format", (char*)0); return SQLITE_ERROR; } }else if( db->file_format!=meta[2] || db->file_format<4 ){ assert( db->file_format>=4 ); if( meta[2]==0 ){ sqliteSetString(pzErrMsg, "cannot attach empty database: ", - db->aDb[iDb].zName, 0); + db->aDb[iDb].zName, (char*)0); }else{ sqliteSetString(pzErrMsg, "incompatible file format in auxiliary " - "database: ", db->aDb[iDb].zName, 0); + "database: ", db->aDb[iDb].zName, (char*)0); } sqliteBtreeClose(db->aDb[iDb].pBt); db->aDb[iDb].pBt = 0; @@ -340,13 +341,13 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){ char *zSql = 0; sqliteSetString(&zSql, "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"", - db->aDb[iDb].zName, "\".sqlite_master", 0); + db->aDb[iDb].zName, "\".sqlite_master", (char*)0); sqliteRunParser(&sParse, zSql, pzErrMsg); sqliteFree(zSql); } sqliteBtreeCloseCursor(curMain); if( sqlite_malloc_failed ){ - sqliteSetString(pzErrMsg, "out of memory", 0); + sqliteSetString(pzErrMsg, "out of memory", (char*)0); sParse.rc = SQLITE_NOMEM; sqliteResetInternalSchema(db, 0); } @@ -447,7 +448,8 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){ if( rc!=SQLITE_OK ){ switch( rc ){ default: { - sqliteSetString(pzErrMsg, "unable to open database: ", zFilename, 0); + sqliteSetString(pzErrMsg, "unable to open database: ", + zFilename, (char*)0); } } sqliteFree(db); @@ -500,7 +502,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){ if( rc!=SQLITE_OK ){ sqliteSetString(pzErrMsg, "unable to upgrade database to the version 2.6 format", - zErr ? ": " : 0, zErr, 0); + zErr ? ": " : 0, zErr, (char*)0); sqlite_freemem(zErr); sqliteStrRealloc(pzErrMsg); sqlite_close(db); @@ -513,7 +515,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){ return db; no_mem_on_open: - sqliteSetString(pzErrMsg, "out of memory", 0); + sqliteSetString(pzErrMsg, "out of memory", (char*)0); sqliteStrRealloc(pzErrMsg); return 0; } @@ -616,7 +618,7 @@ static int sqliteMain( } if( db->file_format<3 ){ sqliteSafetyOff(db); - sqliteSetString(pzErrMsg, "obsolete database file format", 0); + sqliteSetString(pzErrMsg, "obsolete database file format", (char*)0); return SQLITE_ERROR; } if( db->pVdbe==0 ){ db->nChange = 0; } @@ -628,7 +630,7 @@ static int sqliteMain( if( db->xTrace ) db->xTrace(db->pTraceArg, zSql); sqliteRunParser(&sParse, zSql, pzErrMsg); if( sqlite_malloc_failed ){ - sqliteSetString(pzErrMsg, "out of memory", 0); + sqliteSetString(pzErrMsg, "out of memory", (char*)0); sParse.rc = SQLITE_NOMEM; sqliteRollbackAll(db); sqliteResetInternalSchema(db, 0); @@ -636,7 +638,7 @@ static int sqliteMain( } if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ - sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), 0); + sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), (char*)0); } sqliteStrRealloc(pzErrMsg); if( sParse.rc==SQLITE_SCHEMA ){ @@ -645,7 +647,7 @@ static int sqliteMain( if( sParse.useCallback==0 ){ assert( ppVm ); *ppVm = (sqlite_vm*)sParse.pVdbe; - *pzTail = sParse.zTail; + if( pzTail ) *pzTail = sParse.zTail; } if( sqliteSafetyOff(db) ) goto exec_misuse; return sParse.rc; @@ -653,7 +655,7 @@ static int sqliteMain( exec_misuse: if( pzErrMsg ){ *pzErrMsg = 0; - sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0); + sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0); sqliteStrRealloc(pzErrMsg); } return SQLITE_MISUSE; @@ -694,6 +696,7 @@ int sqlite_compile( return sqliteMain(db, zSql, 0, 0, pzTail, ppVm, pzErrMsg); } + /* ** The following routine destroys a virtual machine that is created by ** the sqlite_compile() routine. @@ -715,6 +718,23 @@ int sqlite_finalize( } /* +** Terminate the current execution of a virtual machine then +** reset the virtual machine back to its starting state so that it +** can be reused. Any error message resulting from the prior execution +** is written into *pzErrMsg. A success code from the prior execution +** is returned. +*/ +int sqlite_reset( + sqlite_vm *pVm, /* The virtual machine to be destroyed */ + char **pzErrMsg /* OUT: Write error messages here */ +){ + int rc = sqliteVdbeReset((Vdbe*)pVm, pzErrMsg); + sqliteVdbeMakeReady((Vdbe*)pVm, -1, 0, 0, 0); + sqliteStrRealloc(pzErrMsg); + return rc; +} + +/* ** Return a static string that describes the kind of error specified in the ** argument. */ @@ -745,6 +765,8 @@ const char *sqlite_error_string(int rc){ case SQLITE_MISUSE: z = "library routine called out of sequence";break; case SQLITE_NOLFS: z = "kernel lacks large file support"; break; case SQLITE_AUTH: z = "authorization denied"; break; + case SQLITE_FORMAT: z = "auxiliary database format error"; break; + case SQLITE_RANGE: z = "bind index out of range"; break; default: z = "unknown error"; break; } return z; @@ -764,7 +786,7 @@ static int sqliteDefaultBusyCallback( #if SQLITE_MIN_SLEEP_MS==1 int delay = 10; int prior_delay = 0; - int timeout = (int)Timeout; + int timeout = (int)(long)Timeout; int i; for(i=1; i<count; i++){ @@ -783,7 +805,7 @@ static int sqliteDefaultBusyCallback( sqliteOsSleep(delay); return 1; #else - int timeout = (int)Timeout; + int timeout = (int)(long)Timeout; if( (count+1)*1000 > timeout ){ return 0; } @@ -805,6 +827,31 @@ void sqlite_busy_handler( db->pBusyArg = pArg; } +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK +/* +** This routine sets the progress callback for an Sqlite database to the +** given callback function with the given argument. The progress callback will +** be invoked every nOps opcodes. +*/ +void sqlite_progress_handler( + sqlite *db, + int nOps, + int (*xProgress)(void*), + void *pArg +){ + if( nOps>0 ){ + db->xProgress = xProgress; + db->nProgressOps = nOps; + db->pProgressArg = pArg; + }else{ + db->xProgress = 0; + db->nProgressOps = 0; + db->pProgressArg = 0; + } +} +#endif + + /* ** This routine installs a default busy handler that waits for the ** specified number of milliseconds before returning 0. diff --git a/ext/sqlite/libsqlite/src/opcodes.c b/ext/sqlite/libsqlite/src/opcodes.c index 1363a0fa31..59061b7c0a 100644 --- a/ext/sqlite/libsqlite/src/opcodes.c +++ b/ext/sqlite/libsqlite/src/opcodes.c @@ -6,6 +6,7 @@ char *sqliteOpcodeNames[] = { "???", "Halt", "Integer", "String", + "Variable", "Pop", "Dup", "Pull", @@ -25,6 +26,7 @@ char *sqliteOpcodeNames[] = { "???", "ShiftLeft", "ShiftRight", "AddImm", + "IsNumeric", "MustBeInt", "Eq", "Ne", @@ -77,6 +79,7 @@ char *sqliteOpcodeNames[] = { "???", "PutStrKey", "Delete", "KeyAsData", + "RowKey", "RowData", "Column", "Recno", @@ -92,6 +95,7 @@ char *sqliteOpcodeNames[] = { "???", "IdxLT", "IdxGT", "IdxGE", + "IdxIsNull", "Destroy", "Clear", "CreateIndex", @@ -128,4 +132,5 @@ char *sqliteOpcodeNames[] = { "???", "SetNotFound", "SetFirst", "SetNext", + "Vacuum", }; diff --git a/ext/sqlite/libsqlite/src/opcodes.h b/ext/sqlite/libsqlite/src/opcodes.h index ccd7da4ae3..ac274022d1 100644 --- a/ext/sqlite/libsqlite/src/opcodes.h +++ b/ext/sqlite/libsqlite/src/opcodes.h @@ -5,125 +5,130 @@ #define OP_Halt 4 #define OP_Integer 5 #define OP_String 6 -#define OP_Pop 7 -#define OP_Dup 8 -#define OP_Pull 9 -#define OP_Push 10 -#define OP_ColumnName 11 -#define OP_Callback 12 -#define OP_NullCallback 13 -#define OP_Concat 14 -#define OP_Add 15 -#define OP_Subtract 16 -#define OP_Multiply 17 -#define OP_Divide 18 -#define OP_Remainder 19 -#define OP_Function 20 -#define OP_BitAnd 21 -#define OP_BitOr 22 -#define OP_ShiftLeft 23 -#define OP_ShiftRight 24 -#define OP_AddImm 25 -#define OP_MustBeInt 26 -#define OP_Eq 27 -#define OP_Ne 28 -#define OP_Lt 29 -#define OP_Le 30 -#define OP_Gt 31 -#define OP_Ge 32 -#define OP_StrEq 33 -#define OP_StrNe 34 -#define OP_StrLt 35 -#define OP_StrLe 36 -#define OP_StrGt 37 -#define OP_StrGe 38 -#define OP_And 39 -#define OP_Or 40 -#define OP_Negative 41 -#define OP_AbsValue 42 -#define OP_Not 43 -#define OP_BitNot 44 -#define OP_Noop 45 -#define OP_If 46 -#define OP_IfNot 47 -#define OP_IsNull 48 -#define OP_NotNull 49 -#define OP_MakeRecord 50 -#define OP_MakeIdxKey 51 -#define OP_MakeKey 52 -#define OP_IncrKey 53 -#define OP_Checkpoint 54 -#define OP_Transaction 55 -#define OP_Commit 56 -#define OP_Rollback 57 -#define OP_ReadCookie 58 -#define OP_SetCookie 59 -#define OP_VerifyCookie 60 -#define OP_OpenRead 61 -#define OP_OpenWrite 62 -#define OP_OpenTemp 63 -#define OP_OpenPseudo 64 -#define OP_Close 65 -#define OP_MoveLt 66 -#define OP_MoveTo 67 -#define OP_Distinct 68 -#define OP_NotFound 69 -#define OP_Found 70 -#define OP_IsUnique 71 -#define OP_NotExists 72 -#define OP_NewRecno 73 -#define OP_PutIntKey 74 -#define OP_PutStrKey 75 -#define OP_Delete 76 -#define OP_KeyAsData 77 -#define OP_RowData 78 -#define OP_Column 79 -#define OP_Recno 80 -#define OP_FullKey 81 -#define OP_NullRow 82 -#define OP_Last 83 -#define OP_Rewind 84 -#define OP_Prev 85 -#define OP_Next 86 -#define OP_IdxPut 87 -#define OP_IdxDelete 88 -#define OP_IdxRecno 89 -#define OP_IdxLT 90 -#define OP_IdxGT 91 -#define OP_IdxGE 92 -#define OP_Destroy 93 -#define OP_Clear 94 -#define OP_CreateIndex 95 -#define OP_CreateTable 96 -#define OP_IntegrityCk 97 -#define OP_ListWrite 98 -#define OP_ListRewind 99 -#define OP_ListRead 100 -#define OP_ListReset 101 -#define OP_ListPush 102 -#define OP_ListPop 103 -#define OP_SortPut 104 -#define OP_SortMakeRec 105 -#define OP_SortMakeKey 106 -#define OP_Sort 107 -#define OP_SortNext 108 -#define OP_SortCallback 109 -#define OP_SortReset 110 -#define OP_FileOpen 111 -#define OP_FileRead 112 -#define OP_FileColumn 113 -#define OP_MemStore 114 -#define OP_MemLoad 115 -#define OP_MemIncr 116 -#define OP_AggReset 117 -#define OP_AggInit 118 -#define OP_AggFunc 119 -#define OP_AggFocus 120 -#define OP_AggSet 121 -#define OP_AggGet 122 -#define OP_AggNext 123 -#define OP_SetInsert 124 -#define OP_SetFound 125 -#define OP_SetNotFound 126 -#define OP_SetFirst 127 -#define OP_SetNext 128 +#define OP_Variable 7 +#define OP_Pop 8 +#define OP_Dup 9 +#define OP_Pull 10 +#define OP_Push 11 +#define OP_ColumnName 12 +#define OP_Callback 13 +#define OP_NullCallback 14 +#define OP_Concat 15 +#define OP_Add 16 +#define OP_Subtract 17 +#define OP_Multiply 18 +#define OP_Divide 19 +#define OP_Remainder 20 +#define OP_Function 21 +#define OP_BitAnd 22 +#define OP_BitOr 23 +#define OP_ShiftLeft 24 +#define OP_ShiftRight 25 +#define OP_AddImm 26 +#define OP_IsNumeric 27 +#define OP_MustBeInt 28 +#define OP_Eq 29 +#define OP_Ne 30 +#define OP_Lt 31 +#define OP_Le 32 +#define OP_Gt 33 +#define OP_Ge 34 +#define OP_StrEq 35 +#define OP_StrNe 36 +#define OP_StrLt 37 +#define OP_StrLe 38 +#define OP_StrGt 39 +#define OP_StrGe 40 +#define OP_And 41 +#define OP_Or 42 +#define OP_Negative 43 +#define OP_AbsValue 44 +#define OP_Not 45 +#define OP_BitNot 46 +#define OP_Noop 47 +#define OP_If 48 +#define OP_IfNot 49 +#define OP_IsNull 50 +#define OP_NotNull 51 +#define OP_MakeRecord 52 +#define OP_MakeIdxKey 53 +#define OP_MakeKey 54 +#define OP_IncrKey 55 +#define OP_Checkpoint 56 +#define OP_Transaction 57 +#define OP_Commit 58 +#define OP_Rollback 59 +#define OP_ReadCookie 60 +#define OP_SetCookie 61 +#define OP_VerifyCookie 62 +#define OP_OpenRead 63 +#define OP_OpenWrite 64 +#define OP_OpenTemp 65 +#define OP_OpenPseudo 66 +#define OP_Close 67 +#define OP_MoveLt 68 +#define OP_MoveTo 69 +#define OP_Distinct 70 +#define OP_NotFound 71 +#define OP_Found 72 +#define OP_IsUnique 73 +#define OP_NotExists 74 +#define OP_NewRecno 75 +#define OP_PutIntKey 76 +#define OP_PutStrKey 77 +#define OP_Delete 78 +#define OP_KeyAsData 79 +#define OP_RowKey 80 +#define OP_RowData 81 +#define OP_Column 82 +#define OP_Recno 83 +#define OP_FullKey 84 +#define OP_NullRow 85 +#define OP_Last 86 +#define OP_Rewind 87 +#define OP_Prev 88 +#define OP_Next 89 +#define OP_IdxPut 90 +#define OP_IdxDelete 91 +#define OP_IdxRecno 92 +#define OP_IdxLT 93 +#define OP_IdxGT 94 +#define OP_IdxGE 95 +#define OP_IdxIsNull 96 +#define OP_Destroy 97 +#define OP_Clear 98 +#define OP_CreateIndex 99 +#define OP_CreateTable 100 +#define OP_IntegrityCk 101 +#define OP_ListWrite 102 +#define OP_ListRewind 103 +#define OP_ListRead 104 +#define OP_ListReset 105 +#define OP_ListPush 106 +#define OP_ListPop 107 +#define OP_SortPut 108 +#define OP_SortMakeRec 109 +#define OP_SortMakeKey 110 +#define OP_Sort 111 +#define OP_SortNext 112 +#define OP_SortCallback 113 +#define OP_SortReset 114 +#define OP_FileOpen 115 +#define OP_FileRead 116 +#define OP_FileColumn 117 +#define OP_MemStore 118 +#define OP_MemLoad 119 +#define OP_MemIncr 120 +#define OP_AggReset 121 +#define OP_AggInit 122 +#define OP_AggFunc 123 +#define OP_AggFocus 124 +#define OP_AggSet 125 +#define OP_AggGet 126 +#define OP_AggNext 127 +#define OP_SetInsert 128 +#define OP_SetFound 129 +#define OP_SetNotFound 130 +#define OP_SetFirst 131 +#define OP_SetNext 132 +#define OP_Vacuum 133 diff --git a/ext/sqlite/libsqlite/src/os.c b/ext/sqlite/libsqlite/src/os.c index d9d16ed0c1..2c57078305 100644 --- a/ext/sqlite/libsqlite/src/os.c +++ b/ext/sqlite/libsqlite/src/os.c @@ -62,6 +62,24 @@ #endif /* +** Macros used to determine whether or not to use threads. The +** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for +** Posix threads and SQLITE_W32_THREADS is defined if we are +** synchronizing using Win32 threads. +*/ +#if OS_UNIX && defined(THREADSAFE) && THREADSAFE +# include <pthread.h> +# define SQLITE_UNIX_THREADS 1 +#endif +#if OS_WIN && defined(THREADSAFE) && THREADSAFE +# define SQLITE_W32_THREADS 1 +#endif +#if OS_MAC && defined(THREADSAFE) && THREADSAFE +# include <Multiprocessing.h> +# define SQLITE_MACOS_MULTITASKING 1 +#endif + +/* ** Macros for performance tracing. Normally turned off */ #if 0 @@ -107,7 +125,7 @@ static unsigned int elapse; ** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644); ** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); ** -** Suppose ./file1 and ./file2 are really be the same file (because +** Suppose ./file1 and ./file2 are really the same file (because ** one is a hard or symbolic link to the other) then if you set ** an exclusive lock on fd1, then try to get an exclusive lock ** on fd2, it works. I would have expected the second lock to @@ -146,80 +164,196 @@ static unsigned int elapse; ** structure. The fcntl() system call is only invoked to set a ** POSIX lock if the internal lock structure transitions between ** a locked and an unlocked state. +** +** 2004-Jan-11: +** More recent discoveries about POSIX advisory locks. (The more +** I discover, the more I realize the a POSIX advisory locks are +** an abomination.) +** +** If you close a file descriptor that points to a file that has locks, +** all locks on that file that are owned by the current process are +** released. To work around this problem, each OsFile structure contains +** a pointer to an openCnt structure. There is one openCnt structure +** per open inode, which means that multiple OsFiles can point to a single +** openCnt. When an attempt is made to close an OsFile, if there are +** other OsFiles open on the same inode that are holding locks, the call +** to close() the file descriptor is deferred until all of the locks clear. +** The openCnt structure keeps a list of file descriptors that need to +** be closed and that list is walked (and cleared) when the last lock +** clears. +** +** First, under Linux threads, because each thread has a separate +** process ID, lock operations in one thread do not override locks +** to the same file in other threads. Linux threads behave like +** separate processes in this respect. But, if you close a file +** descriptor in linux threads, all locks are cleared, even locks +** on other threads and even though the other threads have different +** process IDs. Linux threads is inconsistent in this respect. +** (I'm beginning to think that linux threads is an abomination too.) +** The consequence of this all is that the hash table for the lockInfo +** structure has to include the process id as part of its key because +** locks in different threads are treated as distinct. But the +** openCnt structure should not include the process id in its +** key because close() clears lock on all threads, not just the current +** thread. Were it not for this goofiness in linux threads, we could +** combine the lockInfo and openCnt structures into a single structure. */ /* ** An instance of the following structure serves as the key used -** to locate a particular lockInfo structure given its inode. +** to locate a particular lockInfo structure given its inode. Note +** that we have to include the process ID as part of the key. On some +** threading implementations (ex: linux), each thread has a separate +** process ID. */ -struct inodeKey { +struct lockKey { dev_t dev; /* Device number */ ino_t ino; /* Inode number */ + pid_t pid; /* Process ID */ }; /* -** An instance of the following structure is allocated for each inode. +** An instance of the following structure is allocated for each open +** inode on each thread with a different process ID. (Threads have +** different process IDs on linux, but not on most other unixes.) +** ** A single inode can have multiple file descriptors, so each OsFile ** structure contains a pointer to an instance of this object and this ** object keeps a count of the number of OsFiles pointing to it. */ struct lockInfo { - struct inodeKey key; /* The lookup key */ - int cnt; /* 0: unlocked. -1: write lock. 1...: read lock. */ + struct lockKey key; /* The lookup key */ + int cnt; /* 0: unlocked. -1: write lock. 1...: read lock. */ + int nRef; /* Number of pointers to this structure */ +}; + +/* +** An instance of the following structure serves as the key used +** to locate a particular openCnt structure given its inode. This +** is the same as the lockKey except that the process ID is omitted. +*/ +struct openKey { + dev_t dev; /* Device number */ + ino_t ino; /* Inode number */ +}; + +/* +** An instance of the following structure is allocated for each open +** inode. This structure keeps track of the number of locks on that +** inode. If a close is attempted against an inode that is holding +** locks, the close is deferred until all locks clear by adding the +** file descriptor to be closed to the pending list. +*/ +struct openCnt { + struct openKey key; /* The lookup key */ int nRef; /* Number of pointers to this structure */ + int nLock; /* Number of outstanding locks */ + int nPending; /* Number of pending close() operations */ + int *aPending; /* Malloced space holding fd's awaiting a close() */ }; /* -** This hash table maps inodes (in the form of inodeKey structures) into -** pointers to lockInfo structures. +** These hash table maps inodes and process IDs into lockInfo and openCnt +** structures. Access to these hash tables must be protected by a mutex. */ static Hash lockHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; +static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 }; /* -** Given a file descriptor, locate a lockInfo structure that describes -** that file descriptor. Create a new one if necessary. NULL might -** be returned if malloc() fails. +** Release a lockInfo structure previously allocated by findLockInfo(). */ -static struct lockInfo *findLockInfo(int fd){ +static void releaseLockInfo(struct lockInfo *pLock){ + pLock->nRef--; + if( pLock->nRef==0 ){ + sqliteHashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0); + sqliteFree(pLock); + } +} + +/* +** Release a openCnt structure previously allocated by findLockInfo(). +*/ +static void releaseOpenCnt(struct openCnt *pOpen){ + pOpen->nRef--; + if( pOpen->nRef==0 ){ + sqliteHashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0); + sqliteFree(pOpen->aPending); + sqliteFree(pOpen); + } +} + +/* +** Given a file descriptor, locate lockInfo and openCnt structures that +** describes that file descriptor. Create a new ones if necessary. The +** return values might be unset if an error occurs. +** +** Return the number of errors. +*/ +int findLockInfo( + int fd, /* The file descriptor used in the key */ + struct lockInfo **ppLock, /* Return the lockInfo structure here */ + struct openCnt **ppOpen /* Return the openCnt structure here */ +){ int rc; - struct inodeKey key; + struct lockKey key1; + struct openKey key2; struct stat statbuf; - struct lockInfo *pInfo; + struct lockInfo *pLock; + struct openCnt *pOpen; rc = fstat(fd, &statbuf); - if( rc!=0 ) return 0; - memset(&key, 0, sizeof(key)); - key.dev = statbuf.st_dev; - key.ino = statbuf.st_ino; - pInfo = (struct lockInfo*)sqliteHashFind(&lockHash, &key, sizeof(key)); - if( pInfo==0 ){ + if( rc!=0 ) return 1; + memset(&key1, 0, sizeof(key1)); + key1.dev = statbuf.st_dev; + key1.ino = statbuf.st_ino; + key1.pid = getpid(); + memset(&key2, 0, sizeof(key2)); + key2.dev = statbuf.st_dev; + key2.ino = statbuf.st_ino; + pLock = (struct lockInfo*)sqliteHashFind(&lockHash, &key1, sizeof(key1)); + if( pLock==0 ){ struct lockInfo *pOld; - pInfo = sqliteMalloc( sizeof(*pInfo) ); - if( pInfo==0 ) return 0; - pInfo->key = key; - pInfo->nRef = 1; - pInfo->cnt = 0; - pOld = sqliteHashInsert(&lockHash, &pInfo->key, sizeof(key), pInfo); + pLock = sqliteMallocRaw( sizeof(*pLock) ); + if( pLock==0 ) return 1; + pLock->key = key1; + pLock->nRef = 1; + pLock->cnt = 0; + pOld = sqliteHashInsert(&lockHash, &pLock->key, sizeof(key1), pLock); if( pOld!=0 ){ - assert( pOld==pInfo ); - sqliteFree(pInfo); - pInfo = 0; + assert( pOld==pLock ); + sqliteFree(pLock); + return 1; } }else{ - pInfo->nRef++; + pLock->nRef++; } - return pInfo; -} - -/* -** Release a lockInfo structure previously allocated by findLockInfo(). -*/ -static void releaseLockInfo(struct lockInfo *pInfo){ - pInfo->nRef--; - if( pInfo->nRef==0 ){ - sqliteHashInsert(&lockHash, &pInfo->key, sizeof(pInfo->key), 0); - sqliteFree(pInfo); + *ppLock = pLock; + pOpen = (struct openCnt*)sqliteHashFind(&openHash, &key2, sizeof(key2)); + if( pOpen==0 ){ + struct openCnt *pOld; + pOpen = sqliteMallocRaw( sizeof(*pOpen) ); + if( pOpen==0 ){ + releaseLockInfo(pLock); + return 1; + } + pOpen->key = key2; + pOpen->nRef = 1; + pOpen->nLock = 0; + pOpen->nPending = 0; + pOpen->aPending = 0; + pOld = sqliteHashInsert(&openHash, &pOpen->key, sizeof(key2), pOpen); + if( pOld!=0 ){ + assert( pOld==pOpen ); + sqliteFree(pOpen); + releaseLockInfo(pLock); + return 1; + } + }else{ + pOpen->nRef++; } + *ppOpen = pOpen; + return 0; } + #endif /** POSIX advisory lock work-around **/ /* @@ -326,6 +460,8 @@ int sqliteOsOpenReadWrite( int *pReadonly ){ #if OS_UNIX + int rc; + id->dirfd = -1; id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644); if( id->fd<0 ){ id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); @@ -337,9 +473,9 @@ int sqliteOsOpenReadWrite( *pReadonly = 0; } sqliteOsEnterMutex(); - id->pLock = findLockInfo(id->fd); + rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); sqliteOsLeaveMutex(); - if( id->pLock==0 ){ + if( rc ){ close(id->fd); return SQLITE_NOMEM; } @@ -447,18 +583,20 @@ int sqliteOsOpenReadWrite( */ int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ #if OS_UNIX + int rc; if( access(zFilename, 0)==0 ){ return SQLITE_CANTOPEN; } + id->dirfd = -1; id->fd = open(zFilename, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY, 0600); if( id->fd<0 ){ return SQLITE_CANTOPEN; } sqliteOsEnterMutex(); - id->pLock = findLockInfo(id->fd); + rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); sqliteOsLeaveMutex(); - if( id->pLock==0 ){ + if( rc ){ close(id->fd); unlink(zFilename); return SQLITE_NOMEM; @@ -536,14 +674,16 @@ int sqliteOsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){ */ int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){ #if OS_UNIX + int rc; + id->dirfd = -1; id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY); if( id->fd<0 ){ return SQLITE_CANTOPEN; } sqliteOsEnterMutex(); - id->pLock = findLockInfo(id->fd); + rc = findLockInfo(id->fd, &id->pLock, &id->pOpen); sqliteOsLeaveMutex(); - if( id->pLock==0 ){ + if( rc ){ close(id->fd); return SQLITE_NOMEM; } @@ -598,6 +738,42 @@ int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){ } /* +** Attempt to open a file descriptor for the directory that contains a +** file. This file descriptor can be used to fsync() the directory +** in order to make sure the creation of a new file is actually written +** to disk. +** +** This routine is only meaningful for Unix. It is a no-op under +** windows since windows does not support hard links. +** +** On success, a handle for a previously open file is at *id is +** updated with the new directory file descriptor and SQLITE_OK is +** returned. +** +** On failure, the function returns SQLITE_CANTOPEN and leaves +** *id unchanged. +*/ +int sqliteOsOpenDirectory( + const char *zDirname, + OsFile *id +){ +#if OS_UNIX + if( id->fd<0 ){ + /* Do not open the directory if the corresponding file is not already + ** open. */ + return SQLITE_CANTOPEN; + } + assert( id->dirfd<0 ); + id->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0644); + if( id->dirfd<0 ){ + return SQLITE_CANTOPEN; + } + TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname); +#endif + return SQLITE_OK; +} + +/* ** Create a temporary file name in zBuf. zBuf must be big enough to ** hold at least SQLITE_TEMPNAME_SIZE characters. */ @@ -647,7 +823,7 @@ int sqliteOsTempFileName(char *zBuf){ sprintf(zBuf, "%s\\"TEMP_FILE_PREFIX, zTempPath); j = strlen(zBuf); for(i=0; i<15; i++){ - int n = sqliteRandomByte() % sizeof(zChars); + int n = sqliteRandomByte() % (sizeof(zChars) - 1); zBuf[j++] = zChars[n]; } zBuf[j] = 0; @@ -701,13 +877,36 @@ int sqliteOsTempFileName(char *zBuf){ } /* -** Close a file +** Close a file. */ int sqliteOsClose(OsFile *id){ #if OS_UNIX - close(id->fd); + sqliteOsUnlock(id); + if( id->dirfd>=0 ) close(id->dirfd); + id->dirfd = -1; sqliteOsEnterMutex(); + if( id->pOpen->nLock ){ + /* If there are outstanding locks, do not actually close the file just + ** yet because that would clear those locks. Instead, add the file + ** descriptor to pOpen->aPending. It will be automatically closed when + ** the last lock is cleared. + */ + int *aNew; + struct openCnt *pOpen = id->pOpen; + pOpen->nPending++; + aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) ); + if( aNew==0 ){ + /* If a malloc fails, just leak the file descriptor */ + }else{ + pOpen->aPending = aNew; + pOpen->aPending[pOpen->nPending-1] = id->fd; + } + }else{ + /* There are no outstanding locks so we can close the file immediately */ + close(id->fd); + } releaseLockInfo(id->pLock); + releaseOpenCnt(id->pOpen); sqliteOsLeaveMutex(); TRACE2("CLOSE %-3d\n", id->fd); OpenCounter(-1); @@ -892,6 +1091,14 @@ int sqliteOsSeek(OsFile *id, off_t offset){ /* ** Make sure all writes to a particular file are committed to disk. +** +** Under Unix, also make sure that the directory entry for the file +** has been created by fsync-ing the directory that contains the file. +** If we do not do this and we encounter a power failure, the directory +** entry for the journal might not exist after we reboot. The next +** SQLite to access the file will not know that the journal exists (because +** the directory entry for the journal was never created) and the transaction +** will not roll back - possibly leading to database corruption. */ int sqliteOsSync(OsFile *id){ #if OS_UNIX @@ -900,6 +1107,12 @@ int sqliteOsSync(OsFile *id){ if( fsync(id->fd) ){ return SQLITE_IOERR; }else{ + if( id->dirfd>=0 ){ + TRACE2("DIRSYNC %-3d\n", id->dirfd); + fsync(id->dirfd); + close(id->dirfd); /* Only need to sync once, so close the directory */ + id->dirfd = -1; /* when we are done. */ + } return SQLITE_OK; } #endif @@ -1081,6 +1294,7 @@ int sqliteOsReadLock(OsFile *id){ if( !id->locked ){ id->pLock->cnt++; id->locked = 1; + id->pOpen->nLock++; } rc = SQLITE_OK; }else if( id->locked || id->pLock->cnt==0 ){ @@ -1094,8 +1308,11 @@ int sqliteOsReadLock(OsFile *id){ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; }else{ rc = SQLITE_OK; + if( !id->locked ){ + id->pOpen->nLock++; + id->locked = 1; + } id->pLock->cnt = 1; - id->locked = 1; } }else{ rc = SQLITE_BUSY; @@ -1198,8 +1415,11 @@ int sqliteOsWriteLock(OsFile *id){ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY; }else{ rc = SQLITE_OK; + if( !id->locked ){ + id->pOpen->nLock++; + id->locked = 1; + } id->pLock->cnt = -1; - id->locked = 1; } }else{ rc = SQLITE_BUSY; @@ -1313,6 +1533,24 @@ int sqliteOsUnlock(OsFile *id){ id->pLock->cnt = 0; } } + if( rc==SQLITE_OK ){ + /* Decrement the count of locks against this same file. When the + ** count reaches zero, close any other file descriptors whose close + ** was deferred because of outstanding locks. + */ + struct openCnt *pOpen = id->pOpen; + pOpen->nLock--; + assert( pOpen->nLock>=0 ); + if( pOpen->nLock==0 && pOpen->nPending>0 ){ + int i; + for(i=0; i<pOpen->nPending; i++){ + close(pOpen->aPending[i]); + } + sqliteFree(pOpen->aPending); + pOpen->nPending = 0; + pOpen->aPending = 0; + } + } sqliteOsLeaveMutex(); id->locked = 0; return rc; @@ -1363,26 +1601,37 @@ int sqliteOsUnlock(OsFile *id){ ** supply a sufficiently large buffer. */ int sqliteOsRandomSeed(char *zBuf){ -#ifdef SQLITE_TEST - /* When testing, always use the same random number sequence. - ** This makes the tests repeatable. + /* We have to initialize zBuf to prevent valgrind from reporting + ** errors. The reports issued by valgrind are incorrect - we would + ** prefer that the randomness be increased by making use of the + ** uninitialized space in zBuf - but valgrind errors tend to worry + ** some users. Rather than argue, it seems easier just to initialize + ** the whole array and silence valgrind, even if that means less randomness + ** in the random seed. + ** + ** When testing, initializing zBuf[] to zero is all we do. That means + ** that we always use the same random number sequence.* This makes the + ** tests repeatable. */ memset(zBuf, 0, 256); -#endif #if OS_UNIX && !defined(SQLITE_TEST) - int pid; - time((time_t*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); + { + int pid; + time((time_t*)zBuf); + pid = getpid(); + memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid)); + } #endif #if OS_WIN && !defined(SQLITE_TEST) GetSystemTime((LPSYSTEMTIME)zBuf); #endif #if OS_MAC - int pid; - Microseconds((UnsignedWide*)zBuf); - pid = getpid(); - memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid)); + { + int pid; + Microseconds((UnsignedWide*)zBuf); + pid = getpid(); + memcpy(&zBuf[sizeof(UnsignedWide)], &pid, sizeof(pid)); + } #endif return SQLITE_OK; } @@ -1413,24 +1662,6 @@ int sqliteOsSleep(int ms){ } /* -** Macros used to determine whether or not to use threads. The -** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for -** Posix threads and SQLITE_W32_THREADS is defined if we are -** synchronizing using Win32 threads. -*/ -#if OS_UNIX && defined(THREADSAFE) && THREADSAFE -# include <pthread.h> -# define SQLITE_UNIX_THREADS 1 -#endif -#if OS_WIN && defined(THREADSAFE) && THREADSAFE -# define SQLITE_W32_THREADS 1 -#endif -#if OS_MAC && defined(THREADSAFE) && THREADSAFE -# include <Multiprocessing.h> -# define SQLITE_MACOS_MULTITASKING 1 -#endif - -/* ** Static variables used for thread synchronization */ static int inMutex = 0; @@ -1509,10 +1740,11 @@ char *sqliteOsFullPathname(const char *zRelative){ #if OS_UNIX char *zFull = 0; if( zRelative[0]=='/' ){ - sqliteSetString(&zFull, zRelative, 0); + sqliteSetString(&zFull, zRelative, (char*)0); }else{ char zBuf[5000]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, 0); + sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, + (char*)0); } return zFull; #endif @@ -1530,15 +1762,53 @@ char *sqliteOsFullPathname(const char *zRelative){ char *zFull = 0; if( zRelative[0]==':' ){ char zBuf[_MAX_PATH+1]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), 0); + sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), + (char*)0); }else{ if( strchr(zRelative, ':') ){ - sqliteSetString(&zFull, zRelative, 0); + sqliteSetString(&zFull, zRelative, (char*)0); }else{ char zBuf[_MAX_PATH+1]; - sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, 0); + sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0); } } return zFull; #endif } + +/* +** The following variable, if set to a now-zero value, become the result +** returned from sqliteOsCurrentTime(). This is used for testing. +*/ +#ifdef SQLITE_TEST +int sqlite_current_time = 0; +#endif + +/* +** Find the current time (in Universal Coordinated Time). Write the +** current time and date as a Julian Day number into *prNow and +** return 0. Return 1 if the time and date cannot be found. +*/ +int sqliteOsCurrentTime(double *prNow){ +#if OS_UNIX + time_t t; + time(&t); + *prNow = t/86400.0 + 2440587.5; +#endif +#if OS_WIN + FILETIME ft; + /* FILETIME structure is a 64-bit value representing the number of + 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). + */ + double now; + GetSystemTimeAsFileTime( &ft ); + now = ((double)ft.dwHighDateTime) * 4294967296.0; + *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5; +#endif +#ifdef SQLITE_TEST + if( sqlite_current_time ){ + *prNow = sqlite_current_time/86400.0 + 2440587.5; + } +#endif + return 0; +} diff --git a/ext/sqlite/libsqlite/src/os.h b/ext/sqlite/libsqlite/src/os.h index d7674267d7..681f831b66 100644 --- a/ext/sqlite/libsqlite/src/os.h +++ b/ext/sqlite/libsqlite/src/os.h @@ -88,7 +88,9 @@ # endif #else # define OS_MAC 0 -# define OS_WIN 0 +# ifndef OS_WIN +# define OS_WIN 0 +# endif #endif /* @@ -101,9 +103,11 @@ # include <unistd.h> typedef struct OsFile OsFile; struct OsFile { - struct lockInfo *pLock; /* Information about locks on this inode */ - int fd; /* The file descriptor */ - int locked; /* True if this user holds the lock */ + struct openCnt *pOpen; /* Info about all open fd's on this inode */ + struct lockInfo *pLock; /* Info about locks on this inode */ + int fd; /* The file descriptor */ + int locked; /* True if this instance holds the lock */ + int dirfd; /* File descriptor for the directory */ }; # define SQLITE_TEMPNAME_SIZE 200 # if defined(HAVE_USLEEP) && HAVE_USLEEP @@ -114,6 +118,9 @@ #endif #if OS_WIN +# if defined(__CYGWIN__) +# define __CYGWIN_USE_BIG_TYPES__ +# endif #include <windows.h> #include <winbase.h> typedef struct OsFile OsFile; @@ -124,7 +131,12 @@ # if defined(_MSC_VER) || defined(__BORLANDC__) typedef __int64 off_t; # else - typedef long long off_t; +# if !defined(_CYGWIN_TYPES_H) + typedef long long off_t; +# if defined(__MINGW32__) +# define _OFF_T_ +# endif +# endif # endif # define SQLITE_TEMPNAME_SIZE (MAX_PATH+50) # define SQLITE_MIN_SLEEP_MS 1 @@ -156,6 +168,7 @@ int sqliteOsFileRename(const char*, const char*); int sqliteOsOpenReadWrite(const char*, OsFile*, int*); int sqliteOsOpenExclusive(const char*, OsFile*, int); int sqliteOsOpenReadOnly(const char*, OsFile*); +int sqliteOsOpenDirectory(const char*, OsFile*); int sqliteOsTempFileName(char*); int sqliteOsClose(OsFile*); int sqliteOsRead(OsFile*, void*, int amt); @@ -169,6 +182,7 @@ int sqliteOsWriteLock(OsFile*); int sqliteOsUnlock(OsFile*); int sqliteOsRandomSeed(char*); int sqliteOsSleep(int ms); +int sqliteOsCurrentTime(double*); void sqliteOsEnterMutex(void); void sqliteOsLeaveMutex(void); char *sqliteOsFullPathname(const char*); diff --git a/ext/sqlite/libsqlite/src/pager.c b/ext/sqlite/libsqlite/src/pager.c index 4e9d0c9059..f593862104 100644 --- a/ext/sqlite/libsqlite/src/pager.c +++ b/ext/sqlite/libsqlite/src/pager.c @@ -129,6 +129,7 @@ struct PgHdr { struct Pager { char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ + char *zDirectory; /* Directory hold database and journal files */ OsFile fd, jfd; /* File descriptors for database and journal */ OsFile cpfd; /* File descriptor for the checkpoint journal */ int dbSize; /* Number of pages in the file */ @@ -315,7 +316,7 @@ static int write32bits(OsFile *fd, u32 val){ */ static void store32bits(u32 val, PgHdr *p, int offset){ unsigned char *ac; - ac = &((char*)PGHDR_TO_DATA(p))[offset]; + ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset]; if( journal_format<=1 ){ memcpy(ac, &val, 4); }else{ @@ -425,6 +426,10 @@ static void pager_reset(Pager *pPager){ ** a write lock on the database. This routine releases the database ** write lock and acquires a read lock in its place. The journal file ** is deleted and closed. +** +** TODO: Consider keeping the journal file open for temporary databases. +** This might give a performance improvement on windows where opening +** a file is an expensive operation. */ static int pager_unwritelock(Pager *pPager){ int rc; @@ -515,19 +520,13 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int format){ sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE); rc = sqliteOsWrite(&pPager->fd, pgRec.aData, SQLITE_PAGE_SIZE); if( pPg ){ - if( pPg->nRef==0 || - memcmp(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE)==0 - ){ - /* Do not update the data on this page if the page is in use - ** and the page has never been modified. This avoids resetting - ** the "extra" data. That in turn avoids invalidating BTree cursors - ** in trees that have never been modified. The end result is that - ** you can have a SELECT going on in one table and ROLLBACK changes - ** to a different table and the SELECT is unaffected by the ROLLBACK. - */ - memcpy(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE); - memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); - } + /* No page should ever be rolled back that is in use, except for page + ** 1 which is held in use in order to keep the lock on the database + ** active. + */ + assert( pPg->nRef==0 || pPg->pgno==1 ); + memcpy(PGHDR_TO_DATA(pPg), pgRec.aData, SQLITE_PAGE_SIZE); + memset(PGHDR_TO_EXTRA(pPg), 0, pPager->nExtra); pPg->dirty = 0; pPg->needSync = 0; } @@ -595,7 +594,7 @@ static int pager_playback(Pager *pPager, int useJournalSize){ goto end_playback; } if( format>=JOURNAL_FORMAT_3 ){ - rc = read32bits(format, &pPager->jfd, &nRec); + rc = read32bits(format, &pPager->jfd, (u32*)&nRec); if( rc ) goto end_playback; rc = read32bits(format, &pPager->jfd, &pPager->cksumInit); if( rc ) goto end_playback; @@ -828,7 +827,7 @@ int sqlitepager_open( char *zFullPathname; int nameLen; OsFile fd; - int rc; + int rc, i; int tempFile; int readOnly = 0; char zTemp[SQLITE_TEMPNAME_SIZE]; @@ -837,7 +836,7 @@ int sqlitepager_open( if( sqlite_malloc_failed ){ return SQLITE_NOMEM; } - if( zFilename ){ + if( zFilename && zFilename[0] ){ zFullPathname = sqliteOsFullPathname(zFilename); rc = sqliteOsOpenReadWrite(zFullPathname, &fd, &readOnly); tempFile = 0; @@ -855,7 +854,7 @@ int sqlitepager_open( return SQLITE_CANTOPEN; } nameLen = strlen(zFullPathname); - pPager = sqliteMalloc( sizeof(*pPager) + nameLen*2 + 30 ); + pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 ); if( pPager==0 ){ sqliteOsClose(&fd); sqliteFree(zFullPathname); @@ -863,8 +862,12 @@ int sqlitepager_open( } SET_PAGER(pPager); pPager->zFilename = (char*)&pPager[1]; - pPager->zJournal = &pPager->zFilename[nameLen+1]; + pPager->zDirectory = &pPager->zFilename[nameLen+1]; + pPager->zJournal = &pPager->zDirectory[nameLen+1]; strcpy(pPager->zFilename, zFullPathname); + strcpy(pPager->zDirectory, zFullPathname); + for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){} + if( i>0 ) pPager->zDirectory[i-1] = 0; strcpy(pPager->zJournal, zFullPathname); sqliteFree(zFullPathname); strcpy(&pPager->zJournal[nameLen], "-journal"); @@ -995,8 +998,10 @@ int sqlitepager_close(Pager *pPager){ */ CLR_PAGER(pPager); if( pPager->zFilename!=(char*)&pPager[1] ){ + assert( 0 ); /* Cannot happen */ sqliteFree(pPager->zFilename); sqliteFree(pPager->zJournal); + sqliteFree(pPager->zDirectory); } sqliteFree(pPager); return SQLITE_OK; @@ -1221,7 +1226,7 @@ int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){ /* If a journal file exists, try to play it back. */ if( pPager->useJournal && sqliteOsFileExists(pPager->zJournal) ){ - int rc, dummy; + int rc; /* Get a write lock on the database */ @@ -1235,14 +1240,15 @@ int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){ } pPager->state = SQLITE_WRITELOCK; - /* Open the journal for exclusive access. Return SQLITE_BUSY if - ** we cannot get exclusive access to the journal file. + /* Open the journal for reading only. Return SQLITE_BUSY if + ** we are unable to open the journal file. ** - ** Even though we will only be reading from the journal, not writing, - ** we have to open the journal for writing in order to obtain an - ** exclusive access lock. + ** The journal file does not need to be locked itself. The + ** journal file is never open unless the main database file holds + ** a write lock, so there is never any chance of two or more + ** processes opening the journal at the same time. */ - rc = sqliteOsOpenReadWrite(pPager->zJournal, &pPager->jfd, &dummy); + rc = sqliteOsOpenReadOnly(pPager->zJournal, &pPager->jfd); if( rc!=SQLITE_OK ){ rc = sqliteOsUnlock(&pPager->fd); assert( rc==SQLITE_OK ); @@ -1519,6 +1525,7 @@ static int pager_open_journal(Pager *pPager){ assert( pPager->state==SQLITE_WRITELOCK ); assert( pPager->journalOpen==0 ); assert( pPager->useJournal ); + sqlitepager_pagecount(pPager); pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 ); if( pPager->aInJournal==0 ){ sqliteOsReadLock(&pPager->fd); @@ -1533,12 +1540,12 @@ static int pager_open_journal(Pager *pPager){ pPager->state = SQLITE_READLOCK; return SQLITE_CANTOPEN; } + sqliteOsOpenDirectory(pPager->zDirectory, &pPager->jfd); pPager->journalOpen = 1; pPager->journalStarted = 0; pPager->needSync = 0; pPager->alwaysRollback = 0; pPager->nRec = 0; - sqlitepager_pagecount(pPager); if( pPager->errMask!=0 ){ rc = pager_errcode(pPager); return rc; diff --git a/ext/sqlite/libsqlite/src/parse.c b/ext/sqlite/libsqlite/src/parse.c index 6f5702d7f9..7c193ccc76 100644 --- a/ext/sqlite/libsqlite/src/parse.c +++ b/ext/sqlite/libsqlite/src/parse.c @@ -1,11 +1,10 @@ - /* Driver template for the LEMON parser generator. -** The author disclaims copyright to this source code. +** The author disclaims copyright to this source code. */ /* First off, code is include which follows the "include" declaration ** in the input file. */ #include <stdio.h> -#line 35 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 35 "parse.y" #include "sqliteInt.h" #include "parse.h" @@ -31,7 +30,7 @@ struct LimitVal { struct TrigEvent { int a; IdList * b; }; -#line 34 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 34 "parse.c" /* Next is all token values, in a form suitable for use by makeheaders. ** This section will be null unless lemon is run with the -m switch. */ @@ -114,3646 +113,555 @@ typedef union { #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) -/* Next is the action table. Each entry in this table contains + +/* Next are that tables used to determine what action to take based on the +** current state and lookahead token. These tables are used to implement +** functions that take a state number and lookahead value and return an +** action integer. ** -** + An integer which is the number representing the look-ahead -** token +** Suppose the action integer is N. Then the action is determined as +** follows ** -** + An integer indicating what action to take. Number (N) between -** 0 and YYNSTATE-1 mean shift the look-ahead and go to state N. -** Numbers between YYNSTATE and YYNSTATE+YYNRULE-1 mean reduce by -** rule N-YYNSTATE. Number YYNSTATE+YYNRULE means that a syntax -** error has occurred. Number YYNSTATE+YYNRULE+1 means the parser -** accepts its input. +** 0 <= N < YYNSTATE Shift N. That is, push the lookahead +** token onto the stack and goto state N. ** -** + A pointer to the next entry with the same hash value. +** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. ** -** The action table is really a series of hash tables. Each hash -** table contains a number of entries which is a power of two. The -** "state" table (which follows) contains information about the starting -** point and size of each hash table. -*/ -struct yyActionEntry { - YYCODETYPE lookahead; /* The value of the look-ahead token */ - YYCODETYPE next; /* Next entry + 1. Zero at end of collision chain */ - YYACTIONTYPE action; /* Action to take for this look-ahead */ -}; -typedef struct yyActionEntry yyActionEntry; -static const yyActionEntry yyActionTable[] = { -/* State 0 */ - { 156, 0, 3}, /* 1: explain shift 3 */ - { 139, 0, 1}, /* 2: cmdlist shift 1 */ - { 170, 0, 843}, /* 3: input accept */ - { 47, 0, 553}, /* 4: EXPLAIN shift 553 */ - { 154, 0, 554}, /* 5: ecmd shift 554 */ - { 107, 4, 552}, /* 6: SEMI shift 552 */ -/* State 1 */ - { 0, 0, 555}, /* 1: $ reduce 0 */ - { 156, 0, 3}, /* 2: explain shift 3 */ - { 107, 4, 552}, /* 3: SEMI shift 552 */ - { 47, 0, 553}, /* 4: EXPLAIN shift 553 */ - { 154, 0, 2}, /* 5: ecmd shift 2 */ -/* State 3 */ - { 66, 0, 512}, /* 1: INSERT shift 512 */ - { 28, 0, 515}, /* 2: COPY shift 515 */ - { 24, 0, 23}, /* 3: COMMIT shift 23 */ - { 29, 0, 388}, /* 4: CREATE shift 388 */ - { 8, 0, 543}, /* 5: ATTACH shift 543 */ - { 34, 0, 490}, /* 6: DELETE shift 490 */ - { 138, 2, 6}, /* 7: cmd shift 6 */ - { 95, 4, 526}, /* 8: PRAGMA shift 526 */ - { 140, 5, 4}, /* 9: cmdx shift 4 */ - { 185, 0, 69}, /* 10: oneselect shift 69 */ - { 10, 0, 7}, /* 11: BEGIN shift 7 */ - { 37, 0, 549}, /* 12: DETACH shift 549 */ - { 100, 6, 514}, /* 13: REPLACE shift 514 */ - { 123, 0, 495}, /* 14: UPDATE shift 495 */ - { 102, 0, 27}, /* 15: ROLLBACK shift 27 */ - { 147, 12, 29}, /* 16: create_table shift 29 */ - { 126, 0, 524}, /* 17: VACUUM shift 524 */ - { 40, 0, 478}, /* 18: DROP shift 478 */ - { 106, 18, 73}, /* 19: SELECT shift 73 */ - { 173, 0, 502}, /* 20: insert_cmd shift 502 */ - { 196, 0, 489}, /* 21: select shift 489 */ - { 43, 0, 25}, /* 22: END shift 25 */ -/* State 4 */ - { 107, 0, 5}, /* 1: SEMI shift 5 */ -/* State 6 */ - { 107, 0, 560}, /* 1: SEMI reduce 5 */ -/* State 7 */ - { 206, 0, 8}, /* 1: trans_opt shift 8 */ - { 117, 0, 18}, /* 2: TRANSACTION shift 18 */ -/* State 8 */ - { 90, 0, 10}, /* 1: ON shift 10 */ - { 184, 0, 9}, /* 2: onconf shift 9 */ - { 107, 0, 643}, /* 3: SEMI reduce 88 */ -/* State 9 */ - { 107, 0, 563}, /* 1: SEMI reduce 8 */ -/* State 10 */ - { 26, 0, 11}, /* 1: CONFLICT shift 11 */ -/* State 11 */ - { 102, 3, 13}, /* 1: ROLLBACK shift 13 */ - { 193, 4, 12}, /* 2: resolvetype shift 12 */ - { 60, 6, 16}, /* 3: IGNORE shift 16 */ - { 1, 0, 14}, /* 4: ABORT shift 14 */ - { 100, 0, 17}, /* 5: REPLACE shift 17 */ - { 48, 0, 15}, /* 6: FAIL shift 15 */ -/* State 18 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 19}, /* 2: nm shift 19 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 23 */ - { 117, 0, 18}, /* 1: TRANSACTION shift 18 */ - { 107, 0, 564}, /* 2: SEMI reduce 9 */ - { 206, 2, 24}, /* 3: trans_opt shift 24 */ -/* State 24 */ - { 107, 0, 567}, /* 1: SEMI reduce 12 */ -/* State 25 */ - { 117, 0, 18}, /* 1: TRANSACTION shift 18 */ - { 107, 0, 564}, /* 2: SEMI reduce 9 */ - { 206, 2, 26}, /* 3: trans_opt shift 26 */ -/* State 26 */ - { 107, 0, 568}, /* 1: SEMI reduce 13 */ -/* State 27 */ - { 117, 0, 18}, /* 1: TRANSACTION shift 18 */ - { 107, 0, 564}, /* 2: SEMI reduce 9 */ - { 206, 2, 28}, /* 3: trans_opt shift 28 */ -/* State 28 */ - { 107, 0, 569}, /* 1: SEMI reduce 14 */ -/* State 29 */ - { 6, 0, 386}, /* 1: AS shift 386 */ - { 148, 3, 30}, /* 2: create_table_args shift 30 */ - { 79, 0, 31}, /* 3: LP shift 31 */ -/* State 30 */ - { 107, 0, 570}, /* 1: SEMI reduce 15 */ -/* State 31 */ - { 59, 0, 20}, /* 1: ID shift 20 */ - { 113, 0, 21}, /* 2: STRING shift 21 */ - { 142, 0, 385}, /* 3: column shift 385 */ - { 143, 1, 37}, /* 4: columnid shift 37 */ - { 144, 6, 32}, /* 5: columnlist shift 32 */ - { 74, 0, 22}, /* 6: JOIN_KW shift 22 */ - { 181, 0, 351}, /* 7: nm shift 351 */ -/* State 32 */ - { 104, 0, 631}, /* 1: RP reduce 76 */ - { 22, 0, 35}, /* 2: COMMA shift 35 */ - { 146, 1, 33}, /* 3: conslist_opt shift 33 */ -/* State 33 */ - { 104, 0, 34}, /* 1: RP shift 34 */ -/* State 34 */ - { 107, 0, 574}, /* 1: SEMI reduce 19 */ -/* State 35 */ - { 143, 0, 37}, /* 1: columnid shift 37 */ - { 27, 0, 355}, /* 2: CONSTRAINT shift 355 */ - { 145, 0, 352}, /* 3: conslist shift 352 */ - { 96, 5, 357}, /* 4: PRIMARY shift 357 */ - { 18, 0, 368}, /* 5: CHECK shift 368 */ - { 122, 4, 363}, /* 6: UNIQUE shift 363 */ - { 113, 9, 21}, /* 7: STRING shift 21 */ - { 59, 0, 20}, /* 8: ID shift 20 */ - { 74, 0, 22}, /* 9: JOIN_KW shift 22 */ - { 204, 7, 384}, /* 10: tcons shift 384 */ - { 142, 12, 36}, /* 11: column shift 36 */ - { 51, 0, 371}, /* 12: FOREIGN shift 371 */ - { 181, 11, 351}, /* 13: nm shift 351 */ -/* State 37 */ - { 165, 0, 350}, /* 1: ids shift 350 */ - { 113, 0, 252}, /* 2: STRING shift 252 */ - { 212, 0, 38}, /* 3: type shift 38 */ - { 213, 2, 337}, /* 4: typename shift 337 */ - { 59, 0, 251}, /* 5: ID shift 251 */ -/* State 38 */ - { 133, 0, 39}, /* 1: carglist shift 39 */ -/* State 39 */ - { 96, 4, 54}, /* 1: PRIMARY shift 54 */ - { 27, 0, 41}, /* 2: CONSTRAINT shift 41 */ - { 132, 0, 40}, /* 3: carg shift 40 */ - { 31, 5, 325}, /* 4: DEFAULT shift 325 */ - { 18, 0, 62}, /* 5: CHECK shift 62 */ - { 122, 1, 60}, /* 6: UNIQUE shift 60 */ - { 32, 0, 322}, /* 7: DEFERRABLE shift 322 */ - { 137, 11, 324}, /* 8: ccons shift 324 */ - { 151, 0, 319}, /* 9: defer_subclause shift 319 */ - { 87, 0, 44}, /* 10: NULL shift 44 */ - { 98, 12, 297}, /* 11: REFERENCES shift 297 */ - { 85, 13, 46}, /* 12: NOT shift 46 */ - { 20, 0, 320}, /* 13: COLLATE shift 320 */ -/* State 41 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 42}, /* 2: nm shift 42 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 42 */ - { 20, 0, 320}, /* 1: COLLATE shift 320 */ - { 151, 0, 319}, /* 2: defer_subclause shift 319 */ - { 122, 4, 60}, /* 3: UNIQUE shift 60 */ - { 32, 0, 322}, /* 4: DEFERRABLE shift 322 */ - { 87, 0, 44}, /* 5: NULL shift 44 */ - { 85, 0, 46}, /* 6: NOT shift 46 */ - { 96, 0, 54}, /* 7: PRIMARY shift 54 */ - { 137, 5, 43}, /* 8: ccons shift 43 */ - { 98, 10, 297}, /* 9: REFERENCES shift 297 */ - { 18, 0, 62}, /* 10: CHECK shift 62 */ -/* State 44 */ - { 184, 2, 45}, /* 1: onconf shift 45 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 46 */ - { 32, 0, 49}, /* 1: DEFERRABLE shift 49 */ - { 87, 0, 47}, /* 2: NULL shift 47 */ -/* State 47 */ - { 184, 2, 48}, /* 1: onconf shift 48 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 49 */ - { 65, 0, 51}, /* 1: INITIALLY shift 51 */ - { 169, 1, 50}, /* 2: init_deferred_pred_opt shift 50 */ -/* State 51 */ - { 62, 0, 53}, /* 1: IMMEDIATE shift 53 */ - { 33, 0, 52}, /* 2: DEFERRED shift 52 */ -/* State 54 */ - { 75, 0, 55}, /* 1: KEY shift 55 */ -/* State 55 */ - { 36, 0, 59}, /* 1: DESC shift 59 */ - { 202, 3, 56}, /* 2: sortorder shift 56 */ - { 7, 0, 58}, /* 3: ASC shift 58 */ -/* State 56 */ - { 184, 2, 57}, /* 1: onconf shift 57 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 60 */ - { 184, 2, 61}, /* 1: onconf shift 61 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 62 */ - { 79, 0, 63}, /* 1: LP shift 63 */ -/* State 63 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 294}, /* 8: expr shift 294 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 64 */ - { 39, 0, 583}, /* 1: DOT reduce 28 */ - { 79, 1, 65}, /* 2: LP shift 65 */ -/* State 65 */ - { 59, 0, 64}, /* 1: ID shift 64 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 74, 0, 67}, /* 3: JOIN_KW shift 67 */ - { 111, 0, 292}, /* 4: STAR shift 292 */ - { 94, 0, 176}, /* 5: PLUS shift 176 */ - { 113, 1, 66}, /* 6: STRING shift 66 */ - { 79, 0, 68}, /* 7: LP shift 68 */ - { 97, 7, 188}, /* 8: RAISE shift 188 */ - { 85, 10, 170}, /* 9: NOT shift 170 */ - { 49, 11, 169}, /* 10: FLOAT shift 169 */ - { 13, 0, 172}, /* 11: BITNOT shift 172 */ - { 83, 0, 174}, /* 12: MINUS shift 174 */ - { 68, 0, 168}, /* 13: INTEGER shift 168 */ - { 157, 9, 167}, /* 14: expr shift 167 */ - { 158, 13, 214}, /* 15: expritem shift 214 */ - { 159, 17, 290}, /* 16: exprlist shift 290 */ - { 87, 0, 101}, /* 17: NULL shift 101 */ - { 17, 0, 178}, /* 18: CASE shift 178 */ -/* State 66 */ - { 39, 0, 584}, /* 1: DOT reduce 29 */ -/* State 67 */ - { 39, 0, 585}, /* 1: DOT reduce 30 */ -/* State 68 */ - { 113, 4, 66}, /* 1: STRING shift 66 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 74, 0, 67}, /* 3: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 4: ID shift 64 */ - { 94, 0, 176}, /* 5: PLUS shift 176 */ - { 185, 1, 69}, /* 6: oneselect shift 69 */ - { 79, 0, 68}, /* 7: LP shift 68 */ - { 97, 7, 188}, /* 8: RAISE shift 188 */ - { 85, 10, 170}, /* 9: NOT shift 170 */ - { 49, 11, 169}, /* 10: FLOAT shift 169 */ - { 13, 0, 172}, /* 11: BITNOT shift 172 */ - { 83, 0, 174}, /* 12: MINUS shift 174 */ - { 106, 0, 73}, /* 13: SELECT shift 73 */ - { 157, 9, 288}, /* 14: expr shift 288 */ - { 68, 0, 168}, /* 15: INTEGER shift 168 */ - { 87, 0, 101}, /* 16: NULL shift 101 */ - { 196, 13, 70}, /* 17: select shift 70 */ - { 17, 0, 178}, /* 18: CASE shift 178 */ -/* State 70 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 3, 162}, /* 2: UNION shift 162 */ - { 46, 0, 165}, /* 3: EXCEPT shift 165 */ - { 69, 0, 164}, /* 4: INTERSECT shift 164 */ - { 104, 4, 287}, /* 5: RP shift 287 */ -/* State 71 */ - { 106, 0, 73}, /* 1: SELECT shift 73 */ - { 185, 0, 72}, /* 2: oneselect shift 72 */ -/* State 73 */ - { 153, 0, 74}, /* 1: distinct shift 74 */ - { 4, 0, 286}, /* 2: ALL shift 286 */ - { 38, 0, 285}, /* 3: DISTINCT shift 285 */ -/* State 74 */ - { 194, 0, 278}, /* 1: sclp shift 278 */ - { 195, 0, 75}, /* 2: selcollist shift 75 */ -/* State 75 */ - { 22, 0, 236}, /* 1: COMMA shift 236 */ - { 52, 1, 237}, /* 2: FROM shift 237 */ - { 161, 0, 76}, /* 3: from shift 76 */ -/* State 76 */ - { 130, 0, 234}, /* 1: WHERE shift 234 */ - { 217, 0, 77}, /* 2: where_opt shift 77 */ -/* State 77 */ - { 162, 2, 78}, /* 1: groupby_opt shift 78 */ - { 56, 0, 231}, /* 2: GROUP shift 231 */ -/* State 78 */ - { 58, 0, 229}, /* 1: HAVING shift 229 */ - { 163, 0, 79}, /* 2: having_opt shift 79 */ -/* State 79 */ - { 93, 0, 88}, /* 1: ORDER shift 88 */ - { 187, 1, 80}, /* 2: orderby_opt shift 80 */ -/* State 80 */ - { 178, 2, 81}, /* 1: limit_opt shift 81 */ - { 78, 0, 82}, /* 2: LIMIT shift 82 */ -/* State 82 */ - { 68, 0, 83}, /* 1: INTEGER shift 83 */ -/* State 83 */ - { 22, 0, 86}, /* 1: COMMA shift 86 */ - { 89, 0, 84}, /* 2: OFFSET shift 84 */ -/* State 84 */ - { 68, 0, 85}, /* 1: INTEGER shift 85 */ -/* State 86 */ - { 68, 0, 87}, /* 1: INTEGER shift 87 */ -/* State 88 */ - { 15, 0, 89}, /* 1: BY shift 89 */ -/* State 89 */ - { 85, 2, 170}, /* 1: NOT shift 170 */ - { 68, 4, 168}, /* 2: INTEGER shift 168 */ - { 87, 0, 101}, /* 3: NULL shift 101 */ - { 17, 0, 178}, /* 4: CASE shift 178 */ - { 157, 0, 98}, /* 5: expr shift 98 */ - { 113, 8, 66}, /* 6: STRING shift 66 */ - { 74, 0, 67}, /* 7: JOIN_KW shift 67 */ - { 79, 0, 68}, /* 8: LP shift 68 */ - { 59, 0, 64}, /* 9: ID shift 64 */ - { 94, 0, 176}, /* 10: PLUS shift 176 */ - { 13, 0, 172}, /* 11: BITNOT shift 172 */ - { 181, 6, 102}, /* 12: nm shift 102 */ - { 97, 0, 188}, /* 13: RAISE shift 188 */ - { 200, 11, 226}, /* 14: sortitem shift 226 */ - { 201, 0, 90}, /* 15: sortlist shift 90 */ - { 83, 17, 174}, /* 16: MINUS shift 174 */ - { 49, 0, 169}, /* 17: FLOAT shift 169 */ -/* State 90 */ - { 22, 0, 91}, /* 1: COMMA shift 91 */ -/* State 91 */ - { 97, 3, 188}, /* 1: RAISE shift 188 */ - { 113, 1, 66}, /* 2: STRING shift 66 */ - { 49, 7, 169}, /* 3: FLOAT shift 169 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 68, 0, 168}, /* 5: INTEGER shift 168 */ - { 181, 10, 102}, /* 6: nm shift 102 */ - { 17, 0, 178}, /* 7: CASE shift 178 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 200, 0, 92}, /* 9: sortitem shift 92 */ - { 85, 0, 170}, /* 10: NOT shift 170 */ - { 74, 0, 67}, /* 11: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 13, 0, 172}, /* 13: BITNOT shift 172 */ - { 157, 13, 98}, /* 14: expr shift 98 */ - { 94, 0, 176}, /* 15: PLUS shift 176 */ - { 79, 0, 68}, /* 16: LP shift 68 */ -/* State 92 */ - { 20, 0, 95}, /* 1: COLLATE shift 95 */ - { 141, 0, 93}, /* 2: collate shift 93 */ -/* State 93 */ - { 36, 0, 59}, /* 1: DESC shift 59 */ - { 202, 3, 94}, /* 2: sortorder shift 94 */ - { 7, 0, 58}, /* 3: ASC shift 58 */ -/* State 95 */ - { 164, 0, 97}, /* 1: id shift 97 */ - { 59, 0, 96}, /* 2: ID shift 96 */ -/* State 98 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 100 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 107}, /* 8: expr shift 107 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 102 */ - { 39, 0, 103}, /* 1: DOT shift 103 */ -/* State 103 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 104}, /* 2: nm shift 104 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 104 */ - { 39, 0, 105}, /* 1: DOT shift 105 */ -/* State 105 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 106}, /* 2: nm shift 106 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 107 */ - { 54, 0, 116}, /* 1: GE shift 116 */ - { 105, 0, 128}, /* 2: RSHIFT shift 128 */ - { 80, 1, 126}, /* 3: LSHIFT shift 126 */ - { 81, 5, 110}, /* 4: LT shift 110 */ - { 55, 0, 136}, /* 5: GLOB shift 136 */ - { 109, 10, 143}, /* 6: SLASH shift 143 */ - { 84, 0, 118}, /* 7: NE shift 118 */ - { 111, 11, 141}, /* 8: STAR shift 141 */ - { 86, 0, 154}, /* 9: NOTNULL shift 154 */ - { 83, 14, 139}, /* 10: MINUS shift 139 */ - { 85, 0, 132}, /* 11: NOT shift 132 */ - { 63, 16, 159}, /* 12: IN shift 159 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 57, 0, 112}, /* 14: GT shift 112 */ - { 92, 18, 99}, /* 15: ORACLE_OUTER_JOIN shift 99 */ - { 11, 0, 155}, /* 16: BETWEEN shift 155 */ - { 94, 0, 137}, /* 17: PLUS shift 137 */ - { 14, 0, 124}, /* 18: BITOR shift 124 */ - { 45, 0, 120}, /* 19: EQ shift 120 */ - { 71, 19, 150}, /* 20: IS shift 150 */ - { 72, 0, 149}, /* 21: ISNULL shift 149 */ - { 177, 23, 130}, /* 22: likeop shift 130 */ - { 99, 0, 145}, /* 23: REM shift 145 */ - { 25, 0, 147}, /* 24: CONCAT shift 147 */ - { 76, 0, 114}, /* 25: LE shift 114 */ - { 77, 24, 135}, /* 26: LIKE shift 135 */ -/* State 108 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 109}, /* 8: expr shift 109 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 109 */ - { 81, 7, 110}, /* 1: LT shift 110 */ - { 109, 8, 143}, /* 2: SLASH shift 143 */ - { 83, 0, 139}, /* 3: MINUS shift 139 */ - { 111, 9, 141}, /* 4: STAR shift 141 */ - { 85, 0, 132}, /* 5: NOT shift 132 */ - { 86, 11, 154}, /* 6: NOTNULL shift 154 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 55, 0, 136}, /* 8: GLOB shift 136 */ - { 84, 17, 118}, /* 9: NE shift 118 */ - { 63, 0, 159}, /* 10: IN shift 159 */ - { 5, 0, 100}, /* 11: AND shift 100 */ - { 92, 20, 99}, /* 12: ORACLE_OUTER_JOIN shift 99 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 94, 0, 137}, /* 14: PLUS shift 137 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 177, 0, 130}, /* 16: likeop shift 130 */ - { 57, 0, 112}, /* 17: GT shift 112 */ - { 71, 0, 150}, /* 18: IS shift 150 */ - { 99, 21, 145}, /* 19: REM shift 145 */ - { 11, 0, 155}, /* 20: BETWEEN shift 155 */ - { 72, 22, 149}, /* 21: ISNULL shift 149 */ - { 45, 0, 120}, /* 22: EQ shift 120 */ - { 76, 0, 114}, /* 23: LE shift 114 */ - { 77, 0, 135}, /* 24: LIKE shift 135 */ - { 105, 0, 128}, /* 25: RSHIFT shift 128 */ - { 25, 0, 147}, /* 26: CONCAT shift 147 */ - { 80, 0, 126}, /* 27: LSHIFT shift 126 */ -/* State 110 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 111}, /* 8: expr shift 111 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 111 */ - { 12, 0, 122}, /* 1: BITAND shift 122 */ - { 109, 5, 143}, /* 2: SLASH shift 143 */ - { 14, 0, 124}, /* 3: BITOR shift 124 */ - { 111, 6, 141}, /* 4: STAR shift 141 */ - { 25, 0, 147}, /* 5: CONCAT shift 147 */ - { 99, 0, 145}, /* 6: REM shift 145 */ - { 80, 0, 126}, /* 7: LSHIFT shift 126 */ - { 105, 0, 128}, /* 8: RSHIFT shift 128 */ - { 92, 7, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 8, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 83, 0, 139}, /* 12: MINUS shift 139 */ -/* State 112 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 113}, /* 8: expr shift 113 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 113 */ - { 12, 0, 122}, /* 1: BITAND shift 122 */ - { 109, 5, 143}, /* 2: SLASH shift 143 */ - { 14, 0, 124}, /* 3: BITOR shift 124 */ - { 111, 6, 141}, /* 4: STAR shift 141 */ - { 25, 0, 147}, /* 5: CONCAT shift 147 */ - { 99, 0, 145}, /* 6: REM shift 145 */ - { 80, 0, 126}, /* 7: LSHIFT shift 126 */ - { 105, 0, 128}, /* 8: RSHIFT shift 128 */ - { 92, 7, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 8, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 83, 0, 139}, /* 12: MINUS shift 139 */ -/* State 114 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 115}, /* 8: expr shift 115 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 115 */ - { 12, 0, 122}, /* 1: BITAND shift 122 */ - { 109, 5, 143}, /* 2: SLASH shift 143 */ - { 14, 0, 124}, /* 3: BITOR shift 124 */ - { 111, 6, 141}, /* 4: STAR shift 141 */ - { 25, 0, 147}, /* 5: CONCAT shift 147 */ - { 99, 0, 145}, /* 6: REM shift 145 */ - { 80, 0, 126}, /* 7: LSHIFT shift 126 */ - { 105, 0, 128}, /* 8: RSHIFT shift 128 */ - { 92, 7, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 8, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 83, 0, 139}, /* 12: MINUS shift 139 */ -/* State 116 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 117}, /* 8: expr shift 117 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 117 */ - { 12, 0, 122}, /* 1: BITAND shift 122 */ - { 109, 5, 143}, /* 2: SLASH shift 143 */ - { 14, 0, 124}, /* 3: BITOR shift 124 */ - { 111, 6, 141}, /* 4: STAR shift 141 */ - { 25, 0, 147}, /* 5: CONCAT shift 147 */ - { 99, 0, 145}, /* 6: REM shift 145 */ - { 80, 0, 126}, /* 7: LSHIFT shift 126 */ - { 105, 0, 128}, /* 8: RSHIFT shift 128 */ - { 92, 7, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 8, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 83, 0, 139}, /* 12: MINUS shift 139 */ -/* State 118 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 119}, /* 8: expr shift 119 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 119 */ - { 80, 0, 126}, /* 1: LSHIFT shift 126 */ - { 177, 3, 130}, /* 2: likeop shift 130 */ - { 81, 0, 110}, /* 3: LT shift 110 */ - { 99, 5, 145}, /* 4: REM shift 145 */ - { 83, 0, 139}, /* 5: MINUS shift 139 */ - { 57, 8, 112}, /* 6: GT shift 112 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 25, 0, 147}, /* 8: CONCAT shift 147 */ - { 76, 11, 114}, /* 9: LE shift 114 */ - { 105, 6, 128}, /* 10: RSHIFT shift 128 */ - { 12, 0, 122}, /* 11: BITAND shift 122 */ - { 14, 0, 124}, /* 12: BITOR shift 124 */ - { 92, 9, 99}, /* 13: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 14: SLASH shift 143 */ - { 94, 12, 137}, /* 15: PLUS shift 137 */ - { 111, 0, 141}, /* 16: STAR shift 141 */ -/* State 120 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 121}, /* 8: expr shift 121 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 121 */ - { 80, 0, 126}, /* 1: LSHIFT shift 126 */ - { 177, 3, 130}, /* 2: likeop shift 130 */ - { 81, 0, 110}, /* 3: LT shift 110 */ - { 99, 5, 145}, /* 4: REM shift 145 */ - { 83, 0, 139}, /* 5: MINUS shift 139 */ - { 57, 8, 112}, /* 6: GT shift 112 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 25, 0, 147}, /* 8: CONCAT shift 147 */ - { 76, 11, 114}, /* 9: LE shift 114 */ - { 105, 6, 128}, /* 10: RSHIFT shift 128 */ - { 12, 0, 122}, /* 11: BITAND shift 122 */ - { 14, 0, 124}, /* 12: BITOR shift 124 */ - { 92, 9, 99}, /* 13: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 14: SLASH shift 143 */ - { 94, 12, 137}, /* 15: PLUS shift 137 */ - { 111, 0, 141}, /* 16: STAR shift 141 */ -/* State 122 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 123}, /* 8: expr shift 123 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 123 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 177, 1, 130}, /* 2: likeop shift 130 */ - { 83, 0, 139}, /* 3: MINUS shift 139 */ - { 99, 3, 145}, /* 4: REM shift 145 */ - { 92, 0, 99}, /* 5: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 6: SLASH shift 143 */ - { 94, 0, 137}, /* 7: PLUS shift 137 */ - { 111, 0, 141}, /* 8: STAR shift 141 */ -/* State 124 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 125}, /* 8: expr shift 125 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 125 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 177, 1, 130}, /* 2: likeop shift 130 */ - { 83, 0, 139}, /* 3: MINUS shift 139 */ - { 99, 3, 145}, /* 4: REM shift 145 */ - { 92, 0, 99}, /* 5: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 6: SLASH shift 143 */ - { 94, 0, 137}, /* 7: PLUS shift 137 */ - { 111, 0, 141}, /* 8: STAR shift 141 */ -/* State 126 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 127}, /* 8: expr shift 127 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 127 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 177, 1, 130}, /* 2: likeop shift 130 */ - { 83, 0, 139}, /* 3: MINUS shift 139 */ - { 99, 3, 145}, /* 4: REM shift 145 */ - { 92, 0, 99}, /* 5: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 6: SLASH shift 143 */ - { 94, 0, 137}, /* 7: PLUS shift 137 */ - { 111, 0, 141}, /* 8: STAR shift 141 */ -/* State 128 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 129}, /* 8: expr shift 129 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 129 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 177, 1, 130}, /* 2: likeop shift 130 */ - { 83, 0, 139}, /* 3: MINUS shift 139 */ - { 99, 3, 145}, /* 4: REM shift 145 */ - { 92, 0, 99}, /* 5: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 6: SLASH shift 143 */ - { 94, 0, 137}, /* 7: PLUS shift 137 */ - { 111, 0, 141}, /* 8: STAR shift 141 */ -/* State 130 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 131}, /* 8: expr shift 131 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 131 */ - { 80, 0, 126}, /* 1: LSHIFT shift 126 */ - { 177, 3, 130}, /* 2: likeop shift 130 */ - { 81, 0, 110}, /* 3: LT shift 110 */ - { 99, 5, 145}, /* 4: REM shift 145 */ - { 83, 0, 139}, /* 5: MINUS shift 139 */ - { 57, 8, 112}, /* 6: GT shift 112 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 25, 0, 147}, /* 8: CONCAT shift 147 */ - { 76, 11, 114}, /* 9: LE shift 114 */ - { 105, 6, 128}, /* 10: RSHIFT shift 128 */ - { 12, 0, 122}, /* 11: BITAND shift 122 */ - { 14, 0, 124}, /* 12: BITOR shift 124 */ - { 92, 9, 99}, /* 13: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 14: SLASH shift 143 */ - { 94, 12, 137}, /* 15: PLUS shift 137 */ - { 111, 0, 141}, /* 16: STAR shift 141 */ -/* State 132 */ - { 87, 3, 215}, /* 1: NULL shift 215 */ - { 55, 0, 136}, /* 2: GLOB shift 136 */ - { 63, 0, 220}, /* 3: IN shift 220 */ - { 177, 1, 133}, /* 4: likeop shift 133 */ - { 11, 0, 216}, /* 5: BETWEEN shift 216 */ - { 77, 5, 135}, /* 6: LIKE shift 135 */ -/* State 133 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 134}, /* 8: expr shift 134 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 134 */ - { 80, 0, 126}, /* 1: LSHIFT shift 126 */ - { 177, 3, 130}, /* 2: likeop shift 130 */ - { 81, 0, 110}, /* 3: LT shift 110 */ - { 99, 5, 145}, /* 4: REM shift 145 */ - { 83, 0, 139}, /* 5: MINUS shift 139 */ - { 57, 8, 112}, /* 6: GT shift 112 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 25, 0, 147}, /* 8: CONCAT shift 147 */ - { 76, 11, 114}, /* 9: LE shift 114 */ - { 105, 6, 128}, /* 10: RSHIFT shift 128 */ - { 12, 0, 122}, /* 11: BITAND shift 122 */ - { 14, 0, 124}, /* 12: BITOR shift 124 */ - { 92, 9, 99}, /* 13: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 14: SLASH shift 143 */ - { 94, 12, 137}, /* 15: PLUS shift 137 */ - { 111, 0, 141}, /* 16: STAR shift 141 */ -/* State 137 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 138}, /* 8: expr shift 138 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 138 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 109, 1, 143}, /* 2: SLASH shift 143 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ - { 177, 5, 130}, /* 4: likeop shift 130 */ - { 111, 6, 141}, /* 5: STAR shift 141 */ - { 99, 0, 145}, /* 6: REM shift 145 */ -/* State 139 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 140}, /* 8: expr shift 140 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 140 */ - { 25, 0, 147}, /* 1: CONCAT shift 147 */ - { 109, 1, 143}, /* 2: SLASH shift 143 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ - { 177, 5, 130}, /* 4: likeop shift 130 */ - { 111, 6, 141}, /* 5: STAR shift 141 */ - { 99, 0, 145}, /* 6: REM shift 145 */ -/* State 141 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 142}, /* 8: expr shift 142 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 142 */ - { 177, 0, 130}, /* 1: likeop shift 130 */ - { 25, 0, 147}, /* 2: CONCAT shift 147 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ -/* State 143 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 144}, /* 8: expr shift 144 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 144 */ - { 177, 0, 130}, /* 1: likeop shift 130 */ - { 25, 0, 147}, /* 2: CONCAT shift 147 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ -/* State 145 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 146}, /* 8: expr shift 146 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 146 */ - { 177, 0, 130}, /* 1: likeop shift 130 */ - { 25, 0, 147}, /* 2: CONCAT shift 147 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ -/* State 147 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 148}, /* 8: expr shift 148 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 148 */ - { 92, 0, 99}, /* 1: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 2: likeop shift 130 */ -/* State 150 */ - { 85, 0, 152}, /* 1: NOT shift 152 */ - { 87, 1, 151}, /* 2: NULL shift 151 */ -/* State 152 */ - { 87, 0, 153}, /* 1: NULL shift 153 */ -/* State 155 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 156}, /* 8: expr shift 156 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 156 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 157}, /* 6: AND shift 157 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 157 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 158}, /* 8: expr shift 158 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 158 */ - { 80, 0, 126}, /* 1: LSHIFT shift 126 */ - { 177, 3, 130}, /* 2: likeop shift 130 */ - { 81, 0, 110}, /* 3: LT shift 110 */ - { 99, 5, 145}, /* 4: REM shift 145 */ - { 83, 0, 139}, /* 5: MINUS shift 139 */ - { 57, 8, 112}, /* 6: GT shift 112 */ - { 54, 0, 116}, /* 7: GE shift 116 */ - { 25, 0, 147}, /* 8: CONCAT shift 147 */ - { 76, 11, 114}, /* 9: LE shift 114 */ - { 105, 6, 128}, /* 10: RSHIFT shift 128 */ - { 12, 0, 122}, /* 11: BITAND shift 122 */ - { 14, 0, 124}, /* 12: BITOR shift 124 */ - { 92, 9, 99}, /* 13: ORACLE_OUTER_JOIN shift 99 */ - { 109, 0, 143}, /* 14: SLASH shift 143 */ - { 94, 12, 137}, /* 15: PLUS shift 137 */ - { 111, 0, 141}, /* 16: STAR shift 141 */ -/* State 159 */ - { 79, 0, 160}, /* 1: LP shift 160 */ -/* State 160 */ - { 85, 0, 170}, /* 1: NOT shift 170 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 13, 0, 172}, /* 3: BITNOT shift 172 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 74, 0, 67}, /* 5: JOIN_KW shift 67 */ - { 185, 1, 69}, /* 6: oneselect shift 69 */ - { 106, 0, 73}, /* 7: SELECT shift 73 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 68, 0, 168}, /* 9: INTEGER shift 168 */ - { 49, 0, 169}, /* 10: FLOAT shift 169 */ - { 97, 12, 188}, /* 11: RAISE shift 188 */ - { 17, 0, 178}, /* 12: CASE shift 178 */ - { 79, 16, 68}, /* 13: LP shift 68 */ - { 113, 3, 66}, /* 14: STRING shift 66 */ - { 94, 5, 176}, /* 15: PLUS shift 176 */ - { 59, 0, 64}, /* 16: ID shift 64 */ - { 196, 0, 161}, /* 17: select shift 161 */ - { 157, 11, 167}, /* 18: expr shift 167 */ - { 158, 0, 214}, /* 19: expritem shift 214 */ - { 159, 13, 210}, /* 20: exprlist shift 210 */ -/* State 161 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 3, 162}, /* 2: UNION shift 162 */ - { 46, 0, 165}, /* 3: EXCEPT shift 165 */ - { 69, 0, 164}, /* 4: INTERSECT shift 164 */ - { 104, 4, 166}, /* 5: RP shift 166 */ -/* State 162 */ - { 106, 2, 658}, /* 1: SELECT reduce 103 */ - { 4, 0, 163}, /* 2: ALL shift 163 */ -/* State 163 */ - { 106, 0, 659}, /* 1: SELECT reduce 104 */ -/* State 164 */ - { 106, 0, 660}, /* 1: SELECT reduce 105 */ -/* State 165 */ - { 106, 0, 661}, /* 1: SELECT reduce 106 */ -/* State 167 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 170 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 171}, /* 8: expr shift 171 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 171 */ - { 54, 0, 116}, /* 1: GE shift 116 */ - { 105, 0, 128}, /* 2: RSHIFT shift 128 */ - { 80, 1, 126}, /* 3: LSHIFT shift 126 */ - { 81, 5, 110}, /* 4: LT shift 110 */ - { 55, 0, 136}, /* 5: GLOB shift 136 */ - { 109, 10, 143}, /* 6: SLASH shift 143 */ - { 84, 0, 118}, /* 7: NE shift 118 */ - { 111, 11, 141}, /* 8: STAR shift 141 */ - { 86, 0, 154}, /* 9: NOTNULL shift 154 */ - { 83, 14, 139}, /* 10: MINUS shift 139 */ - { 85, 0, 132}, /* 11: NOT shift 132 */ - { 63, 16, 159}, /* 12: IN shift 159 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 57, 0, 112}, /* 14: GT shift 112 */ - { 92, 18, 99}, /* 15: ORACLE_OUTER_JOIN shift 99 */ - { 11, 0, 155}, /* 16: BETWEEN shift 155 */ - { 94, 0, 137}, /* 17: PLUS shift 137 */ - { 14, 0, 124}, /* 18: BITOR shift 124 */ - { 45, 0, 120}, /* 19: EQ shift 120 */ - { 71, 19, 150}, /* 20: IS shift 150 */ - { 72, 0, 149}, /* 21: ISNULL shift 149 */ - { 177, 23, 130}, /* 22: likeop shift 130 */ - { 99, 0, 145}, /* 23: REM shift 145 */ - { 25, 0, 147}, /* 24: CONCAT shift 147 */ - { 76, 0, 114}, /* 25: LE shift 114 */ - { 77, 24, 135}, /* 26: LIKE shift 135 */ -/* State 172 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 173}, /* 8: expr shift 173 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 173 */ - { 92, 0, 99}, /* 1: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 2: likeop shift 130 */ -/* State 174 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 175}, /* 8: expr shift 175 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 175 */ - { 92, 0, 99}, /* 1: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 2: likeop shift 130 */ -/* State 176 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 177}, /* 8: expr shift 177 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 177 */ - { 92, 0, 99}, /* 1: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 2: likeop shift 130 */ -/* State 178 */ - { 136, 2, 180}, /* 1: case_operand shift 180 */ - { 85, 4, 170}, /* 2: NOT shift 170 */ - { 87, 0, 101}, /* 3: NULL shift 101 */ - { 68, 6, 168}, /* 4: INTEGER shift 168 */ - { 157, 0, 179}, /* 5: expr shift 179 */ - { 17, 0, 178}, /* 6: CASE shift 178 */ - { 74, 0, 67}, /* 7: JOIN_KW shift 67 */ - { 113, 15, 66}, /* 8: STRING shift 66 */ - { 59, 0, 64}, /* 9: ID shift 64 */ - { 94, 0, 176}, /* 10: PLUS shift 176 */ - { 129, 0, 781}, /* 11: WHEN reduce 226 */ - { 181, 8, 102}, /* 12: nm shift 102 */ - { 97, 0, 188}, /* 13: RAISE shift 188 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 79, 0, 68}, /* 15: LP shift 68 */ - { 83, 17, 174}, /* 16: MINUS shift 174 */ - { 49, 0, 169}, /* 17: FLOAT shift 169 */ -/* State 179 */ - { 63, 2, 159}, /* 1: IN shift 159 */ - { 5, 0, 100}, /* 2: AND shift 100 */ - { 12, 0, 122}, /* 3: BITAND shift 122 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 1, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 14, 0, 124}, /* 9: BITOR shift 124 */ - { 76, 0, 114}, /* 10: LE shift 114 */ - { 80, 0, 126}, /* 11: LSHIFT shift 126 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 3, 145}, /* 13: REM shift 145 */ - { 129, 7, 780}, /* 14: WHEN reduce 225 */ - { 72, 9, 149}, /* 15: ISNULL shift 149 */ - { 54, 18, 116}, /* 16: GE shift 116 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 25, 0, 147}, /* 18: CONCAT shift 147 */ - { 105, 10, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 11, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 16, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 180 */ - { 129, 0, 206}, /* 1: WHEN shift 206 */ - { 135, 1, 181}, /* 2: case_exprlist shift 181 */ -/* State 181 */ - { 42, 0, 204}, /* 1: ELSE shift 204 */ - { 129, 0, 184}, /* 2: WHEN shift 184 */ - { 134, 1, 182}, /* 3: case_else shift 182 */ - { 43, 0, 779}, /* 4: END reduce 224 */ -/* State 182 */ - { 43, 0, 183}, /* 1: END shift 183 */ -/* State 184 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 185}, /* 8: expr shift 185 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 185 */ - { 116, 0, 186}, /* 1: THEN shift 186 */ - { 63, 3, 159}, /* 2: IN shift 159 */ - { 5, 0, 100}, /* 3: AND shift 100 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 2, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 12, 0, 122}, /* 7: BITAND shift 122 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 14, 0, 124}, /* 9: BITOR shift 124 */ - { 76, 0, 114}, /* 10: LE shift 114 */ - { 80, 0, 126}, /* 11: LSHIFT shift 126 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 7, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 9, 149}, /* 15: ISNULL shift 149 */ - { 54, 18, 116}, /* 16: GE shift 116 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 25, 0, 147}, /* 18: CONCAT shift 147 */ - { 105, 10, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 11, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 16, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 186 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 187}, /* 8: expr shift 187 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 187 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 188 */ - { 79, 0, 189}, /* 1: LP shift 189 */ -/* State 189 */ - { 60, 4, 190}, /* 1: IGNORE shift 190 */ - { 1, 0, 196}, /* 2: ABORT shift 196 */ - { 102, 0, 192}, /* 3: ROLLBACK shift 192 */ - { 48, 0, 200}, /* 4: FAIL shift 200 */ -/* State 190 */ - { 104, 0, 191}, /* 1: RP shift 191 */ -/* State 192 */ - { 22, 0, 193}, /* 1: COMMA shift 193 */ -/* State 193 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 194}, /* 2: nm shift 194 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 194 */ - { 104, 0, 195}, /* 1: RP shift 195 */ -/* State 196 */ - { 22, 0, 197}, /* 1: COMMA shift 197 */ -/* State 197 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 198}, /* 2: nm shift 198 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 198 */ - { 104, 0, 199}, /* 1: RP shift 199 */ -/* State 200 */ - { 22, 0, 201}, /* 1: COMMA shift 201 */ -/* State 201 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 202}, /* 2: nm shift 202 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 202 */ - { 104, 0, 203}, /* 1: RP shift 203 */ -/* State 204 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 205}, /* 8: expr shift 205 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 205 */ - { 63, 2, 159}, /* 1: IN shift 159 */ - { 5, 0, 100}, /* 2: AND shift 100 */ - { 12, 0, 122}, /* 3: BITAND shift 122 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 1, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 43, 9, 778}, /* 7: END reduce 223 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 14, 0, 124}, /* 9: BITOR shift 124 */ - { 76, 0, 114}, /* 10: LE shift 114 */ - { 80, 0, 126}, /* 11: LSHIFT shift 126 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 3, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 7, 149}, /* 15: ISNULL shift 149 */ - { 54, 18, 116}, /* 16: GE shift 116 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 25, 0, 147}, /* 18: CONCAT shift 147 */ - { 105, 10, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 11, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 16, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 206 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 207}, /* 8: expr shift 207 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 207 */ - { 116, 0, 208}, /* 1: THEN shift 208 */ - { 63, 3, 159}, /* 2: IN shift 159 */ - { 5, 0, 100}, /* 3: AND shift 100 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 2, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 12, 0, 122}, /* 7: BITAND shift 122 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 14, 0, 124}, /* 9: BITOR shift 124 */ - { 76, 0, 114}, /* 10: LE shift 114 */ - { 80, 0, 126}, /* 11: LSHIFT shift 126 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 7, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 9, 149}, /* 15: ISNULL shift 149 */ - { 54, 18, 116}, /* 16: GE shift 116 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 25, 0, 147}, /* 18: CONCAT shift 147 */ - { 105, 10, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 11, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 16, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 208 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 209}, /* 8: expr shift 209 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 209 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 210 */ - { 104, 2, 211}, /* 1: RP shift 211 */ - { 22, 0, 212}, /* 2: COMMA shift 212 */ -/* State 212 */ - { 97, 3, 188}, /* 1: RAISE shift 188 */ - { 113, 1, 66}, /* 2: STRING shift 66 */ - { 49, 7, 169}, /* 3: FLOAT shift 169 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 68, 0, 168}, /* 5: INTEGER shift 168 */ - { 181, 9, 102}, /* 6: nm shift 102 */ - { 17, 0, 178}, /* 7: CASE shift 178 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 85, 0, 170}, /* 9: NOT shift 170 */ - { 13, 0, 172}, /* 10: BITNOT shift 172 */ - { 74, 0, 67}, /* 11: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 94, 0, 176}, /* 13: PLUS shift 176 */ - { 157, 10, 167}, /* 14: expr shift 167 */ - { 158, 13, 213}, /* 15: expritem shift 213 */ - { 79, 0, 68}, /* 16: LP shift 68 */ -/* State 216 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 217}, /* 8: expr shift 217 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 217 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 218}, /* 6: AND shift 218 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 218 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 219}, /* 8: expr shift 219 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 219 */ - { 54, 0, 116}, /* 1: GE shift 116 */ - { 105, 0, 128}, /* 2: RSHIFT shift 128 */ - { 80, 1, 126}, /* 3: LSHIFT shift 126 */ - { 81, 5, 110}, /* 4: LT shift 110 */ - { 55, 0, 136}, /* 5: GLOB shift 136 */ - { 109, 10, 143}, /* 6: SLASH shift 143 */ - { 84, 0, 118}, /* 7: NE shift 118 */ - { 111, 11, 141}, /* 8: STAR shift 141 */ - { 86, 0, 154}, /* 9: NOTNULL shift 154 */ - { 83, 14, 139}, /* 10: MINUS shift 139 */ - { 85, 0, 132}, /* 11: NOT shift 132 */ - { 63, 16, 159}, /* 12: IN shift 159 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 57, 0, 112}, /* 14: GT shift 112 */ - { 92, 18, 99}, /* 15: ORACLE_OUTER_JOIN shift 99 */ - { 11, 0, 155}, /* 16: BETWEEN shift 155 */ - { 94, 0, 137}, /* 17: PLUS shift 137 */ - { 14, 0, 124}, /* 18: BITOR shift 124 */ - { 45, 0, 120}, /* 19: EQ shift 120 */ - { 71, 19, 150}, /* 20: IS shift 150 */ - { 72, 0, 149}, /* 21: ISNULL shift 149 */ - { 177, 23, 130}, /* 22: likeop shift 130 */ - { 99, 0, 145}, /* 23: REM shift 145 */ - { 25, 0, 147}, /* 24: CONCAT shift 147 */ - { 76, 0, 114}, /* 25: LE shift 114 */ - { 77, 24, 135}, /* 26: LIKE shift 135 */ -/* State 220 */ - { 79, 0, 221}, /* 1: LP shift 221 */ -/* State 221 */ - { 85, 0, 170}, /* 1: NOT shift 170 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 13, 0, 172}, /* 3: BITNOT shift 172 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 74, 0, 67}, /* 5: JOIN_KW shift 67 */ - { 185, 1, 69}, /* 6: oneselect shift 69 */ - { 106, 0, 73}, /* 7: SELECT shift 73 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 68, 0, 168}, /* 9: INTEGER shift 168 */ - { 49, 0, 169}, /* 10: FLOAT shift 169 */ - { 97, 12, 188}, /* 11: RAISE shift 188 */ - { 17, 0, 178}, /* 12: CASE shift 178 */ - { 79, 16, 68}, /* 13: LP shift 68 */ - { 113, 3, 66}, /* 14: STRING shift 66 */ - { 94, 5, 176}, /* 15: PLUS shift 176 */ - { 59, 0, 64}, /* 16: ID shift 64 */ - { 196, 0, 222}, /* 17: select shift 222 */ - { 157, 11, 167}, /* 18: expr shift 167 */ - { 158, 0, 214}, /* 19: expritem shift 214 */ - { 159, 13, 224}, /* 20: exprlist shift 224 */ -/* State 222 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 3, 162}, /* 2: UNION shift 162 */ - { 46, 0, 165}, /* 3: EXCEPT shift 165 */ - { 69, 0, 164}, /* 4: INTERSECT shift 164 */ - { 104, 4, 223}, /* 5: RP shift 223 */ -/* State 224 */ - { 104, 2, 225}, /* 1: RP shift 225 */ - { 22, 0, 212}, /* 2: COMMA shift 212 */ -/* State 226 */ - { 20, 0, 95}, /* 1: COLLATE shift 95 */ - { 141, 0, 227}, /* 2: collate shift 227 */ -/* State 227 */ - { 36, 0, 59}, /* 1: DESC shift 59 */ - { 202, 3, 228}, /* 2: sortorder shift 228 */ - { 7, 0, 58}, /* 3: ASC shift 58 */ -/* State 229 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 230}, /* 8: expr shift 230 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 230 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 231 */ - { 15, 0, 232}, /* 1: BY shift 232 */ -/* State 232 */ - { 85, 2, 170}, /* 1: NOT shift 170 */ - { 68, 4, 168}, /* 2: INTEGER shift 168 */ - { 87, 0, 101}, /* 3: NULL shift 101 */ - { 17, 0, 178}, /* 4: CASE shift 178 */ - { 157, 0, 167}, /* 5: expr shift 167 */ - { 158, 0, 214}, /* 6: expritem shift 214 */ - { 159, 8, 233}, /* 7: exprlist shift 233 */ - { 74, 0, 67}, /* 8: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 9: ID shift 64 */ - { 94, 0, 176}, /* 10: PLUS shift 176 */ - { 113, 15, 66}, /* 11: STRING shift 66 */ - { 181, 11, 102}, /* 12: nm shift 102 */ - { 97, 0, 188}, /* 13: RAISE shift 188 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 79, 0, 68}, /* 15: LP shift 68 */ - { 83, 17, 174}, /* 16: MINUS shift 174 */ - { 49, 0, 169}, /* 17: FLOAT shift 169 */ -/* State 233 */ - { 22, 0, 212}, /* 1: COMMA shift 212 */ -/* State 234 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 235}, /* 8: expr shift 235 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 235 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 237 */ - { 197, 0, 238}, /* 1: seltablist shift 238 */ - { 203, 1, 248}, /* 2: stl_prefix shift 248 */ -/* State 238 */ - { 22, 0, 240}, /* 1: COMMA shift 240 */ - { 73, 0, 241}, /* 2: JOIN shift 241 */ - { 74, 1, 242}, /* 3: JOIN_KW shift 242 */ - { 175, 0, 239}, /* 4: joinop shift 239 */ -/* State 242 */ - { 73, 0, 243}, /* 1: JOIN shift 243 */ - { 181, 0, 244}, /* 2: nm shift 244 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 1, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 244 */ - { 73, 0, 245}, /* 1: JOIN shift 245 */ - { 181, 0, 246}, /* 2: nm shift 246 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 1, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 246 */ - { 73, 0, 247}, /* 1: JOIN shift 247 */ -/* State 248 */ - { 74, 3, 22}, /* 1: JOIN_KW shift 22 */ - { 181, 0, 249}, /* 2: nm shift 249 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 79, 1, 272}, /* 5: LP shift 272 */ -/* State 249 */ - { 150, 0, 250}, /* 1: dbnm shift 250 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ -/* State 250 */ - { 165, 0, 255}, /* 1: ids shift 255 */ - { 131, 3, 256}, /* 2: as shift 256 */ - { 6, 0, 253}, /* 3: AS shift 253 */ - { 113, 0, 252}, /* 4: STRING shift 252 */ - { 59, 0, 251}, /* 5: ID shift 251 */ -/* State 253 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 254}, /* 2: nm shift 254 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 256 */ - { 90, 0, 268}, /* 1: ON shift 268 */ - { 183, 0, 257}, /* 2: on_opt shift 257 */ -/* State 257 */ - { 125, 0, 259}, /* 1: USING shift 259 */ - { 215, 1, 258}, /* 2: using_opt shift 258 */ -/* State 259 */ - { 79, 0, 260}, /* 1: LP shift 260 */ -/* State 260 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 261}, /* 6: idxlist shift 261 */ -/* State 261 */ - { 104, 2, 262}, /* 1: RP shift 262 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 263 */ - { 166, 0, 264}, /* 1: idxitem shift 264 */ - { 181, 1, 265}, /* 2: nm shift 265 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 265 */ - { 36, 0, 59}, /* 1: DESC shift 59 */ - { 202, 3, 266}, /* 2: sortorder shift 266 */ - { 7, 0, 58}, /* 3: ASC shift 58 */ -/* State 268 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 269}, /* 8: expr shift 269 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 269 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 270 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 271}, /* 2: nm shift 271 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 272 */ - { 106, 0, 73}, /* 1: SELECT shift 73 */ - { 196, 1, 273}, /* 2: select shift 273 */ - { 185, 0, 69}, /* 3: oneselect shift 69 */ -/* State 273 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 3, 162}, /* 2: UNION shift 162 */ - { 46, 0, 165}, /* 3: EXCEPT shift 165 */ - { 69, 0, 164}, /* 4: INTERSECT shift 164 */ - { 104, 4, 274}, /* 5: RP shift 274 */ -/* State 274 */ - { 165, 0, 255}, /* 1: ids shift 255 */ - { 131, 3, 275}, /* 2: as shift 275 */ - { 6, 0, 253}, /* 3: AS shift 253 */ - { 113, 0, 252}, /* 4: STRING shift 252 */ - { 59, 0, 251}, /* 5: ID shift 251 */ -/* State 275 */ - { 90, 0, 268}, /* 1: ON shift 268 */ - { 183, 0, 276}, /* 2: on_opt shift 276 */ -/* State 276 */ - { 125, 0, 259}, /* 1: USING shift 259 */ - { 215, 1, 277}, /* 2: using_opt shift 277 */ -/* State 278 */ - { 97, 3, 188}, /* 1: RAISE shift 188 */ - { 113, 1, 66}, /* 2: STRING shift 66 */ - { 49, 7, 169}, /* 3: FLOAT shift 169 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 68, 0, 168}, /* 5: INTEGER shift 168 */ - { 181, 9, 282}, /* 6: nm shift 282 */ - { 17, 0, 178}, /* 7: CASE shift 178 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 85, 0, 170}, /* 9: NOT shift 170 */ - { 13, 0, 172}, /* 10: BITNOT shift 172 */ - { 74, 0, 67}, /* 11: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 79, 0, 68}, /* 13: LP shift 68 */ - { 157, 10, 279}, /* 14: expr shift 279 */ - { 94, 0, 176}, /* 15: PLUS shift 176 */ - { 111, 13, 281}, /* 16: STAR shift 281 */ -/* State 279 */ - { 165, 2, 255}, /* 1: ids shift 255 */ - { 99, 0, 145}, /* 2: REM shift 145 */ - { 5, 0, 100}, /* 3: AND shift 100 */ - { 72, 5, 149}, /* 4: ISNULL shift 149 */ - { 6, 0, 253}, /* 5: AS shift 253 */ - { 71, 3, 150}, /* 6: IS shift 150 */ - { 105, 4, 128}, /* 7: RSHIFT shift 128 */ - { 76, 0, 114}, /* 8: LE shift 114 */ - { 11, 0, 155}, /* 9: BETWEEN shift 155 */ - { 111, 14, 141}, /* 10: STAR shift 141 */ - { 109, 8, 143}, /* 11: SLASH shift 143 */ - { 77, 9, 135}, /* 12: LIKE shift 135 */ - { 177, 10, 130}, /* 13: likeop shift 130 */ - { 45, 17, 120}, /* 14: EQ shift 120 */ - { 113, 24, 252}, /* 15: STRING shift 252 */ - { 81, 0, 110}, /* 16: LT shift 110 */ - { 12, 0, 122}, /* 17: BITAND shift 122 */ - { 83, 0, 139}, /* 18: MINUS shift 139 */ - { 84, 0, 118}, /* 19: NE shift 118 */ - { 85, 0, 132}, /* 20: NOT shift 132 */ - { 86, 0, 154}, /* 21: NOTNULL shift 154 */ - { 54, 0, 116}, /* 22: GE shift 116 */ - { 55, 0, 136}, /* 23: GLOB shift 136 */ - { 80, 28, 126}, /* 24: LSHIFT shift 126 */ - { 57, 0, 112}, /* 25: GT shift 112 */ - { 91, 30, 108}, /* 26: OR shift 108 */ - { 92, 32, 99}, /* 27: ORACLE_OUTER_JOIN shift 99 */ - { 14, 0, 124}, /* 28: BITOR shift 124 */ - { 94, 0, 137}, /* 29: PLUS shift 137 */ - { 25, 0, 147}, /* 30: CONCAT shift 147 */ - { 63, 0, 159}, /* 31: IN shift 159 */ - { 59, 0, 251}, /* 32: ID shift 251 */ - { 131, 0, 280}, /* 33: as shift 280 */ -/* State 282 */ - { 39, 0, 283}, /* 1: DOT shift 283 */ -/* State 283 */ - { 111, 0, 284}, /* 1: STAR shift 284 */ - { 181, 1, 104}, /* 2: nm shift 104 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 288 */ - { 63, 2, 159}, /* 1: IN shift 159 */ - { 5, 0, 100}, /* 2: AND shift 100 */ - { 12, 0, 122}, /* 3: BITAND shift 122 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 1, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 14, 0, 124}, /* 7: BITOR shift 124 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 76, 0, 114}, /* 9: LE shift 114 */ - { 80, 0, 126}, /* 10: LSHIFT shift 126 */ - { 54, 16, 116}, /* 11: GE shift 116 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 3, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 7, 149}, /* 15: ISNULL shift 149 */ - { 25, 0, 147}, /* 16: CONCAT shift 147 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 104, 0, 289}, /* 18: RP shift 289 */ - { 105, 9, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 10, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 11, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 290 */ - { 104, 2, 291}, /* 1: RP shift 291 */ - { 22, 0, 212}, /* 2: COMMA shift 212 */ -/* State 292 */ - { 104, 0, 293}, /* 1: RP shift 293 */ -/* State 294 */ - { 63, 2, 159}, /* 1: IN shift 159 */ - { 5, 0, 100}, /* 2: AND shift 100 */ - { 12, 0, 122}, /* 3: BITAND shift 122 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 1, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 14, 0, 124}, /* 7: BITOR shift 124 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 76, 0, 114}, /* 9: LE shift 114 */ - { 80, 0, 126}, /* 10: LSHIFT shift 126 */ - { 54, 16, 116}, /* 11: GE shift 116 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 3, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 7, 149}, /* 15: ISNULL shift 149 */ - { 25, 0, 147}, /* 16: CONCAT shift 147 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 104, 0, 295}, /* 18: RP shift 295 */ - { 105, 9, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 10, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 11, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 295 */ - { 184, 2, 296}, /* 1: onconf shift 296 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 297 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 298}, /* 2: nm shift 298 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 298 */ - { 168, 0, 299}, /* 1: idxlist_opt shift 299 */ - { 79, 0, 316}, /* 2: LP shift 316 */ -/* State 299 */ - { 192, 0, 300}, /* 1: refargs shift 300 */ -/* State 300 */ - { 90, 0, 304}, /* 1: ON shift 304 */ - { 82, 0, 302}, /* 2: MATCH shift 302 */ - { 191, 0, 301}, /* 3: refarg shift 301 */ -/* State 302 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 303}, /* 2: nm shift 303 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 304 */ - { 123, 3, 312}, /* 1: UPDATE shift 312 */ - { 34, 0, 305}, /* 2: DELETE shift 305 */ - { 66, 0, 314}, /* 3: INSERT shift 314 */ -/* State 305 */ - { 108, 4, 307}, /* 1: SET shift 307 */ - { 101, 0, 311}, /* 2: RESTRICT shift 311 */ - { 190, 0, 306}, /* 3: refact shift 306 */ - { 16, 0, 310}, /* 4: CASCADE shift 310 */ -/* State 307 */ - { 31, 0, 309}, /* 1: DEFAULT shift 309 */ - { 87, 1, 308}, /* 2: NULL shift 308 */ -/* State 312 */ - { 108, 4, 307}, /* 1: SET shift 307 */ - { 101, 0, 311}, /* 2: RESTRICT shift 311 */ - { 190, 0, 313}, /* 3: refact shift 313 */ - { 16, 0, 310}, /* 4: CASCADE shift 310 */ -/* State 314 */ - { 108, 4, 307}, /* 1: SET shift 307 */ - { 101, 0, 311}, /* 2: RESTRICT shift 311 */ - { 190, 0, 315}, /* 3: refact shift 315 */ - { 16, 0, 310}, /* 4: CASCADE shift 310 */ -/* State 316 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 317}, /* 6: idxlist shift 317 */ -/* State 317 */ - { 104, 2, 318}, /* 1: RP shift 318 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 320 */ - { 164, 0, 321}, /* 1: id shift 321 */ - { 59, 0, 96}, /* 2: ID shift 96 */ -/* State 322 */ - { 65, 0, 51}, /* 1: INITIALLY shift 51 */ - { 169, 1, 323}, /* 2: init_deferred_pred_opt shift 323 */ -/* State 325 */ - { 49, 0, 335}, /* 1: FLOAT shift 335 */ - { 113, 0, 326}, /* 2: STRING shift 326 */ - { 87, 5, 336}, /* 3: NULL shift 336 */ - { 94, 3, 329}, /* 4: PLUS shift 329 */ - { 59, 0, 327}, /* 5: ID shift 327 */ - { 68, 0, 328}, /* 6: INTEGER shift 328 */ - { 83, 0, 332}, /* 7: MINUS shift 332 */ -/* State 329 */ - { 68, 0, 330}, /* 1: INTEGER shift 330 */ - { 49, 0, 331}, /* 2: FLOAT shift 331 */ -/* State 332 */ - { 68, 0, 333}, /* 1: INTEGER shift 333 */ - { 49, 0, 334}, /* 2: FLOAT shift 334 */ -/* State 337 */ - { 113, 0, 252}, /* 1: STRING shift 252 */ - { 165, 1, 349}, /* 2: ids shift 349 */ - { 59, 0, 251}, /* 3: ID shift 251 */ - { 79, 3, 338}, /* 4: LP shift 338 */ -/* State 338 */ - { 68, 0, 344}, /* 1: INTEGER shift 344 */ - { 83, 0, 347}, /* 2: MINUS shift 347 */ - { 94, 0, 345}, /* 3: PLUS shift 345 */ - { 199, 2, 339}, /* 4: signed shift 339 */ -/* State 339 */ - { 104, 2, 340}, /* 1: RP shift 340 */ - { 22, 0, 341}, /* 2: COMMA shift 341 */ -/* State 341 */ - { 68, 0, 344}, /* 1: INTEGER shift 344 */ - { 83, 0, 347}, /* 2: MINUS shift 347 */ - { 94, 0, 345}, /* 3: PLUS shift 345 */ - { 199, 2, 342}, /* 4: signed shift 342 */ -/* State 342 */ - { 104, 0, 343}, /* 1: RP shift 343 */ -/* State 345 */ - { 68, 0, 346}, /* 1: INTEGER shift 346 */ -/* State 347 */ - { 68, 0, 348}, /* 1: INTEGER shift 348 */ -/* State 352 */ - { 104, 2, 632}, /* 1: RP reduce 77 */ - { 96, 0, 357}, /* 2: PRIMARY shift 357 */ - { 122, 6, 363}, /* 3: UNIQUE shift 363 */ - { 51, 8, 371}, /* 4: FOREIGN shift 371 */ - { 204, 0, 383}, /* 5: tcons shift 383 */ - { 18, 0, 368}, /* 6: CHECK shift 368 */ - { 22, 0, 353}, /* 7: COMMA shift 353 */ - { 27, 0, 355}, /* 8: CONSTRAINT shift 355 */ -/* State 353 */ - { 204, 2, 354}, /* 1: tcons shift 354 */ - { 96, 5, 357}, /* 2: PRIMARY shift 357 */ - { 122, 0, 363}, /* 3: UNIQUE shift 363 */ - { 51, 6, 371}, /* 4: FOREIGN shift 371 */ - { 18, 0, 368}, /* 5: CHECK shift 368 */ - { 27, 0, 355}, /* 6: CONSTRAINT shift 355 */ -/* State 355 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 356}, /* 2: nm shift 356 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 357 */ - { 75, 0, 358}, /* 1: KEY shift 358 */ -/* State 358 */ - { 79, 0, 359}, /* 1: LP shift 359 */ -/* State 359 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 360}, /* 6: idxlist shift 360 */ -/* State 360 */ - { 104, 2, 361}, /* 1: RP shift 361 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 361 */ - { 184, 2, 362}, /* 1: onconf shift 362 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 363 */ - { 79, 0, 364}, /* 1: LP shift 364 */ -/* State 364 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 365}, /* 6: idxlist shift 365 */ -/* State 365 */ - { 104, 2, 366}, /* 1: RP shift 366 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 366 */ - { 184, 2, 367}, /* 1: onconf shift 367 */ - { 90, 0, 10}, /* 2: ON shift 10 */ -/* State 368 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 369}, /* 8: expr shift 369 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 369 */ - { 90, 0, 10}, /* 1: ON shift 10 */ - { 91, 0, 108}, /* 2: OR shift 108 */ - { 92, 0, 99}, /* 3: ORACLE_OUTER_JOIN shift 99 */ - { 63, 0, 159}, /* 4: IN shift 159 */ - { 184, 7, 370}, /* 5: onconf shift 370 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 94, 0, 137}, /* 7: PLUS shift 137 */ - { 11, 0, 155}, /* 8: BETWEEN shift 155 */ - { 12, 0, 122}, /* 9: BITAND shift 122 */ - { 99, 0, 145}, /* 10: REM shift 145 */ - { 45, 0, 120}, /* 11: EQ shift 120 */ - { 71, 8, 150}, /* 12: IS shift 150 */ - { 72, 9, 149}, /* 13: ISNULL shift 149 */ - { 81, 0, 110}, /* 14: LT shift 110 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 105, 11, 128}, /* 16: RSHIFT shift 128 */ - { 76, 0, 114}, /* 17: LE shift 114 */ - { 77, 0, 135}, /* 18: LIKE shift 135 */ - { 54, 0, 116}, /* 19: GE shift 116 */ - { 109, 0, 143}, /* 20: SLASH shift 143 */ - { 80, 0, 126}, /* 21: LSHIFT shift 126 */ - { 111, 14, 141}, /* 22: STAR shift 141 */ - { 55, 29, 136}, /* 23: GLOB shift 136 */ - { 83, 0, 139}, /* 24: MINUS shift 139 */ - { 84, 19, 118}, /* 25: NE shift 118 */ - { 85, 23, 132}, /* 26: NOT shift 132 */ - { 86, 0, 154}, /* 27: NOTNULL shift 154 */ - { 177, 30, 130}, /* 28: likeop shift 130 */ - { 25, 0, 147}, /* 29: CONCAT shift 147 */ - { 57, 0, 112}, /* 30: GT shift 112 */ -/* State 371 */ - { 75, 0, 372}, /* 1: KEY shift 372 */ -/* State 372 */ - { 79, 0, 373}, /* 1: LP shift 373 */ -/* State 373 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 374}, /* 6: idxlist shift 374 */ -/* State 374 */ - { 104, 2, 375}, /* 1: RP shift 375 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 375 */ - { 98, 0, 376}, /* 1: REFERENCES shift 376 */ -/* State 376 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 377}, /* 2: nm shift 377 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 377 */ - { 168, 0, 378}, /* 1: idxlist_opt shift 378 */ - { 79, 0, 316}, /* 2: LP shift 316 */ -/* State 378 */ - { 192, 0, 379}, /* 1: refargs shift 379 */ -/* State 379 */ - { 32, 0, 322}, /* 1: DEFERRABLE shift 322 */ - { 85, 0, 380}, /* 2: NOT shift 380 */ - { 191, 0, 301}, /* 3: refarg shift 301 */ - { 82, 0, 302}, /* 4: MATCH shift 302 */ - { 151, 1, 382}, /* 5: defer_subclause shift 382 */ - { 152, 4, 381}, /* 6: defer_subclause_opt shift 381 */ - { 90, 0, 304}, /* 7: ON shift 304 */ -/* State 380 */ - { 32, 0, 49}, /* 1: DEFERRABLE shift 49 */ -/* State 386 */ - { 106, 0, 73}, /* 1: SELECT shift 73 */ - { 196, 1, 387}, /* 2: select shift 387 */ - { 185, 0, 69}, /* 3: oneselect shift 69 */ -/* State 387 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 575}, /* 3: SEMI reduce 20 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 388 */ - { 115, 0, 434}, /* 1: TEMP shift 434 */ - { 205, 1, 389}, /* 2: temp shift 389 */ - { 209, 0, 435}, /* 3: trigger_decl shift 435 */ -/* State 389 */ - { 114, 0, 390}, /* 1: TABLE shift 390 */ - { 122, 0, 406}, /* 2: UNIQUE shift 406 */ - { 128, 2, 392}, /* 3: VIEW shift 392 */ - { 118, 6, 407}, /* 4: TRIGGER shift 407 */ - { 214, 4, 396}, /* 5: uniqueflag shift 396 */ - { 64, 0, 788}, /* 6: INDEX reduce 233 */ -/* State 390 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 391}, /* 2: nm shift 391 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 392 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 393}, /* 2: nm shift 393 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 393 */ - { 6, 0, 394}, /* 1: AS shift 394 */ -/* State 394 */ - { 106, 0, 73}, /* 1: SELECT shift 73 */ - { 196, 1, 395}, /* 2: select shift 395 */ - { 185, 0, 69}, /* 3: oneselect shift 69 */ -/* State 395 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 653}, /* 3: SEMI reduce 98 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 396 */ - { 64, 0, 397}, /* 1: INDEX shift 397 */ -/* State 397 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 398}, /* 2: nm shift 398 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 398 */ - { 90, 0, 399}, /* 1: ON shift 399 */ -/* State 399 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 400}, /* 2: nm shift 400 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 400 */ - { 150, 3, 401}, /* 1: dbnm shift 401 */ - { 79, 0, 680}, /* 2: LP reduce 125 */ - { 39, 0, 270}, /* 3: DOT shift 270 */ -/* State 401 */ - { 79, 0, 402}, /* 1: LP shift 402 */ -/* State 402 */ - { 113, 4, 21}, /* 1: STRING shift 21 */ - { 181, 0, 265}, /* 2: nm shift 265 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ - { 166, 0, 267}, /* 5: idxitem shift 267 */ - { 167, 1, 403}, /* 6: idxlist shift 403 */ -/* State 403 */ - { 104, 2, 404}, /* 1: RP shift 404 */ - { 22, 0, 263}, /* 2: COMMA shift 263 */ -/* State 404 */ - { 90, 0, 10}, /* 1: ON shift 10 */ - { 184, 0, 405}, /* 2: onconf shift 405 */ - { 107, 0, 643}, /* 3: SEMI reduce 88 */ -/* State 405 */ - { 107, 0, 786}, /* 1: SEMI reduce 231 */ -/* State 406 */ - { 64, 0, 787}, /* 1: INDEX reduce 232 */ -/* State 407 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 408}, /* 2: nm shift 408 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 408 */ - { 67, 0, 432}, /* 1: INSTEAD shift 432 */ - { 9, 0, 430}, /* 2: BEFORE shift 430 */ - { 2, 0, 431}, /* 3: AFTER shift 431 */ - { 211, 1, 409}, /* 4: trigger_time shift 409 */ -/* State 409 */ - { 66, 2, 423}, /* 1: INSERT shift 423 */ - { 34, 0, 422}, /* 2: DELETE shift 422 */ - { 210, 1, 410}, /* 3: trigger_event shift 410 */ - { 123, 0, 424}, /* 4: UPDATE shift 424 */ -/* State 410 */ - { 90, 0, 411}, /* 1: ON shift 411 */ -/* State 411 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 412}, /* 2: nm shift 412 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 412 */ - { 150, 0, 413}, /* 1: dbnm shift 413 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ -/* State 413 */ - { 160, 2, 414}, /* 1: foreach_clause shift 414 */ - { 50, 0, 418}, /* 2: FOR shift 418 */ -/* State 414 */ - { 216, 3, 415}, /* 1: when_clause shift 415 */ - { 10, 0, 824}, /* 2: BEGIN reduce 269 */ - { 129, 0, 416}, /* 3: WHEN shift 416 */ -/* State 415 */ - { 10, 0, 812}, /* 1: BEGIN reduce 257 */ -/* State 416 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 417}, /* 8: expr shift 417 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 417 */ - { 63, 2, 159}, /* 1: IN shift 159 */ - { 5, 0, 100}, /* 2: AND shift 100 */ - { 12, 0, 122}, /* 3: BITAND shift 122 */ - { 177, 0, 130}, /* 4: likeop shift 130 */ - { 91, 0, 108}, /* 5: OR shift 108 */ - { 92, 1, 99}, /* 6: ORACLE_OUTER_JOIN shift 99 */ - { 14, 0, 124}, /* 7: BITOR shift 124 */ - { 94, 0, 137}, /* 8: PLUS shift 137 */ - { 76, 0, 114}, /* 9: LE shift 114 */ - { 80, 0, 126}, /* 10: LSHIFT shift 126 */ - { 10, 0, 825}, /* 11: BEGIN reduce 270 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 99, 3, 145}, /* 13: REM shift 145 */ - { 71, 0, 150}, /* 14: IS shift 150 */ - { 72, 7, 149}, /* 15: ISNULL shift 149 */ - { 54, 18, 116}, /* 16: GE shift 116 */ - { 45, 0, 120}, /* 17: EQ shift 120 */ - { 25, 0, 147}, /* 18: CONCAT shift 147 */ - { 105, 9, 128}, /* 19: RSHIFT shift 128 */ - { 77, 0, 135}, /* 20: LIKE shift 135 */ - { 55, 0, 136}, /* 21: GLOB shift 136 */ - { 57, 0, 112}, /* 22: GT shift 112 */ - { 109, 10, 143}, /* 23: SLASH shift 143 */ - { 81, 0, 110}, /* 24: LT shift 110 */ - { 111, 0, 141}, /* 25: STAR shift 141 */ - { 83, 16, 139}, /* 26: MINUS shift 139 */ - { 84, 21, 118}, /* 27: NE shift 118 */ - { 85, 0, 132}, /* 28: NOT shift 132 */ - { 86, 22, 154}, /* 29: NOTNULL shift 154 */ -/* State 418 */ - { 41, 0, 419}, /* 1: EACH shift 419 */ -/* State 419 */ - { 112, 0, 421}, /* 1: STATEMENT shift 421 */ - { 103, 0, 420}, /* 2: ROW shift 420 */ -/* State 422 */ - { 90, 0, 817}, /* 1: ON reduce 262 */ -/* State 423 */ - { 90, 0, 818}, /* 1: ON reduce 263 */ -/* State 424 */ - { 90, 2, 819}, /* 1: ON reduce 264 */ - { 88, 0, 425}, /* 2: OF shift 425 */ -/* State 425 */ - { 171, 0, 426}, /* 1: inscollist shift 426 */ - { 181, 1, 429}, /* 2: nm shift 429 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 426 */ - { 90, 2, 820}, /* 1: ON reduce 265 */ - { 22, 0, 427}, /* 2: COMMA shift 427 */ -/* State 427 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 428}, /* 2: nm shift 428 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 432 */ - { 88, 0, 433}, /* 1: OF shift 433 */ -/* State 435 */ - { 10, 0, 436}, /* 1: BEGIN shift 436 */ -/* State 436 */ - { 207, 0, 440}, /* 1: trigger_cmd shift 440 */ - { 208, 0, 438}, /* 2: trigger_cmd_list shift 438 */ - { 106, 5, 73}, /* 3: SELECT shift 73 */ - { 66, 0, 458}, /* 4: INSERT shift 458 */ - { 43, 9, 827}, /* 5: END reduce 272 */ - { 185, 0, 69}, /* 6: oneselect shift 69 */ - { 123, 0, 443}, /* 7: UPDATE shift 443 */ - { 196, 3, 437}, /* 8: select shift 437 */ - { 34, 0, 474}, /* 9: DELETE shift 474 */ -/* State 437 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 832}, /* 3: SEMI reduce 277 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 438 */ - { 43, 0, 439}, /* 1: END shift 439 */ -/* State 439 */ - { 107, 0, 811}, /* 1: SEMI reduce 256 */ -/* State 440 */ - { 107, 0, 441}, /* 1: SEMI shift 441 */ -/* State 441 */ - { 207, 0, 440}, /* 1: trigger_cmd shift 440 */ - { 208, 0, 442}, /* 2: trigger_cmd_list shift 442 */ - { 106, 5, 73}, /* 3: SELECT shift 73 */ - { 66, 0, 458}, /* 4: INSERT shift 458 */ - { 43, 9, 827}, /* 5: END reduce 272 */ - { 185, 0, 69}, /* 6: oneselect shift 69 */ - { 123, 0, 443}, /* 7: UPDATE shift 443 */ - { 196, 3, 437}, /* 8: select shift 437 */ - { 34, 0, 474}, /* 9: DELETE shift 474 */ -/* State 442 */ - { 43, 0, 826}, /* 1: END reduce 271 */ -/* State 443 */ - { 186, 0, 446}, /* 1: orconf shift 446 */ - { 91, 0, 444}, /* 2: OR shift 444 */ -/* State 444 */ - { 102, 3, 13}, /* 1: ROLLBACK shift 13 */ - { 193, 4, 445}, /* 2: resolvetype shift 445 */ - { 60, 6, 16}, /* 3: IGNORE shift 16 */ - { 1, 0, 14}, /* 4: ABORT shift 14 */ - { 100, 0, 17}, /* 5: REPLACE shift 17 */ - { 48, 0, 15}, /* 6: FAIL shift 15 */ -/* State 446 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 447}, /* 2: nm shift 447 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 447 */ - { 108, 0, 448}, /* 1: SET shift 448 */ -/* State 448 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 0, 455}, /* 2: nm shift 455 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 198, 1, 449}, /* 4: setlist shift 449 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 449 */ - { 22, 0, 450}, /* 1: COMMA shift 450 */ - { 217, 0, 454}, /* 2: where_opt shift 454 */ - { 130, 1, 234}, /* 3: WHERE shift 234 */ - { 107, 0, 710}, /* 4: SEMI reduce 155 */ -/* State 450 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 451}, /* 2: nm shift 451 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 451 */ - { 45, 0, 452}, /* 1: EQ shift 452 */ -/* State 452 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 453}, /* 8: expr shift 453 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 453 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 454 */ - { 107, 0, 828}, /* 1: SEMI reduce 273 */ -/* State 455 */ - { 45, 0, 456}, /* 1: EQ shift 456 */ -/* State 456 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 457}, /* 8: expr shift 457 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 457 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 458 */ - { 186, 0, 459}, /* 1: orconf shift 459 */ - { 91, 3, 444}, /* 2: OR shift 444 */ - { 70, 0, 645}, /* 3: INTO reduce 90 */ -/* State 459 */ - { 70, 0, 460}, /* 1: INTO shift 460 */ -/* State 460 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 461}, /* 2: nm shift 461 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 461 */ - { 172, 0, 465}, /* 1: inscollist_opt shift 465 */ - { 79, 0, 462}, /* 2: LP shift 462 */ -/* State 462 */ - { 171, 0, 463}, /* 1: inscollist shift 463 */ - { 181, 1, 429}, /* 2: nm shift 429 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 463 */ - { 104, 2, 464}, /* 1: RP shift 464 */ - { 22, 0, 427}, /* 2: COMMA shift 427 */ -/* State 465 */ - { 196, 0, 466}, /* 1: select shift 466 */ - { 185, 0, 69}, /* 2: oneselect shift 69 */ - { 106, 0, 73}, /* 3: SELECT shift 73 */ - { 127, 0, 467}, /* 4: VALUES shift 467 */ -/* State 466 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 830}, /* 3: SEMI reduce 275 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 467 */ - { 79, 0, 468}, /* 1: LP shift 468 */ -/* State 468 */ - { 97, 3, 188}, /* 1: RAISE shift 188 */ - { 113, 1, 66}, /* 2: STRING shift 66 */ - { 49, 7, 169}, /* 3: FLOAT shift 169 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 68, 0, 168}, /* 5: INTEGER shift 168 */ - { 181, 9, 102}, /* 6: nm shift 102 */ - { 17, 0, 178}, /* 7: CASE shift 178 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 85, 0, 170}, /* 9: NOT shift 170 */ - { 13, 0, 172}, /* 10: BITNOT shift 172 */ - { 74, 0, 67}, /* 11: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 94, 0, 176}, /* 13: PLUS shift 176 */ - { 157, 10, 473}, /* 14: expr shift 473 */ - { 174, 13, 469}, /* 15: itemlist shift 469 */ - { 79, 0, 68}, /* 16: LP shift 68 */ -/* State 469 */ - { 104, 2, 472}, /* 1: RP shift 472 */ - { 22, 0, 470}, /* 2: COMMA shift 470 */ -/* State 470 */ - { 79, 4, 68}, /* 1: LP shift 68 */ - { 181, 0, 102}, /* 2: nm shift 102 */ - { 17, 0, 178}, /* 3: CASE shift 178 */ - { 49, 0, 169}, /* 4: FLOAT shift 169 */ - { 94, 1, 176}, /* 5: PLUS shift 176 */ - { 97, 0, 188}, /* 6: RAISE shift 188 */ - { 83, 10, 174}, /* 7: MINUS shift 174 */ - { 157, 6, 471}, /* 8: expr shift 471 */ - { 113, 7, 66}, /* 9: STRING shift 66 */ - { 68, 0, 168}, /* 10: INTEGER shift 168 */ - { 85, 0, 170}, /* 11: NOT shift 170 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 87, 0, 101}, /* 13: NULL shift 101 */ - { 13, 0, 172}, /* 14: BITNOT shift 172 */ - { 74, 12, 67}, /* 15: JOIN_KW shift 67 */ -/* State 471 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 472 */ - { 107, 0, 829}, /* 1: SEMI reduce 274 */ -/* State 473 */ - { 84, 0, 118}, /* 1: NE shift 118 */ - { 85, 4, 132}, /* 2: NOT shift 132 */ - { 86, 0, 154}, /* 3: NOTNULL shift 154 */ - { 57, 0, 112}, /* 4: GT shift 112 */ - { 63, 0, 159}, /* 5: IN shift 159 */ - { 5, 0, 100}, /* 6: AND shift 100 */ - { 71, 0, 150}, /* 7: IS shift 150 */ - { 91, 5, 108}, /* 8: OR shift 108 */ - { 92, 0, 99}, /* 9: ORACLE_OUTER_JOIN shift 99 */ - { 177, 0, 130}, /* 10: likeop shift 130 */ - { 94, 0, 137}, /* 11: PLUS shift 137 */ - { 11, 0, 155}, /* 12: BETWEEN shift 155 */ - { 12, 0, 122}, /* 13: BITAND shift 122 */ - { 77, 0, 135}, /* 14: LIKE shift 135 */ - { 14, 0, 124}, /* 15: BITOR shift 124 */ - { 99, 7, 145}, /* 16: REM shift 145 */ - { 72, 0, 149}, /* 17: ISNULL shift 149 */ - { 45, 0, 120}, /* 18: EQ shift 120 */ - { 81, 20, 110}, /* 19: LT shift 110 */ - { 25, 0, 147}, /* 20: CONCAT shift 147 */ - { 76, 0, 114}, /* 21: LE shift 114 */ - { 105, 14, 128}, /* 22: RSHIFT shift 128 */ - { 83, 24, 139}, /* 23: MINUS shift 139 */ - { 55, 0, 136}, /* 24: GLOB shift 136 */ - { 80, 0, 126}, /* 25: LSHIFT shift 126 */ - { 109, 19, 143}, /* 26: SLASH shift 143 */ - { 54, 0, 116}, /* 27: GE shift 116 */ - { 111, 23, 141}, /* 28: STAR shift 141 */ -/* State 474 */ - { 52, 0, 475}, /* 1: FROM shift 475 */ -/* State 475 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 476}, /* 2: nm shift 476 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 476 */ - { 130, 0, 234}, /* 1: WHERE shift 234 */ - { 217, 1, 477}, /* 2: where_opt shift 477 */ - { 107, 0, 710}, /* 3: SEMI reduce 155 */ -/* State 477 */ - { 107, 0, 831}, /* 1: SEMI reduce 276 */ -/* State 478 */ - { 128, 2, 481}, /* 1: VIEW shift 481 */ - { 64, 0, 483}, /* 2: INDEX shift 483 */ - { 118, 4, 486}, /* 3: TRIGGER shift 486 */ - { 114, 0, 479}, /* 4: TABLE shift 479 */ -/* State 479 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 480}, /* 2: nm shift 480 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 480 */ - { 107, 0, 652}, /* 1: SEMI reduce 97 */ -/* State 481 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 482}, /* 2: nm shift 482 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 482 */ - { 107, 0, 654}, /* 1: SEMI reduce 99 */ -/* State 483 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 484}, /* 2: nm shift 484 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 484 */ - { 150, 2, 485}, /* 1: dbnm shift 485 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ - { 107, 0, 680}, /* 3: SEMI reduce 125 */ -/* State 485 */ - { 107, 0, 794}, /* 1: SEMI reduce 239 */ -/* State 486 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 487}, /* 2: nm shift 487 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 487 */ - { 150, 2, 488}, /* 1: dbnm shift 488 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ - { 107, 0, 680}, /* 3: SEMI reduce 125 */ -/* State 488 */ - { 107, 0, 837}, /* 1: SEMI reduce 282 */ -/* State 489 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 655}, /* 3: SEMI reduce 100 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 490 */ - { 52, 0, 491}, /* 1: FROM shift 491 */ -/* State 491 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 492}, /* 2: nm shift 492 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 492 */ - { 150, 0, 493}, /* 1: dbnm shift 493 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ -/* State 493 */ - { 130, 0, 234}, /* 1: WHERE shift 234 */ - { 217, 1, 494}, /* 2: where_opt shift 494 */ - { 107, 0, 710}, /* 3: SEMI reduce 155 */ -/* State 494 */ - { 107, 0, 709}, /* 1: SEMI reduce 154 */ -/* State 495 */ - { 186, 0, 496}, /* 1: orconf shift 496 */ - { 91, 0, 444}, /* 2: OR shift 444 */ -/* State 496 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 497}, /* 2: nm shift 497 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 497 */ - { 150, 2, 498}, /* 1: dbnm shift 498 */ - { 108, 3, 680}, /* 2: SET reduce 125 */ - { 39, 0, 270}, /* 3: DOT shift 270 */ -/* State 498 */ - { 108, 0, 499}, /* 1: SET shift 499 */ -/* State 499 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 0, 455}, /* 2: nm shift 455 */ - { 59, 0, 20}, /* 3: ID shift 20 */ - { 198, 1, 500}, /* 4: setlist shift 500 */ - { 74, 3, 22}, /* 5: JOIN_KW shift 22 */ -/* State 500 */ - { 22, 0, 450}, /* 1: COMMA shift 450 */ - { 217, 0, 501}, /* 2: where_opt shift 501 */ - { 130, 1, 234}, /* 3: WHERE shift 234 */ - { 107, 0, 710}, /* 4: SEMI reduce 155 */ -/* State 501 */ - { 107, 0, 712}, /* 1: SEMI reduce 157 */ -/* State 502 */ - { 70, 0, 503}, /* 1: INTO shift 503 */ -/* State 503 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 504}, /* 2: nm shift 504 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 504 */ - { 150, 0, 505}, /* 1: dbnm shift 505 */ - { 39, 0, 270}, /* 2: DOT shift 270 */ -/* State 505 */ - { 172, 0, 506}, /* 1: inscollist_opt shift 506 */ - { 79, 0, 462}, /* 2: LP shift 462 */ -/* State 506 */ - { 196, 0, 507}, /* 1: select shift 507 */ - { 185, 0, 69}, /* 2: oneselect shift 69 */ - { 106, 0, 73}, /* 3: SELECT shift 73 */ - { 127, 0, 508}, /* 4: VALUES shift 508 */ -/* State 507 */ - { 180, 0, 71}, /* 1: multiselect_op shift 71 */ - { 121, 4, 162}, /* 2: UNION shift 162 */ - { 107, 0, 716}, /* 3: SEMI reduce 161 */ - { 46, 0, 165}, /* 4: EXCEPT shift 165 */ - { 69, 0, 164}, /* 5: INTERSECT shift 164 */ -/* State 508 */ - { 79, 0, 509}, /* 1: LP shift 509 */ -/* State 509 */ - { 97, 3, 188}, /* 1: RAISE shift 188 */ - { 113, 1, 66}, /* 2: STRING shift 66 */ - { 49, 7, 169}, /* 3: FLOAT shift 169 */ - { 83, 0, 174}, /* 4: MINUS shift 174 */ - { 68, 0, 168}, /* 5: INTEGER shift 168 */ - { 181, 9, 102}, /* 6: nm shift 102 */ - { 17, 0, 178}, /* 7: CASE shift 178 */ - { 87, 0, 101}, /* 8: NULL shift 101 */ - { 85, 0, 170}, /* 9: NOT shift 170 */ - { 13, 0, 172}, /* 10: BITNOT shift 172 */ - { 74, 0, 67}, /* 11: JOIN_KW shift 67 */ - { 59, 0, 64}, /* 12: ID shift 64 */ - { 94, 0, 176}, /* 13: PLUS shift 176 */ - { 157, 10, 473}, /* 14: expr shift 473 */ - { 174, 13, 510}, /* 15: itemlist shift 510 */ - { 79, 0, 68}, /* 16: LP shift 68 */ -/* State 510 */ - { 104, 2, 511}, /* 1: RP shift 511 */ - { 22, 0, 470}, /* 2: COMMA shift 470 */ -/* State 511 */ - { 107, 0, 715}, /* 1: SEMI reduce 160 */ -/* State 512 */ - { 186, 0, 513}, /* 1: orconf shift 513 */ - { 91, 3, 444}, /* 2: OR shift 444 */ - { 70, 0, 645}, /* 3: INTO reduce 90 */ -/* State 513 */ - { 70, 0, 717}, /* 1: INTO reduce 162 */ -/* State 514 */ - { 70, 0, 718}, /* 1: INTO reduce 163 */ -/* State 515 */ - { 186, 0, 516}, /* 1: orconf shift 516 */ - { 91, 0, 444}, /* 2: OR shift 444 */ -/* State 516 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 517}, /* 2: nm shift 517 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 517 */ - { 150, 3, 518}, /* 1: dbnm shift 518 */ - { 52, 0, 680}, /* 2: FROM reduce 125 */ - { 39, 0, 270}, /* 3: DOT shift 270 */ -/* State 518 */ - { 52, 0, 519}, /* 1: FROM shift 519 */ -/* State 519 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 520}, /* 2: nm shift 520 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 520 */ - { 107, 0, 796}, /* 1: SEMI reduce 241 */ - { 125, 1, 521}, /* 2: USING shift 521 */ -/* State 521 */ - { 35, 0, 522}, /* 1: DELIMITERS shift 522 */ -/* State 522 */ - { 113, 0, 523}, /* 1: STRING shift 523 */ -/* State 523 */ - { 107, 0, 795}, /* 1: SEMI reduce 240 */ -/* State 524 */ - { 59, 0, 20}, /* 1: ID shift 20 */ - { 181, 0, 525}, /* 2: nm shift 525 */ - { 107, 0, 797}, /* 3: SEMI reduce 242 */ - { 113, 0, 21}, /* 4: STRING shift 21 */ - { 74, 1, 22}, /* 5: JOIN_KW shift 22 */ -/* State 525 */ - { 107, 0, 798}, /* 1: SEMI reduce 243 */ -/* State 526 */ - { 165, 0, 527}, /* 1: ids shift 527 */ - { 59, 0, 251}, /* 2: ID shift 251 */ - { 113, 2, 252}, /* 3: STRING shift 252 */ -/* State 527 */ - { 45, 0, 528}, /* 1: EQ shift 528 */ - { 79, 0, 540}, /* 2: LP shift 540 */ - { 107, 0, 804}, /* 3: SEMI reduce 249 */ -/* State 528 */ - { 90, 0, 530}, /* 1: ON shift 530 */ - { 181, 0, 529}, /* 2: nm shift 529 */ - { 83, 0, 537}, /* 3: MINUS shift 537 */ - { 113, 3, 21}, /* 4: STRING shift 21 */ - { 94, 6, 539}, /* 5: PLUS shift 539 */ - { 74, 0, 22}, /* 6: JOIN_KW shift 22 */ - { 179, 8, 532}, /* 7: minus_num shift 532 */ - { 59, 0, 20}, /* 8: ID shift 20 */ - { 188, 0, 531}, /* 9: plus_num shift 531 */ - { 189, 7, 533}, /* 10: plus_opt shift 533 */ -/* State 529 */ - { 107, 0, 799}, /* 1: SEMI reduce 244 */ -/* State 530 */ - { 107, 0, 800}, /* 1: SEMI reduce 245 */ -/* State 531 */ - { 107, 0, 801}, /* 1: SEMI reduce 246 */ -/* State 532 */ - { 107, 0, 802}, /* 1: SEMI reduce 247 */ -/* State 533 */ - { 68, 0, 535}, /* 1: INTEGER shift 535 */ - { 49, 0, 536}, /* 2: FLOAT shift 536 */ - { 182, 1, 534}, /* 3: number shift 534 */ -/* State 534 */ - { 107, 0, 805}, /* 1: SEMI reduce 250 */ -/* State 535 */ - { 107, 0, 807}, /* 1: SEMI reduce 252 */ -/* State 536 */ - { 107, 0, 808}, /* 1: SEMI reduce 253 */ -/* State 537 */ - { 68, 0, 535}, /* 1: INTEGER shift 535 */ - { 49, 0, 536}, /* 2: FLOAT shift 536 */ - { 182, 1, 538}, /* 3: number shift 538 */ -/* State 538 */ - { 107, 0, 806}, /* 1: SEMI reduce 251 */ -/* State 540 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 541}, /* 2: nm shift 541 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 541 */ - { 104, 0, 542}, /* 1: RP shift 542 */ -/* State 542 */ - { 107, 0, 803}, /* 1: SEMI reduce 248 */ -/* State 543 */ - { 30, 0, 548}, /* 1: DATABASE shift 548 */ - { 149, 0, 544}, /* 2: database_kw_opt shift 544 */ -/* State 544 */ - { 165, 0, 545}, /* 1: ids shift 545 */ - { 59, 0, 251}, /* 2: ID shift 251 */ - { 113, 2, 252}, /* 3: STRING shift 252 */ -/* State 545 */ - { 6, 0, 546}, /* 1: AS shift 546 */ -/* State 546 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 547}, /* 2: nm shift 547 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 547 */ - { 107, 0, 838}, /* 1: SEMI reduce 283 */ -/* State 549 */ - { 30, 0, 548}, /* 1: DATABASE shift 548 */ - { 149, 0, 550}, /* 2: database_kw_opt shift 550 */ -/* State 550 */ - { 113, 0, 21}, /* 1: STRING shift 21 */ - { 181, 1, 551}, /* 2: nm shift 551 */ - { 74, 0, 22}, /* 3: JOIN_KW shift 22 */ - { 59, 0, 20}, /* 4: ID shift 20 */ -/* State 551 */ - { 107, 0, 841}, /* 1: SEMI reduce 286 */ -}; - -/* The state table contains information needed to look up the correct -** action in the action table, given the current state of the parser. -** Information needed includes: +** N == YYNSTATE+YYNRULE A syntax error has occurred. +** +** N == YYNSTATE+YYNRULE+1 The parser accepts its input. +** +** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused +** slots in the yy_action[] table. +** +** The action table is constructed as a single large table named yy_action[]. +** Given state S and lookahead X, the action is computed as +** +** yy_action[ yy_shift_ofst[S] + X ] +** +** If the index value yy_shift_ofst[S]+X is out of range or if the value +** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] +** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table +** and that yy_default[S] should be used instead. ** -** + A pointer to the start of the action hash table in yyActionTable. +** The formula above is for computing the action when the lookahead is +** a terminal symbol. If the lookahead is a non-terminal (as occurs after +** a reduce action) then the yy_reduce_ofst[] array is used in place of +** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of +** YY_SHIFT_USE_DFLT. ** -** + The number of entries in the action hash table. +** The following are the tables generated in this section: ** -** + The default action. This is the action to take if no entry for -** the given look-ahead is found in the action hash table. +** yy_action[] A single table containing all actions. +** yy_lookahead[] A table containing the lookahead for each entry in +** yy_action. Used to detect hash collisions. +** yy_shift_ofst[] For each state, the offset into yy_action for +** shifting terminals. +** yy_reduce_ofst[] For each state, the offset into yy_action for +** shifting non-terminals after a reduce. +** yy_default[] Default action for each state. */ -struct yyStateEntry { - const yyActionEntry *hashtbl; /* Start of the hash table in yyActionTable */ - YYCODETYPE nEntry; /* Number of entries in action hash table */ - YYACTIONTYPE actionDefault; /* Default action if look-ahead not found */ +static YYACTIONTYPE yy_action[] = { + /* 0 */ 104, 258, 174, 219, 215, 10, 162, 129, 20, 131, + /* 10 */ 258, 2, 327, 3, 40, 62, 474, 325, 368, 329, + /* 20 */ 154, 643, 49, 22, 41, 827, 106, 355, 330, 327, + /* 30 */ 69, 83, 537, 324, 385, 37, 32, 5, 1, 530, + /* 40 */ 127, 168, 539, 14, 36, 37, 86, 352, 458, 123, + /* 50 */ 143, 371, 119, 554, 256, 3, 84, 221, 166, 20, + /* 60 */ 560, 21, 307, 256, 177, 380, 157, 156, 183, 843, + /* 70 */ 309, 121, 142, 351, 22, 133, 117, 47, 146, 125, + /* 80 */ 139, 161, 46, 351, 44, 8, 115, 73, 144, 103, + /* 90 */ 15, 386, 54, 152, 302, 357, 174, 219, 229, 135, + /* 100 */ 112, 143, 16, 150, 443, 148, 384, 257, 104, 225, + /* 110 */ 64, 9, 21, 106, 162, 129, 257, 131, 60, 111, + /* 120 */ 106, 363, 368, 142, 69, 67, 293, 154, 154, 455, + /* 130 */ 68, 355, 97, 220, 179, 227, 175, 62, 105, 325, + /* 140 */ 35, 17, 256, 13, 181, 43, 449, 193, 127, 103, + /* 150 */ 106, 327, 209, 779, 69, 371, 555, 123, 143, 324, + /* 160 */ 119, 297, 154, 66, 31, 70, 166, 174, 219, 295, + /* 170 */ 310, 340, 177, 106, 157, 156, 183, 185, 113, 121, + /* 180 */ 142, 332, 201, 133, 117, 285, 146, 125, 139, 161, + /* 190 */ 333, 106, 231, 95, 115, 257, 144, 553, 184, 357, + /* 200 */ 152, 152, 319, 553, 46, 337, 44, 135, 112, 341, + /* 210 */ 150, 150, 148, 148, 54, 334, 302, 104, 64, 260, + /* 220 */ 146, 631, 106, 162, 129, 363, 131, 111, 172, 205, + /* 230 */ 144, 137, 780, 67, 331, 152, 299, 154, 68, 189, + /* 240 */ 60, 195, 179, 18, 175, 150, 105, 148, 174, 219, + /* 250 */ 238, 171, 181, 20, 172, 193, 552, 127, 317, 20, + /* 260 */ 106, 389, 552, 563, 73, 435, 123, 143, 22, 119, + /* 270 */ 424, 66, 106, 248, 22, 166, 20, 171, 6, 11, + /* 280 */ 4, 172, 197, 157, 156, 292, 113, 29, 121, 142, + /* 290 */ 250, 22, 133, 117, 172, 146, 125, 139, 161, 564, + /* 300 */ 797, 256, 169, 115, 171, 144, 21, 307, 69, 18, + /* 310 */ 152, 173, 21, 502, 368, 309, 135, 171, 353, 437, + /* 320 */ 150, 343, 148, 355, 20, 69, 104, 191, 169, 21, + /* 330 */ 440, 438, 162, 129, 20, 131, 489, 12, 228, 22, + /* 340 */ 241, 20, 350, 532, 277, 529, 154, 371, 583, 22, + /* 350 */ 172, 279, 531, 533, 257, 169, 22, 245, 69, 129, + /* 360 */ 172, 131, 483, 172, 778, 19, 127, 390, 169, 437, + /* 370 */ 242, 396, 154, 171, 315, 123, 143, 21, 119, 114, + /* 380 */ 440, 442, 392, 171, 166, 289, 171, 21, 65, 38, + /* 390 */ 342, 357, 157, 156, 21, 24, 788, 121, 142, 632, + /* 400 */ 567, 133, 117, 106, 146, 125, 139, 161, 246, 247, + /* 410 */ 575, 479, 115, 172, 144, 486, 450, 363, 52, 152, + /* 420 */ 653, 382, 381, 832, 169, 135, 481, 133, 137, 150, + /* 430 */ 146, 148, 104, 269, 169, 370, 171, 169, 162, 129, + /* 440 */ 144, 131, 174, 218, 411, 152, 423, 53, 270, 272, + /* 450 */ 266, 135, 154, 434, 172, 150, 420, 148, 316, 272, + /* 460 */ 322, 306, 172, 419, 270, 312, 106, 291, 272, 360, + /* 470 */ 283, 75, 127, 830, 270, 26, 412, 171, 272, 365, + /* 480 */ 409, 123, 143, 270, 119, 171, 58, 169, 91, 410, + /* 490 */ 166, 272, 374, 270, 272, 431, 528, 568, 157, 156, + /* 500 */ 710, 290, 473, 121, 142, 116, 270, 133, 117, 270, + /* 510 */ 146, 125, 139, 161, 655, 59, 473, 170, 115, 469, + /* 520 */ 144, 421, 716, 30, 239, 152, 106, 118, 169, 106, + /* 530 */ 540, 135, 413, 510, 120, 150, 169, 148, 122, 124, + /* 540 */ 106, 104, 213, 126, 128, 130, 132, 162, 129, 134, + /* 550 */ 131, 106, 136, 34, 138, 89, 141, 804, 106, 145, + /* 560 */ 147, 154, 106, 106, 149, 824, 217, 106, 106, 106, + /* 570 */ 106, 151, 153, 106, 155, 28, 106, 159, 106, 158, + /* 580 */ 106, 127, 163, 106, 106, 165, 217, 176, 106, 261, + /* 590 */ 123, 143, 268, 119, 69, 106, 106, 243, 106, 166, + /* 600 */ 178, 180, 182, 253, 190, 278, 106, 157, 156, 106, + /* 610 */ 217, 106, 121, 142, 192, 280, 133, 117, 658, 146, + /* 620 */ 125, 139, 161, 260, 106, 106, 106, 115, 106, 144, + /* 630 */ 314, 210, 212, 268, 152, 214, 416, 222, 106, 294, + /* 640 */ 135, 336, 224, 339, 150, 104, 148, 216, 235, 260, + /* 650 */ 240, 162, 129, 274, 131, 106, 106, 284, 346, 106, + /* 660 */ 335, 106, 338, 369, 268, 154, 106, 230, 69, 275, + /* 670 */ 268, 268, 106, 267, 106, 406, 268, 106, 414, 387, + /* 680 */ 819, 287, 69, 453, 405, 127, 313, 106, 415, 457, + /* 690 */ 463, 296, 416, 395, 123, 143, 470, 119, 418, 106, + /* 700 */ 418, 645, 275, 166, 820, 471, 73, 106, 69, 680, + /* 710 */ 710, 157, 156, 106, 323, 275, 121, 142, 455, 466, + /* 720 */ 133, 117, 444, 146, 125, 139, 161, 467, 470, 106, + /* 730 */ 69, 115, 73, 144, 239, 500, 39, 33, 152, 345, + /* 740 */ 569, 507, 42, 300, 135, 361, 275, 536, 150, 104, + /* 750 */ 148, 366, 375, 508, 10, 162, 129, 432, 131, 680, + /* 760 */ 45, 796, 570, 574, 48, 543, 535, 7, 51, 154, + /* 770 */ 680, 50, 55, 464, 56, 63, 584, 472, 585, 521, + /* 780 */ 57, 23, 680, 73, 61, 515, 388, 71, 74, 127, + /* 790 */ 72, 490, 239, 76, 549, 77, 236, 478, 123, 143, + /* 800 */ 25, 119, 79, 78, 234, 93, 80, 166, 82, 511, + /* 810 */ 85, 81, 88, 87, 90, 157, 156, 92, 94, 96, + /* 820 */ 121, 142, 100, 512, 133, 117, 98, 146, 125, 139, + /* 830 */ 161, 99, 101, 102, 10, 115, 137, 144, 107, 108, + /* 840 */ 104, 110, 152, 109, 140, 825, 162, 129, 135, 131, + /* 850 */ 154, 526, 150, 160, 148, 167, 514, 659, 27, 660, + /* 860 */ 154, 661, 73, 211, 186, 187, 188, 194, 177, 198, + /* 870 */ 196, 199, 183, 200, 202, 203, 206, 204, 208, 495, + /* 880 */ 127, 207, 524, 233, 226, 237, 217, 244, 232, 123, + /* 890 */ 143, 249, 119, 252, 262, 251, 254, 275, 166, 255, + /* 900 */ 259, 273, 264, 263, 112, 265, 157, 156, 276, 281, + /* 910 */ 271, 121, 142, 288, 64, 133, 117, 282, 146, 125, + /* 920 */ 139, 161, 298, 111, 303, 301, 115, 321, 144, 67, + /* 930 */ 304, 344, 308, 152, 68, 326, 348, 328, 179, 135, + /* 940 */ 175, 306, 105, 150, 349, 148, 104, 305, 181, 311, + /* 950 */ 318, 193, 162, 129, 320, 131, 358, 347, 356, 359, + /* 960 */ 372, 364, 373, 376, 362, 383, 154, 66, 367, 354, + /* 970 */ 377, 49, 391, 379, 378, 393, 394, 397, 400, 401, + /* 980 */ 398, 402, 113, 407, 781, 812, 127, 403, 404, 408, + /* 990 */ 817, 818, 399, 417, 422, 123, 143, 426, 119, 425, + /* 1000 */ 427, 429, 428, 430, 166, 786, 433, 787, 436, 439, + /* 1010 */ 811, 441, 157, 156, 826, 446, 444, 121, 142, 447, + /* 1020 */ 448, 133, 117, 445, 146, 125, 139, 161, 452, 828, + /* 1030 */ 454, 451, 115, 456, 144, 459, 462, 460, 461, 152, + /* 1040 */ 465, 468, 829, 475, 476, 135, 831, 485, 480, 150, + /* 1050 */ 652, 148, 164, 477, 482, 654, 484, 794, 162, 129, + /* 1060 */ 487, 131, 488, 491, 837, 492, 493, 709, 498, 712, + /* 1070 */ 494, 497, 154, 496, 503, 499, 501, 504, 505, 506, + /* 1080 */ 509, 513, 715, 717, 718, 519, 522, 518, 516, 517, + /* 1090 */ 520, 523, 127, 795, 527, 525, 798, 534, 799, 800, + /* 1100 */ 801, 123, 143, 802, 119, 805, 807, 541, 808, 538, + /* 1110 */ 166, 806, 542, 803, 548, 545, 546, 507, 157, 156, + /* 1120 */ 507, 544, 838, 121, 142, 841, 547, 133, 117, 550, + /* 1130 */ 146, 125, 139, 161, 551, 507, 507, 507, 115, 507, + /* 1140 */ 144, 507, 507, 507, 507, 152, 507, 507, 507, 507, + /* 1150 */ 507, 135, 507, 507, 507, 150, 507, 148, 223, 507, + /* 1160 */ 507, 507, 507, 507, 162, 129, 507, 131, 507, 507, + /* 1170 */ 507, 507, 507, 507, 507, 507, 507, 507, 154, 507, + /* 1180 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + /* 1190 */ 507, 507, 507, 507, 507, 507, 507, 507, 127, 507, + /* 1200 */ 507, 507, 507, 507, 507, 507, 507, 123, 143, 507, + /* 1210 */ 119, 507, 507, 507, 507, 507, 166, 507, 507, 507, + /* 1220 */ 507, 507, 507, 507, 157, 156, 507, 507, 507, 121, + /* 1230 */ 142, 507, 507, 133, 117, 507, 146, 125, 139, 161, + /* 1240 */ 507, 507, 507, 507, 115, 507, 144, 507, 507, 507, + /* 1250 */ 507, 152, 507, 507, 507, 507, 507, 135, 507, 507, + /* 1260 */ 507, 150, 507, 148, 104, 507, 507, 507, 507, 507, + /* 1270 */ 162, 129, 507, 131, 507, 507, 507, 507, 507, 507, + /* 1280 */ 507, 507, 507, 507, 154, 507, 507, 507, 507, 507, + /* 1290 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + /* 1300 */ 507, 507, 507, 507, 127, 507, 507, 507, 507, 507, + /* 1310 */ 507, 507, 507, 123, 143, 507, 119, 507, 507, 507, + /* 1320 */ 507, 507, 166, 507, 507, 507, 507, 507, 507, 507, + /* 1330 */ 157, 156, 507, 507, 507, 121, 142, 507, 507, 133, + /* 1340 */ 117, 507, 146, 125, 139, 161, 507, 162, 129, 507, + /* 1350 */ 131, 507, 144, 507, 507, 507, 507, 152, 507, 507, + /* 1360 */ 507, 154, 507, 135, 507, 507, 507, 150, 507, 148, + /* 1370 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + /* 1380 */ 507, 127, 507, 507, 507, 507, 507, 507, 507, 507, + /* 1390 */ 123, 143, 507, 119, 507, 507, 507, 507, 507, 166, + /* 1400 */ 507, 507, 507, 507, 507, 177, 507, 157, 156, 183, + /* 1410 */ 507, 507, 121, 142, 507, 507, 133, 117, 507, 146, + /* 1420 */ 125, 139, 161, 177, 507, 507, 507, 183, 507, 144, + /* 1430 */ 507, 507, 507, 507, 152, 507, 507, 507, 507, 507, + /* 1440 */ 135, 112, 507, 507, 150, 507, 148, 507, 507, 507, + /* 1450 */ 507, 64, 507, 507, 507, 507, 507, 507, 507, 112, + /* 1460 */ 111, 507, 507, 507, 507, 507, 67, 507, 507, 64, + /* 1470 */ 507, 68, 507, 507, 507, 179, 507, 175, 111, 105, + /* 1480 */ 507, 507, 507, 507, 67, 181, 507, 507, 193, 68, + /* 1490 */ 507, 507, 507, 179, 507, 175, 507, 105, 129, 507, + /* 1500 */ 131, 507, 286, 181, 66, 507, 193, 507, 507, 507, + /* 1510 */ 507, 154, 507, 507, 507, 507, 507, 507, 507, 113, + /* 1520 */ 507, 507, 66, 507, 507, 507, 507, 507, 507, 507, + /* 1530 */ 507, 507, 507, 507, 507, 507, 507, 113, 507, 507, + /* 1540 */ 123, 507, 507, 119, 507, 507, 507, 507, 507, 507, + /* 1550 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + /* 1560 */ 507, 507, 121, 507, 507, 507, 133, 117, 507, 146, + /* 1570 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 144, + /* 1580 */ 507, 507, 507, 507, 152, 507, 507, 507, 507, 507, + /* 1590 */ 135, 507, 507, 507, 150, 507, 148, }; -typedef struct yyStateEntry yyStateEntry; -static const yyStateEntry yyStateTable[] = { - { &yyActionTable[0], 6, 562 }, - { &yyActionTable[6], 5, 562 }, - { &yyActionTable[11], 0, 557 }, - { &yyActionTable[11], 22, 842 }, - { &yyActionTable[33], 1, 842 }, - { &yyActionTable[34], 0, 558 }, - { &yyActionTable[34], 1, 842 }, - { &yyActionTable[35], 2, 564 }, - { &yyActionTable[37], 3, 842 }, - { &yyActionTable[40], 1, 842 }, - { &yyActionTable[41], 1, 842 }, - { &yyActionTable[42], 6, 842 }, - { &yyActionTable[48], 0, 644 }, - { &yyActionTable[48], 0, 647 }, - { &yyActionTable[48], 0, 648 }, - { &yyActionTable[48], 0, 649 }, - { &yyActionTable[48], 0, 650 }, - { &yyActionTable[48], 0, 651 }, - { &yyActionTable[48], 4, 565 }, - { &yyActionTable[52], 0, 566 }, - { &yyActionTable[52], 0, 583 }, - { &yyActionTable[52], 0, 584 }, - { &yyActionTable[52], 0, 585 }, - { &yyActionTable[52], 3, 842 }, - { &yyActionTable[55], 1, 842 }, - { &yyActionTable[56], 3, 842 }, - { &yyActionTable[59], 1, 842 }, - { &yyActionTable[60], 3, 842 }, - { &yyActionTable[63], 1, 842 }, - { &yyActionTable[64], 3, 842 }, - { &yyActionTable[67], 1, 842 }, - { &yyActionTable[68], 7, 842 }, - { &yyActionTable[75], 3, 842 }, - { &yyActionTable[78], 1, 842 }, - { &yyActionTable[79], 1, 842 }, - { &yyActionTable[80], 13, 842 }, - { &yyActionTable[93], 0, 576 }, - { &yyActionTable[93], 5, 586 }, - { &yyActionTable[98], 1, 596 }, - { &yyActionTable[99], 13, 578 }, - { &yyActionTable[112], 0, 595 }, - { &yyActionTable[112], 4, 842 }, - { &yyActionTable[116], 10, 842 }, - { &yyActionTable[126], 0, 597 }, - { &yyActionTable[126], 2, 643 }, - { &yyActionTable[128], 0, 608 }, - { &yyActionTable[128], 2, 842 }, - { &yyActionTable[130], 2, 643 }, - { &yyActionTable[132], 0, 609 }, - { &yyActionTable[132], 2, 628 }, - { &yyActionTable[134], 0, 626 }, - { &yyActionTable[134], 2, 842 }, - { &yyActionTable[136], 0, 629 }, - { &yyActionTable[136], 0, 630 }, - { &yyActionTable[136], 1, 842 }, - { &yyActionTable[137], 3, 698 }, - { &yyActionTable[140], 2, 643 }, - { &yyActionTable[142], 0, 610 }, - { &yyActionTable[142], 0, 696 }, - { &yyActionTable[142], 0, 697 }, - { &yyActionTable[142], 2, 643 }, - { &yyActionTable[144], 0, 611 }, - { &yyActionTable[144], 1, 842 }, - { &yyActionTable[145], 15, 842 }, - { &yyActionTable[160], 2, 727 }, - { &yyActionTable[162], 18, 785 }, - { &yyActionTable[180], 1, 734 }, - { &yyActionTable[181], 1, 728 }, - { &yyActionTable[182], 18, 842 }, - { &yyActionTable[200], 0, 656 }, - { &yyActionTable[200], 5, 842 }, - { &yyActionTable[205], 2, 842 }, - { &yyActionTable[207], 0, 657 }, - { &yyActionTable[207], 3, 665 }, - { &yyActionTable[210], 2, 667 }, - { &yyActionTable[212], 3, 674 }, - { &yyActionTable[215], 2, 710 }, - { &yyActionTable[217], 2, 701 }, - { &yyActionTable[219], 2, 703 }, - { &yyActionTable[221], 2, 691 }, - { &yyActionTable[223], 2, 705 }, - { &yyActionTable[225], 0, 662 }, - { &yyActionTable[225], 1, 842 }, - { &yyActionTable[226], 2, 706 }, - { &yyActionTable[228], 1, 842 }, - { &yyActionTable[229], 0, 707 }, - { &yyActionTable[229], 1, 842 }, - { &yyActionTable[230], 0, 708 }, - { &yyActionTable[230], 1, 842 }, - { &yyActionTable[231], 17, 842 }, - { &yyActionTable[248], 1, 692 }, - { &yyActionTable[249], 16, 842 }, - { &yyActionTable[265], 2, 699 }, - { &yyActionTable[267], 3, 698 }, - { &yyActionTable[270], 0, 693 }, - { &yyActionTable[270], 2, 842 }, - { &yyActionTable[272], 0, 580 }, - { &yyActionTable[272], 0, 700 }, - { &yyActionTable[272], 28, 695 }, - { &yyActionTable[300], 0, 731 }, - { &yyActionTable[300], 15, 842 }, - { &yyActionTable[315], 0, 726 }, - { &yyActionTable[315], 1, 842 }, - { &yyActionTable[316], 4, 842 }, - { &yyActionTable[320], 1, 729 }, - { &yyActionTable[321], 4, 842 }, - { &yyActionTable[325], 0, 730 }, - { &yyActionTable[325], 26, 737 }, - { &yyActionTable[351], 15, 842 }, - { &yyActionTable[366], 27, 738 }, - { &yyActionTable[393], 15, 842 }, - { &yyActionTable[408], 12, 739 }, - { &yyActionTable[420], 15, 842 }, - { &yyActionTable[435], 12, 740 }, - { &yyActionTable[447], 15, 842 }, - { &yyActionTable[462], 12, 741 }, - { &yyActionTable[474], 15, 842 }, - { &yyActionTable[489], 12, 742 }, - { &yyActionTable[501], 15, 842 }, - { &yyActionTable[516], 16, 743 }, - { &yyActionTable[532], 15, 842 }, - { &yyActionTable[547], 16, 744 }, - { &yyActionTable[563], 15, 842 }, - { &yyActionTable[578], 8, 745 }, - { &yyActionTable[586], 15, 842 }, - { &yyActionTable[601], 8, 746 }, - { &yyActionTable[609], 15, 842 }, - { &yyActionTable[624], 8, 747 }, - { &yyActionTable[632], 15, 842 }, - { &yyActionTable[647], 8, 748 }, - { &yyActionTable[655], 15, 842 }, - { &yyActionTable[670], 16, 749 }, - { &yyActionTable[686], 6, 842 }, - { &yyActionTable[692], 15, 842 }, - { &yyActionTable[707], 16, 750 }, - { &yyActionTable[723], 0, 751 }, - { &yyActionTable[723], 0, 752 }, - { &yyActionTable[723], 15, 842 }, - { &yyActionTable[738], 6, 753 }, - { &yyActionTable[744], 15, 842 }, - { &yyActionTable[759], 6, 754 }, - { &yyActionTable[765], 15, 842 }, - { &yyActionTable[780], 3, 755 }, - { &yyActionTable[783], 15, 842 }, - { &yyActionTable[798], 3, 756 }, - { &yyActionTable[801], 15, 842 }, - { &yyActionTable[816], 3, 757 }, - { &yyActionTable[819], 15, 842 }, - { &yyActionTable[834], 2, 758 }, - { &yyActionTable[836], 0, 759 }, - { &yyActionTable[836], 2, 842 }, - { &yyActionTable[838], 0, 760 }, - { &yyActionTable[838], 1, 842 }, - { &yyActionTable[839], 0, 763 }, - { &yyActionTable[839], 0, 761 }, - { &yyActionTable[839], 15, 842 }, - { &yyActionTable[854], 28, 842 }, - { &yyActionTable[882], 15, 842 }, - { &yyActionTable[897], 16, 769 }, - { &yyActionTable[913], 1, 842 }, - { &yyActionTable[914], 20, 785 }, - { &yyActionTable[934], 5, 842 }, - { &yyActionTable[939], 2, 842 }, - { &yyActionTable[941], 1, 842 }, - { &yyActionTable[942], 1, 842 }, - { &yyActionTable[943], 1, 842 }, - { &yyActionTable[944], 0, 772 }, - { &yyActionTable[944], 28, 784 }, - { &yyActionTable[972], 0, 732 }, - { &yyActionTable[972], 0, 733 }, - { &yyActionTable[972], 15, 842 }, - { &yyActionTable[987], 26, 764 }, - { &yyActionTable[1013], 15, 842 }, - { &yyActionTable[1028], 2, 765 }, - { &yyActionTable[1030], 15, 842 }, - { &yyActionTable[1045], 2, 766 }, - { &yyActionTable[1047], 15, 842 }, - { &yyActionTable[1062], 2, 767 }, - { &yyActionTable[1064], 17, 842 }, - { &yyActionTable[1081], 29, 842 }, - { &yyActionTable[1110], 2, 842 }, - { &yyActionTable[1112], 4, 842 }, - { &yyActionTable[1116], 1, 842 }, - { &yyActionTable[1117], 0, 775 }, - { &yyActionTable[1117], 15, 842 }, - { &yyActionTable[1132], 29, 842 }, - { &yyActionTable[1161], 15, 842 }, - { &yyActionTable[1176], 28, 776 }, - { &yyActionTable[1204], 1, 842 }, - { &yyActionTable[1205], 4, 842 }, - { &yyActionTable[1209], 1, 842 }, - { &yyActionTable[1210], 0, 833 }, - { &yyActionTable[1210], 1, 842 }, - { &yyActionTable[1211], 4, 842 }, - { &yyActionTable[1215], 1, 842 }, - { &yyActionTable[1216], 0, 834 }, - { &yyActionTable[1216], 1, 842 }, - { &yyActionTable[1217], 4, 842 }, - { &yyActionTable[1221], 1, 842 }, - { &yyActionTable[1222], 0, 835 }, - { &yyActionTable[1222], 1, 842 }, - { &yyActionTable[1223], 4, 842 }, - { &yyActionTable[1227], 1, 842 }, - { &yyActionTable[1228], 0, 836 }, - { &yyActionTable[1228], 15, 842 }, - { &yyActionTable[1243], 29, 842 }, - { &yyActionTable[1272], 15, 842 }, - { &yyActionTable[1287], 29, 842 }, - { &yyActionTable[1316], 15, 842 }, - { &yyActionTable[1331], 28, 777 }, - { &yyActionTable[1359], 2, 842 }, - { &yyActionTable[1361], 0, 771 }, - { &yyActionTable[1361], 16, 785 }, - { &yyActionTable[1377], 0, 782 }, - { &yyActionTable[1377], 0, 783 }, - { &yyActionTable[1377], 0, 762 }, - { &yyActionTable[1377], 15, 842 }, - { &yyActionTable[1392], 28, 842 }, - { &yyActionTable[1420], 15, 842 }, - { &yyActionTable[1435], 26, 770 }, - { &yyActionTable[1461], 1, 842 }, - { &yyActionTable[1462], 20, 785 }, - { &yyActionTable[1482], 5, 842 }, - { &yyActionTable[1487], 0, 774 }, - { &yyActionTable[1487], 2, 842 }, - { &yyActionTable[1489], 0, 773 }, - { &yyActionTable[1489], 2, 699 }, - { &yyActionTable[1491], 3, 698 }, - { &yyActionTable[1494], 0, 694 }, - { &yyActionTable[1494], 15, 842 }, - { &yyActionTable[1509], 28, 704 }, - { &yyActionTable[1537], 1, 842 }, - { &yyActionTable[1538], 17, 785 }, - { &yyActionTable[1555], 1, 702 }, - { &yyActionTable[1556], 15, 842 }, - { &yyActionTable[1571], 28, 711 }, - { &yyActionTable[1599], 0, 666 }, - { &yyActionTable[1599], 2, 677 }, - { &yyActionTable[1601], 4, 675 }, - { &yyActionTable[1605], 0, 676 }, - { &yyActionTable[1605], 0, 682 }, - { &yyActionTable[1605], 0, 683 }, - { &yyActionTable[1605], 5, 842 }, - { &yyActionTable[1610], 0, 684 }, - { &yyActionTable[1610], 5, 842 }, - { &yyActionTable[1615], 0, 685 }, - { &yyActionTable[1615], 1, 842 }, - { &yyActionTable[1616], 0, 686 }, - { &yyActionTable[1616], 5, 842 }, - { &yyActionTable[1621], 2, 680 }, - { &yyActionTable[1623], 5, 673 }, - { &yyActionTable[1628], 0, 581 }, - { &yyActionTable[1628], 0, 582 }, - { &yyActionTable[1628], 4, 842 }, - { &yyActionTable[1632], 0, 671 }, - { &yyActionTable[1632], 0, 672 }, - { &yyActionTable[1632], 2, 688 }, - { &yyActionTable[1634], 2, 690 }, - { &yyActionTable[1636], 0, 678 }, - { &yyActionTable[1636], 1, 842 }, - { &yyActionTable[1637], 6, 842 }, - { &yyActionTable[1643], 2, 842 }, - { &yyActionTable[1645], 0, 689 }, - { &yyActionTable[1645], 5, 842 }, - { &yyActionTable[1650], 0, 791 }, - { &yyActionTable[1650], 3, 698 }, - { &yyActionTable[1653], 0, 793 }, - { &yyActionTable[1653], 0, 792 }, - { &yyActionTable[1653], 15, 842 }, - { &yyActionTable[1668], 28, 687 }, - { &yyActionTable[1696], 4, 842 }, - { &yyActionTable[1700], 0, 681 }, - { &yyActionTable[1700], 3, 842 }, - { &yyActionTable[1703], 5, 842 }, - { &yyActionTable[1708], 5, 673 }, - { &yyActionTable[1713], 2, 688 }, - { &yyActionTable[1715], 2, 690 }, - { &yyActionTable[1717], 0, 679 }, - { &yyActionTable[1717], 16, 842 }, - { &yyActionTable[1733], 33, 673 }, - { &yyActionTable[1766], 0, 668 }, - { &yyActionTable[1766], 0, 669 }, - { &yyActionTable[1766], 1, 842 }, - { &yyActionTable[1767], 5, 842 }, - { &yyActionTable[1772], 0, 670 }, - { &yyActionTable[1772], 0, 663 }, - { &yyActionTable[1772], 0, 664 }, - { &yyActionTable[1772], 0, 768 }, - { &yyActionTable[1772], 29, 842 }, - { &yyActionTable[1801], 0, 725 }, - { &yyActionTable[1801], 2, 842 }, - { &yyActionTable[1803], 0, 735 }, - { &yyActionTable[1803], 1, 842 }, - { &yyActionTable[1804], 0, 736 }, - { &yyActionTable[1804], 29, 842 }, - { &yyActionTable[1833], 2, 643 }, - { &yyActionTable[1835], 0, 612 }, - { &yyActionTable[1835], 4, 842 }, - { &yyActionTable[1839], 2, 789 }, - { &yyActionTable[1841], 1, 616 }, - { &yyActionTable[1842], 3, 613 }, - { &yyActionTable[1845], 0, 617 }, - { &yyActionTable[1845], 4, 842 }, - { &yyActionTable[1849], 0, 618 }, - { &yyActionTable[1849], 3, 842 }, - { &yyActionTable[1852], 4, 842 }, - { &yyActionTable[1856], 0, 619 }, - { &yyActionTable[1856], 2, 842 }, - { &yyActionTable[1858], 0, 622 }, - { &yyActionTable[1858], 0, 623 }, - { &yyActionTable[1858], 0, 624 }, - { &yyActionTable[1858], 0, 625 }, - { &yyActionTable[1858], 4, 842 }, - { &yyActionTable[1862], 0, 620 }, - { &yyActionTable[1862], 4, 842 }, - { &yyActionTable[1866], 0, 621 }, - { &yyActionTable[1866], 6, 842 }, - { &yyActionTable[1872], 2, 842 }, - { &yyActionTable[1874], 0, 790 }, - { &yyActionTable[1874], 0, 614 }, - { &yyActionTable[1874], 2, 842 }, - { &yyActionTable[1876], 0, 615 }, - { &yyActionTable[1876], 2, 628 }, - { &yyActionTable[1878], 0, 627 }, - { &yyActionTable[1878], 0, 598 }, - { &yyActionTable[1878], 7, 842 }, - { &yyActionTable[1885], 0, 599 }, - { &yyActionTable[1885], 0, 600 }, - { &yyActionTable[1885], 0, 601 }, - { &yyActionTable[1885], 2, 842 }, - { &yyActionTable[1887], 0, 602 }, - { &yyActionTable[1887], 0, 605 }, - { &yyActionTable[1887], 2, 842 }, - { &yyActionTable[1889], 0, 603 }, - { &yyActionTable[1889], 0, 606 }, - { &yyActionTable[1889], 0, 604 }, - { &yyActionTable[1889], 0, 607 }, - { &yyActionTable[1889], 4, 587 }, - { &yyActionTable[1893], 4, 842 }, - { &yyActionTable[1897], 2, 842 }, - { &yyActionTable[1899], 0, 588 }, - { &yyActionTable[1899], 4, 842 }, - { &yyActionTable[1903], 1, 842 }, - { &yyActionTable[1904], 0, 589 }, - { &yyActionTable[1904], 0, 592 }, - { &yyActionTable[1904], 1, 842 }, - { &yyActionTable[1905], 0, 593 }, - { &yyActionTable[1905], 1, 842 }, - { &yyActionTable[1906], 0, 594 }, - { &yyActionTable[1906], 0, 591 }, - { &yyActionTable[1906], 0, 590 }, - { &yyActionTable[1906], 0, 579 }, - { &yyActionTable[1906], 8, 842 }, - { &yyActionTable[1914], 6, 842 }, - { &yyActionTable[1920], 0, 633 }, - { &yyActionTable[1920], 4, 842 }, - { &yyActionTable[1924], 0, 636 }, - { &yyActionTable[1924], 1, 842 }, - { &yyActionTable[1925], 1, 842 }, - { &yyActionTable[1926], 6, 842 }, - { &yyActionTable[1932], 2, 842 }, - { &yyActionTable[1934], 2, 643 }, - { &yyActionTable[1936], 0, 637 }, - { &yyActionTable[1936], 1, 842 }, - { &yyActionTable[1937], 6, 842 }, - { &yyActionTable[1943], 2, 842 }, - { &yyActionTable[1945], 2, 643 }, - { &yyActionTable[1947], 0, 638 }, - { &yyActionTable[1947], 15, 842 }, - { &yyActionTable[1962], 30, 643 }, - { &yyActionTable[1992], 0, 639 }, - { &yyActionTable[1992], 1, 842 }, - { &yyActionTable[1993], 1, 842 }, - { &yyActionTable[1994], 6, 842 }, - { &yyActionTable[2000], 2, 842 }, - { &yyActionTable[2002], 1, 842 }, - { &yyActionTable[2003], 4, 842 }, - { &yyActionTable[2007], 2, 789 }, - { &yyActionTable[2009], 1, 616 }, - { &yyActionTable[2010], 7, 641 }, - { &yyActionTable[2017], 1, 842 }, - { &yyActionTable[2018], 0, 640 }, - { &yyActionTable[2018], 0, 642 }, - { &yyActionTable[2018], 0, 634 }, - { &yyActionTable[2018], 0, 635 }, - { &yyActionTable[2018], 0, 577 }, - { &yyActionTable[2018], 3, 842 }, - { &yyActionTable[2021], 5, 842 }, - { &yyActionTable[2026], 3, 573 }, - { &yyActionTable[2029], 6, 842 }, - { &yyActionTable[2035], 4, 842 }, - { &yyActionTable[2039], 0, 571 }, - { &yyActionTable[2039], 4, 842 }, - { &yyActionTable[2043], 1, 842 }, - { &yyActionTable[2044], 3, 842 }, - { &yyActionTable[2047], 5, 842 }, - { &yyActionTable[2052], 1, 842 }, - { &yyActionTable[2053], 4, 842 }, - { &yyActionTable[2057], 1, 842 }, - { &yyActionTable[2058], 4, 842 }, - { &yyActionTable[2062], 3, 842 }, - { &yyActionTable[2065], 1, 842 }, - { &yyActionTable[2066], 6, 842 }, - { &yyActionTable[2072], 2, 842 }, - { &yyActionTable[2074], 3, 842 }, - { &yyActionTable[2077], 1, 842 }, - { &yyActionTable[2078], 1, 842 }, - { &yyActionTable[2079], 4, 842 }, - { &yyActionTable[2083], 4, 816 }, - { &yyActionTable[2087], 4, 842 }, - { &yyActionTable[2091], 1, 842 }, - { &yyActionTable[2092], 4, 842 }, - { &yyActionTable[2096], 2, 680 }, - { &yyActionTable[2098], 2, 821 }, - { &yyActionTable[2100], 3, 842 }, - { &yyActionTable[2103], 1, 842 }, - { &yyActionTable[2104], 15, 842 }, - { &yyActionTable[2119], 29, 842 }, - { &yyActionTable[2148], 1, 842 }, - { &yyActionTable[2149], 2, 842 }, - { &yyActionTable[2151], 0, 822 }, - { &yyActionTable[2151], 0, 823 }, - { &yyActionTable[2151], 1, 842 }, - { &yyActionTable[2152], 1, 842 }, - { &yyActionTable[2153], 2, 842 }, - { &yyActionTable[2155], 5, 842 }, - { &yyActionTable[2160], 2, 842 }, - { &yyActionTable[2162], 4, 842 }, - { &yyActionTable[2166], 0, 723 }, - { &yyActionTable[2166], 0, 724 }, - { &yyActionTable[2166], 0, 813 }, - { &yyActionTable[2166], 0, 814 }, - { &yyActionTable[2166], 1, 842 }, - { &yyActionTable[2167], 0, 815 }, - { &yyActionTable[2167], 0, 572 }, - { &yyActionTable[2167], 1, 842 }, - { &yyActionTable[2168], 9, 842 }, - { &yyActionTable[2177], 5, 842 }, - { &yyActionTable[2182], 1, 842 }, - { &yyActionTable[2183], 1, 842 }, - { &yyActionTable[2184], 1, 842 }, - { &yyActionTable[2185], 9, 842 }, - { &yyActionTable[2194], 1, 842 }, - { &yyActionTable[2195], 2, 645 }, - { &yyActionTable[2197], 6, 842 }, - { &yyActionTable[2203], 0, 646 }, - { &yyActionTable[2203], 4, 842 }, - { &yyActionTable[2207], 1, 842 }, - { &yyActionTable[2208], 5, 842 }, - { &yyActionTable[2213], 4, 842 }, - { &yyActionTable[2217], 4, 842 }, - { &yyActionTable[2221], 1, 842 }, - { &yyActionTable[2222], 15, 842 }, - { &yyActionTable[2237], 28, 713 }, - { &yyActionTable[2265], 1, 842 }, - { &yyActionTable[2266], 1, 842 }, - { &yyActionTable[2267], 15, 842 }, - { &yyActionTable[2282], 28, 714 }, - { &yyActionTable[2310], 3, 842 }, - { &yyActionTable[2313], 1, 842 }, - { &yyActionTable[2314], 4, 842 }, - { &yyActionTable[2318], 2, 721 }, - { &yyActionTable[2320], 5, 842 }, - { &yyActionTable[2325], 2, 842 }, - { &yyActionTable[2327], 0, 722 }, - { &yyActionTable[2327], 4, 842 }, - { &yyActionTable[2331], 5, 842 }, - { &yyActionTable[2336], 1, 842 }, - { &yyActionTable[2337], 16, 842 }, - { &yyActionTable[2353], 2, 842 }, - { &yyActionTable[2355], 15, 842 }, - { &yyActionTable[2370], 28, 719 }, - { &yyActionTable[2398], 1, 842 }, - { &yyActionTable[2399], 28, 720 }, - { &yyActionTable[2427], 1, 842 }, - { &yyActionTable[2428], 4, 842 }, - { &yyActionTable[2432], 3, 842 }, - { &yyActionTable[2435], 1, 842 }, - { &yyActionTable[2436], 4, 842 }, - { &yyActionTable[2440], 4, 842 }, - { &yyActionTable[2444], 1, 842 }, - { &yyActionTable[2445], 4, 842 }, - { &yyActionTable[2449], 1, 842 }, - { &yyActionTable[2450], 4, 842 }, - { &yyActionTable[2454], 3, 842 }, - { &yyActionTable[2457], 1, 842 }, - { &yyActionTable[2458], 4, 842 }, - { &yyActionTable[2462], 3, 842 }, - { &yyActionTable[2465], 1, 842 }, - { &yyActionTable[2466], 5, 842 }, - { &yyActionTable[2471], 1, 842 }, - { &yyActionTable[2472], 4, 842 }, - { &yyActionTable[2476], 2, 680 }, - { &yyActionTable[2478], 3, 842 }, - { &yyActionTable[2481], 1, 842 }, - { &yyActionTable[2482], 2, 645 }, - { &yyActionTable[2484], 4, 842 }, - { &yyActionTable[2488], 3, 842 }, - { &yyActionTable[2491], 1, 842 }, - { &yyActionTable[2492], 5, 842 }, - { &yyActionTable[2497], 4, 842 }, - { &yyActionTable[2501], 1, 842 }, - { &yyActionTable[2502], 1, 842 }, - { &yyActionTable[2503], 4, 842 }, - { &yyActionTable[2507], 2, 680 }, - { &yyActionTable[2509], 2, 721 }, - { &yyActionTable[2511], 4, 842 }, - { &yyActionTable[2515], 5, 842 }, - { &yyActionTable[2520], 1, 842 }, - { &yyActionTable[2521], 16, 842 }, - { &yyActionTable[2537], 2, 842 }, - { &yyActionTable[2539], 1, 842 }, - { &yyActionTable[2540], 3, 842 }, - { &yyActionTable[2543], 1, 842 }, - { &yyActionTable[2544], 1, 842 }, - { &yyActionTable[2545], 2, 645 }, - { &yyActionTable[2547], 4, 842 }, - { &yyActionTable[2551], 3, 842 }, - { &yyActionTable[2554], 1, 842 }, - { &yyActionTable[2555], 4, 842 }, - { &yyActionTable[2559], 2, 842 }, - { &yyActionTable[2561], 1, 842 }, - { &yyActionTable[2562], 1, 842 }, - { &yyActionTable[2563], 1, 842 }, - { &yyActionTable[2564], 5, 842 }, - { &yyActionTable[2569], 1, 842 }, - { &yyActionTable[2570], 3, 842 }, - { &yyActionTable[2573], 3, 842 }, - { &yyActionTable[2576], 10, 810 }, - { &yyActionTable[2586], 1, 842 }, - { &yyActionTable[2587], 1, 842 }, - { &yyActionTable[2588], 1, 842 }, - { &yyActionTable[2589], 1, 842 }, - { &yyActionTable[2590], 3, 842 }, - { &yyActionTable[2593], 1, 842 }, - { &yyActionTable[2594], 1, 842 }, - { &yyActionTable[2595], 1, 842 }, - { &yyActionTable[2596], 3, 842 }, - { &yyActionTable[2599], 1, 842 }, - { &yyActionTable[2600], 0, 809 }, - { &yyActionTable[2600], 4, 842 }, - { &yyActionTable[2604], 1, 842 }, - { &yyActionTable[2605], 1, 842 }, - { &yyActionTable[2606], 2, 840 }, - { &yyActionTable[2608], 3, 842 }, - { &yyActionTable[2611], 1, 842 }, - { &yyActionTable[2612], 4, 842 }, - { &yyActionTable[2616], 1, 842 }, - { &yyActionTable[2617], 0, 839 }, - { &yyActionTable[2617], 2, 840 }, - { &yyActionTable[2619], 4, 842 }, - { &yyActionTable[2623], 1, 842 }, - { &yyActionTable[2624], 0, 559 }, - { &yyActionTable[2624], 0, 561 }, - { &yyActionTable[2624], 0, 556 }, +static YYCODETYPE yy_lookahead[] = { + /* 0 */ 5, 6, 157, 158, 159, 90, 11, 12, 59, 14, + /* 10 */ 6, 154, 32, 156, 132, 18, 34, 20, 18, 137, + /* 20 */ 25, 106, 32, 74, 27, 43, 181, 27, 31, 32, + /* 30 */ 185, 68, 83, 151, 142, 143, 144, 106, 139, 90, + /* 40 */ 45, 196, 93, 1, 142, 143, 83, 145, 66, 54, + /* 50 */ 55, 51, 57, 154, 59, 156, 93, 11, 63, 59, + /* 60 */ 106, 112, 82, 59, 13, 85, 71, 72, 17, 170, + /* 70 */ 90, 76, 77, 181, 74, 80, 81, 87, 83, 84, + /* 80 */ 85, 86, 85, 181, 87, 206, 91, 105, 93, 157, + /* 90 */ 48, 6, 95, 98, 97, 95, 157, 158, 159, 104, + /* 100 */ 49, 55, 60, 108, 122, 110, 204, 112, 5, 63, + /* 110 */ 59, 184, 112, 181, 11, 12, 112, 14, 121, 68, + /* 120 */ 181, 121, 18, 77, 185, 74, 157, 25, 25, 181, + /* 130 */ 79, 27, 200, 87, 83, 196, 85, 18, 87, 20, + /* 140 */ 22, 99, 59, 101, 93, 137, 198, 96, 45, 157, + /* 150 */ 181, 32, 42, 43, 185, 51, 0, 54, 55, 151, + /* 160 */ 57, 110, 25, 112, 79, 196, 63, 157, 158, 159, + /* 170 */ 34, 49, 13, 181, 71, 72, 17, 136, 127, 76, + /* 180 */ 77, 59, 1, 80, 81, 131, 83, 84, 85, 86, + /* 190 */ 68, 181, 200, 201, 91, 112, 93, 47, 157, 95, + /* 200 */ 98, 98, 66, 47, 85, 83, 87, 104, 49, 87, + /* 210 */ 108, 108, 110, 110, 95, 93, 97, 5, 59, 165, + /* 220 */ 83, 103, 181, 11, 12, 121, 14, 68, 46, 48, + /* 230 */ 93, 177, 129, 74, 112, 98, 157, 25, 79, 129, + /* 240 */ 121, 60, 83, 116, 85, 108, 87, 110, 157, 158, + /* 250 */ 159, 69, 93, 59, 46, 96, 106, 45, 122, 59, + /* 260 */ 181, 205, 106, 106, 105, 209, 54, 55, 74, 57, + /* 270 */ 214, 112, 181, 73, 74, 63, 59, 69, 138, 26, + /* 280 */ 140, 46, 101, 71, 72, 103, 127, 147, 76, 77, + /* 290 */ 73, 74, 80, 81, 46, 83, 84, 85, 86, 106, + /* 300 */ 106, 59, 120, 91, 69, 93, 112, 82, 185, 116, + /* 310 */ 98, 103, 112, 173, 18, 90, 104, 69, 22, 196, + /* 320 */ 108, 79, 110, 27, 59, 185, 5, 115, 120, 112, + /* 330 */ 207, 208, 11, 12, 59, 14, 196, 193, 103, 74, + /* 340 */ 22, 59, 165, 179, 79, 181, 25, 51, 39, 74, + /* 350 */ 46, 103, 188, 189, 112, 120, 74, 22, 185, 12, + /* 360 */ 46, 14, 64, 46, 43, 181, 45, 113, 120, 196, + /* 370 */ 52, 117, 25, 69, 16, 54, 55, 112, 57, 157, + /* 380 */ 207, 208, 128, 69, 63, 110, 69, 112, 79, 212, + /* 390 */ 213, 95, 71, 72, 112, 206, 64, 76, 77, 103, + /* 400 */ 106, 80, 81, 181, 83, 84, 85, 86, 73, 74, + /* 410 */ 106, 113, 91, 46, 93, 117, 22, 121, 33, 98, + /* 420 */ 106, 151, 152, 106, 120, 104, 128, 80, 177, 108, + /* 430 */ 83, 110, 5, 166, 120, 184, 69, 120, 11, 12, + /* 440 */ 93, 14, 157, 158, 34, 98, 114, 62, 181, 166, + /* 450 */ 167, 104, 25, 121, 46, 108, 2, 110, 100, 166, + /* 460 */ 167, 191, 46, 9, 181, 107, 181, 4, 166, 167, + /* 470 */ 194, 195, 45, 106, 181, 206, 66, 69, 166, 167, + /* 480 */ 102, 54, 55, 181, 57, 69, 7, 120, 22, 111, + /* 490 */ 63, 166, 167, 181, 166, 167, 45, 106, 71, 72, + /* 500 */ 106, 38, 157, 76, 77, 157, 181, 80, 81, 181, + /* 510 */ 83, 84, 85, 86, 106, 36, 157, 4, 91, 174, + /* 520 */ 93, 67, 106, 148, 130, 98, 181, 157, 120, 181, + /* 530 */ 79, 104, 122, 174, 157, 108, 120, 110, 157, 157, + /* 540 */ 181, 5, 115, 157, 157, 157, 157, 11, 12, 157, + /* 550 */ 14, 181, 157, 103, 157, 89, 157, 106, 181, 157, + /* 560 */ 157, 25, 181, 181, 157, 10, 22, 181, 181, 181, + /* 570 */ 181, 157, 157, 181, 157, 206, 181, 85, 181, 87, + /* 580 */ 181, 45, 157, 181, 181, 157, 22, 157, 181, 131, + /* 590 */ 54, 55, 22, 57, 185, 181, 181, 197, 181, 63, + /* 600 */ 157, 157, 157, 203, 157, 196, 181, 71, 72, 181, + /* 610 */ 22, 181, 76, 77, 157, 131, 80, 81, 105, 83, + /* 620 */ 84, 85, 86, 165, 181, 181, 181, 91, 181, 93, + /* 630 */ 31, 157, 157, 22, 98, 157, 22, 157, 181, 103, + /* 640 */ 104, 49, 157, 49, 108, 5, 110, 103, 157, 165, + /* 650 */ 157, 11, 12, 157, 14, 181, 181, 157, 22, 181, + /* 660 */ 68, 181, 68, 157, 22, 25, 181, 103, 185, 39, + /* 670 */ 22, 22, 181, 103, 181, 157, 22, 181, 88, 196, + /* 680 */ 90, 181, 185, 157, 129, 45, 87, 181, 171, 157, + /* 690 */ 171, 103, 22, 196, 54, 55, 22, 57, 181, 181, + /* 700 */ 181, 70, 39, 63, 90, 157, 105, 181, 185, 79, + /* 710 */ 106, 71, 72, 181, 103, 39, 76, 77, 181, 196, + /* 720 */ 80, 81, 91, 83, 84, 85, 86, 126, 22, 181, + /* 730 */ 185, 91, 105, 93, 130, 198, 133, 146, 98, 103, + /* 740 */ 106, 196, 181, 103, 104, 103, 39, 49, 108, 5, + /* 750 */ 110, 103, 103, 126, 90, 11, 12, 103, 14, 52, + /* 760 */ 184, 106, 106, 106, 184, 8, 68, 10, 65, 25, + /* 770 */ 107, 169, 75, 103, 202, 79, 39, 103, 39, 124, + /* 780 */ 184, 24, 106, 105, 184, 28, 29, 180, 153, 45, + /* 790 */ 185, 34, 130, 161, 37, 217, 56, 40, 54, 55, + /* 800 */ 43, 57, 163, 162, 58, 92, 187, 63, 78, 103, + /* 810 */ 68, 178, 199, 68, 199, 71, 72, 199, 15, 22, + /* 820 */ 76, 77, 20, 66, 80, 81, 141, 83, 84, 85, + /* 830 */ 86, 202, 59, 164, 90, 91, 177, 93, 39, 181, + /* 840 */ 5, 181, 98, 39, 177, 10, 11, 12, 104, 14, + /* 850 */ 25, 94, 108, 87, 110, 79, 99, 105, 101, 105, + /* 860 */ 25, 105, 105, 129, 135, 134, 43, 79, 13, 22, + /* 870 */ 103, 181, 17, 103, 22, 181, 22, 103, 103, 122, + /* 880 */ 45, 181, 125, 202, 79, 15, 22, 175, 141, 54, + /* 890 */ 55, 181, 57, 73, 183, 181, 181, 39, 63, 150, + /* 900 */ 181, 90, 124, 215, 49, 79, 71, 72, 181, 183, + /* 910 */ 202, 76, 77, 39, 59, 80, 81, 215, 83, 84, + /* 920 */ 85, 86, 103, 68, 181, 184, 91, 79, 93, 74, + /* 930 */ 168, 199, 181, 98, 79, 164, 103, 169, 83, 104, + /* 940 */ 85, 191, 87, 108, 165, 110, 5, 192, 93, 190, + /* 950 */ 190, 96, 11, 12, 190, 14, 75, 199, 181, 79, + /* 960 */ 75, 79, 79, 97, 184, 204, 25, 112, 184, 204, + /* 970 */ 181, 32, 181, 192, 168, 181, 6, 181, 90, 181, + /* 980 */ 211, 150, 127, 50, 129, 10, 45, 160, 216, 41, + /* 990 */ 90, 90, 210, 181, 88, 54, 55, 181, 57, 64, + /* 1000 */ 90, 150, 181, 79, 63, 106, 184, 64, 10, 43, + /* 1010 */ 106, 106, 71, 72, 43, 186, 91, 76, 77, 181, + /* 1020 */ 107, 80, 81, 193, 83, 84, 85, 86, 45, 106, + /* 1030 */ 217, 181, 91, 45, 93, 186, 79, 70, 181, 98, + /* 1040 */ 172, 79, 106, 52, 181, 104, 106, 150, 181, 108, + /* 1050 */ 106, 110, 5, 217, 181, 106, 181, 106, 11, 12, + /* 1060 */ 181, 14, 150, 52, 106, 181, 150, 106, 150, 106, + /* 1070 */ 217, 181, 25, 186, 70, 107, 217, 181, 150, 172, + /* 1080 */ 79, 186, 106, 70, 70, 52, 35, 150, 186, 181, + /* 1090 */ 181, 112, 45, 106, 165, 181, 106, 182, 106, 106, + /* 1100 */ 106, 54, 55, 106, 57, 106, 106, 181, 106, 182, + /* 1110 */ 63, 106, 103, 106, 30, 165, 6, 218, 71, 72, + /* 1120 */ 218, 149, 106, 76, 77, 106, 181, 80, 81, 149, + /* 1130 */ 83, 84, 85, 86, 181, 218, 218, 218, 91, 218, + /* 1140 */ 93, 218, 218, 218, 218, 98, 218, 218, 218, 218, + /* 1150 */ 218, 104, 218, 218, 218, 108, 218, 110, 5, 218, + /* 1160 */ 218, 218, 218, 218, 11, 12, 218, 14, 218, 218, + /* 1170 */ 218, 218, 218, 218, 218, 218, 218, 218, 25, 218, + /* 1180 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1190 */ 218, 218, 218, 218, 218, 218, 218, 218, 45, 218, + /* 1200 */ 218, 218, 218, 218, 218, 218, 218, 54, 55, 218, + /* 1210 */ 57, 218, 218, 218, 218, 218, 63, 218, 218, 218, + /* 1220 */ 218, 218, 218, 218, 71, 72, 218, 218, 218, 76, + /* 1230 */ 77, 218, 218, 80, 81, 218, 83, 84, 85, 86, + /* 1240 */ 218, 218, 218, 218, 91, 218, 93, 218, 218, 218, + /* 1250 */ 218, 98, 218, 218, 218, 218, 218, 104, 218, 218, + /* 1260 */ 218, 108, 218, 110, 5, 218, 218, 218, 218, 218, + /* 1270 */ 11, 12, 218, 14, 218, 218, 218, 218, 218, 218, + /* 1280 */ 218, 218, 218, 218, 25, 218, 218, 218, 218, 218, + /* 1290 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1300 */ 218, 218, 218, 218, 45, 218, 218, 218, 218, 218, + /* 1310 */ 218, 218, 218, 54, 55, 218, 57, 218, 218, 218, + /* 1320 */ 218, 218, 63, 218, 218, 218, 218, 218, 218, 218, + /* 1330 */ 71, 72, 218, 218, 218, 76, 77, 218, 218, 80, + /* 1340 */ 81, 218, 83, 84, 85, 86, 218, 11, 12, 218, + /* 1350 */ 14, 218, 93, 218, 218, 218, 218, 98, 218, 218, + /* 1360 */ 218, 25, 218, 104, 218, 218, 218, 108, 218, 110, + /* 1370 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1380 */ 218, 45, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1390 */ 54, 55, 218, 57, 218, 218, 218, 218, 218, 63, + /* 1400 */ 218, 218, 218, 218, 218, 13, 218, 71, 72, 17, + /* 1410 */ 218, 218, 76, 77, 218, 218, 80, 81, 218, 83, + /* 1420 */ 84, 85, 86, 13, 218, 218, 218, 17, 218, 93, + /* 1430 */ 218, 218, 218, 218, 98, 218, 218, 218, 218, 218, + /* 1440 */ 104, 49, 218, 218, 108, 218, 110, 218, 218, 218, + /* 1450 */ 218, 59, 218, 218, 218, 218, 218, 218, 218, 49, + /* 1460 */ 68, 218, 218, 218, 218, 218, 74, 218, 218, 59, + /* 1470 */ 218, 79, 218, 218, 218, 83, 218, 85, 68, 87, + /* 1480 */ 218, 218, 218, 218, 74, 93, 218, 218, 96, 79, + /* 1490 */ 218, 218, 218, 83, 218, 85, 218, 87, 12, 218, + /* 1500 */ 14, 218, 110, 93, 112, 218, 96, 218, 218, 218, + /* 1510 */ 218, 25, 218, 218, 218, 218, 218, 218, 218, 127, + /* 1520 */ 218, 218, 112, 218, 218, 218, 218, 218, 218, 218, + /* 1530 */ 218, 218, 218, 218, 218, 218, 218, 127, 218, 218, + /* 1540 */ 54, 218, 218, 57, 218, 218, 218, 218, 218, 218, + /* 1550 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1560 */ 218, 218, 76, 218, 218, 218, 80, 81, 218, 83, + /* 1570 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 93, + /* 1580 */ 218, 218, 218, 218, 98, 218, 218, 218, 218, 218, + /* 1590 */ 104, 218, 218, 218, 108, 218, 110, }; +#define YY_SHIFT_USE_DFLT (-86) +static short yy_shift_ofst[] = { + /* 0 */ 150, 156, -86, 757, -69, -86, -46, 127, -85, 157, + /* 10 */ 253, 42, -86, -86, -86, -86, -86, -86, 282, -86, + /* 20 */ -86, -86, -86, 193, 294, 193, 391, 193, 634, 85, + /* 30 */ 656, 282, 118, 450, 657, 0, -86, 83, -86, -3, + /* 40 */ -86, 282, 119, -86, 664, -86, -10, 664, -86, 703, + /* 50 */ -86, 385, -86, -86, 697, 479, 664, -86, -86, -86, + /* 60 */ 664, -86, 696, 1410, 309, 51, 737, 739, 159, -86, + /* 70 */ 182, 678, -86, 463, -86, 318, 662, 740, 746, 713, + /* 80 */ 730, -86, -37, -86, 742, -86, 745, -86, 466, -37, + /* 90 */ -86, -37, -86, 803, 1410, 797, 1410, 802, 479, -86, + /* 100 */ 773, -86, -86, 941, 1410, -86, 799, 282, 804, 282, + /* 110 */ -86, -86, -86, -86, 1336, 1410, 1259, 1410, 347, 1410, + /* 120 */ 347, 1410, 347, 1410, 347, 1410, 1486, 1410, 1486, 1410, + /* 130 */ 137, 1410, 137, 1410, 137, 1410, 137, 1410, 1486, 46, + /* 140 */ 1410, 1486, -86, -86, 1410, 102, 1410, 102, 1410, 825, + /* 150 */ 1410, 825, 1410, 825, 1410, -86, -86, 492, -86, 766, + /* 160 */ -86, -86, 1410, 1047, 1410, 1486, 776, 159, 208, 513, + /* 170 */ 752, 754, 756, -86, 941, 1410, 1336, 1410, -86, 1410, + /* 180 */ -86, 1410, -86, 855, 103, 734, 110, 823, -86, 1410, + /* 190 */ 212, 1410, 941, 788, 181, 767, -86, 847, 282, 770, + /* 200 */ -86, 852, 282, 774, -86, 854, 282, 775, -86, 1410, + /* 210 */ 321, 1410, 427, 1410, 941, 544, -86, 1410, -86, -86, + /* 220 */ -86, 1410, 1153, 1410, 1336, 805, 159, 235, -86, 564, + /* 230 */ -86, 802, 479, -86, 1410, 941, 870, 1410, 864, 1410, + /* 240 */ 941, -86, -86, 335, -86, -86, -86, 200, -86, 217, + /* 250 */ -86, 820, -86, 265, 858, 4, -86, -86, 282, -86, + /* 260 */ -86, 811, 778, -86, 826, 282, 570, -86, 282, -86, + /* 270 */ 479, -86, -86, 1410, 941, 282, -86, 678, 248, 4, + /* 280 */ 811, 778, -86, 1392, -5, -86, -86, 874, 275, -86, + /* 290 */ -86, -86, -86, 536, -86, 588, -86, 819, -86, 640, + /* 300 */ 664, -86, 282, 848, -86, 225, -86, 282, -86, 136, + /* 310 */ 358, -86, 599, -86, -86, -86, -86, 358, -86, 358, + /* 320 */ -86, 282, 611, -86, -86, 773, -86, 703, -86, -86, + /* 330 */ 122, -86, -86, -86, 592, -86, -86, 594, -86, -86, + /* 340 */ -86, -86, 242, -37, 636, -86, -37, 833, -86, -86, + /* 350 */ -86, -86, 296, 104, -86, 282, -86, 881, 880, 282, + /* 360 */ 642, 664, -86, 882, 282, 648, 664, -86, 1410, 744, + /* 370 */ -86, 885, 883, 282, 649, 866, 282, 848, -86, -20, + /* 380 */ 939, -86, -86, -86, -86, -86, 678, 304, 332, 254, + /* 390 */ 282, -86, 282, 970, 678, 314, 282, 454, 410, 888, + /* 400 */ 282, 858, 933, 555, 975, 1410, 835, 948, 378, -86, + /* 410 */ -86, 900, 901, 590, 282, 614, 282, -86, -86, -86, + /* 420 */ -86, 906, -86, -86, 935, 282, 910, 282, 630, 924, + /* 430 */ 282, 654, -85, 899, 943, 998, -18, 317, 966, 904, + /* 440 */ 905, -18, 971, 925, 42, -86, 282, 913, 282, 394, + /* 450 */ 282, 983, 1410, 941, 923, 988, 1410, 941, 631, 967, + /* 460 */ 282, 957, 282, 670, -86, 601, 367, 962, 1410, 674, + /* 470 */ 1410, 941, 936, 941, 991, 282, 604, 940, 298, 282, + /* 480 */ 944, 282, 949, 282, 676, 951, 282, 676, 958, 408, + /* 490 */ 1011, 282, 858, 604, 961, 925, 282, 663, 968, 282, + /* 500 */ 394, 963, 1004, 282, 858, 957, 627, 416, 1001, 1410, + /* 510 */ 706, 976, 631, 1013, 1014, 925, 282, 707, 1033, 282, + /* 520 */ 655, 1051, 979, 987, 194, 990, 83, 451, -51, 992, + /* 530 */ 993, 994, 997, 698, 999, 1000, 1002, 698, 1005, -86, + /* 540 */ 282, 1009, 1007, 1084, 83, 1110, 282, 1016, -86, 1084, + /* 550 */ 282, 1019, -86, -86, -86, +}; +#define YY_REDUCE_USE_DFLT (-156) +static short yy_reduce_ofst[] = { + /* 0 */ -101, -143, -156, 140, -156, -156, -156, -121, -73, -156, + /* 10 */ -156, 144, -156, -156, -156, -156, -156, -156, 184, -156, + /* 20 */ -156, -156, -156, 189, -156, 269, -156, 369, -156, 375, + /* 30 */ -156, -108, 591, -156, -156, -98, -156, 177, 603, -118, + /* 40 */ -156, 561, 8, -156, 576, -156, -156, 580, -156, 602, + /* 50 */ -156, -156, -156, -156, -156, 572, 596, -156, -156, -156, + /* 60 */ 600, -156, -156, 79, -156, 10, -156, -156, -31, -156, + /* 70 */ 607, 605, -156, 635, 276, 632, 578, 641, 639, 619, + /* 80 */ 633, -156, 613, -156, -156, -156, -156, -156, -156, 615, + /* 90 */ -156, 618, -156, -156, -8, -156, -68, 685, 629, -156, + /* 100 */ 669, -156, -156, 659, 222, -156, -156, 658, -156, 660, + /* 110 */ -156, -156, -156, -156, 659, 348, 659, 370, 659, 377, + /* 120 */ 659, 381, 659, 382, 659, 386, 659, 387, 659, 388, + /* 130 */ 659, 389, 659, 392, 659, 395, 659, 397, 659, 667, + /* 140 */ 399, 659, -156, -156, 402, 659, 403, 659, 407, 659, + /* 150 */ 414, 659, 415, 659, 417, 659, -156, -156, -156, -156, + /* 160 */ -156, -156, 425, 659, 428, 659, -156, -155, 607, -156, + /* 170 */ -156, -156, -156, -156, 659, 430, 659, 443, 659, 444, + /* 180 */ 659, 445, 659, 41, 659, 729, 731, -156, -156, 447, + /* 190 */ 659, 457, 659, -156, -156, -156, -156, -156, 690, -156, + /* 200 */ -156, -156, 694, -156, -156, -156, 700, -156, -156, 474, + /* 210 */ 659, 475, 659, 478, 659, -156, -156, 285, -156, -156, + /* 220 */ -156, 480, 659, 485, 659, -156, -61, 607, -156, -156, + /* 230 */ -156, 747, 681, -156, 491, 659, -156, 91, -156, 493, + /* 240 */ 659, -156, 400, 712, -156, -156, -156, 710, -156, 714, + /* 250 */ -156, -156, -156, 715, 749, 458, -156, -156, 719, -156, + /* 260 */ -156, 711, 688, -156, -156, 283, -156, -156, 267, -156, + /* 270 */ 708, -156, -156, 496, 659, 727, -156, 409, 607, 484, + /* 280 */ 726, 702, -156, 500, 54, -156, -156, -156, 658, -156, + /* 290 */ -156, -156, -156, 659, -156, -156, -156, -156, -156, 659, + /* 300 */ 741, -156, 743, 762, 755, 750, -156, 751, -156, -156, + /* 310 */ 759, -156, -156, -156, -156, -156, -156, 760, -156, 764, + /* 320 */ -156, 293, -156, -156, -156, 771, -156, 768, -156, -156, + /* 330 */ -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + /* 340 */ -156, -156, 779, 732, -156, -156, 758, -156, -156, -156, + /* 350 */ -156, -156, 761, 765, -156, 777, -156, -156, -156, 302, + /* 360 */ -156, 780, -156, -156, 312, -156, 784, -156, 506, 251, + /* 370 */ -156, -156, -156, 325, -156, -156, 789, 806, 781, 270, + /* 380 */ -156, -156, -156, -156, -156, -156, 483, 607, 56, -156, + /* 390 */ 791, -156, 794, -156, 497, 607, 796, 769, 782, -156, + /* 400 */ 798, 831, 827, 772, -156, 518, 659, -156, -156, -156, + /* 410 */ -156, -156, -156, -156, 517, -156, 812, -156, -156, -156, + /* 420 */ -156, -156, -156, -156, -156, 816, -156, 821, 851, -156, + /* 430 */ 328, -156, 822, -156, -156, -156, 123, 607, -156, -156, + /* 440 */ -156, 173, -156, 829, 830, -156, 838, -156, -52, 813, + /* 450 */ 850, -156, 526, 659, -156, -156, 532, 659, 849, -156, + /* 460 */ 857, 868, 519, -156, -156, 523, 607, -156, 345, -156, + /* 470 */ 548, 659, -156, 659, -156, 863, 836, -156, -156, 867, + /* 480 */ -156, 873, -156, 875, 897, -156, 879, 912, -156, 607, + /* 490 */ -156, 884, 916, 853, -156, 887, 890, 918, -156, 537, + /* 500 */ 859, -156, -156, 896, 928, 907, 545, 607, -156, 359, + /* 510 */ -156, -156, 895, -156, -156, 902, 908, 937, -156, 909, + /* 520 */ -156, -156, -156, -156, 914, -156, 929, -156, 164, -156, + /* 530 */ -156, -156, -156, 915, -156, -156, -156, 927, -156, -156, + /* 540 */ 926, -156, -156, 972, 950, -156, 945, -156, -156, 980, + /* 550 */ 953, -156, -156, -156, -156, +}; +static YYACTIONTYPE yy_default[] = { + /* 0 */ 562, 562, 557, 842, 842, 558, 842, 564, 842, 842, + /* 10 */ 842, 842, 644, 647, 648, 649, 650, 651, 565, 566, + /* 20 */ 583, 584, 585, 842, 842, 842, 842, 842, 842, 842, + /* 30 */ 842, 842, 842, 842, 842, 842, 576, 586, 596, 578, + /* 40 */ 595, 842, 842, 597, 643, 608, 842, 643, 609, 628, + /* 50 */ 626, 842, 629, 630, 842, 698, 643, 610, 696, 697, + /* 60 */ 643, 611, 842, 842, 727, 785, 733, 728, 842, 656, + /* 70 */ 842, 842, 657, 665, 667, 674, 710, 701, 703, 691, + /* 80 */ 705, 662, 842, 592, 842, 593, 842, 594, 706, 842, + /* 90 */ 707, 842, 708, 842, 842, 692, 842, 699, 698, 693, + /* 100 */ 842, 580, 700, 695, 842, 726, 842, 842, 729, 842, + /* 110 */ 730, 731, 732, 734, 737, 842, 738, 842, 739, 842, + /* 120 */ 740, 842, 741, 842, 742, 842, 743, 842, 744, 842, + /* 130 */ 745, 842, 746, 842, 747, 842, 748, 842, 749, 842, + /* 140 */ 842, 750, 751, 752, 842, 753, 842, 754, 842, 755, + /* 150 */ 842, 756, 842, 757, 842, 758, 759, 842, 760, 842, + /* 160 */ 763, 761, 842, 842, 842, 769, 842, 785, 842, 842, + /* 170 */ 842, 842, 842, 772, 784, 842, 764, 842, 765, 842, + /* 180 */ 766, 842, 767, 842, 842, 842, 842, 842, 775, 842, + /* 190 */ 842, 842, 776, 842, 842, 842, 833, 842, 842, 842, + /* 200 */ 834, 842, 842, 842, 835, 842, 842, 842, 836, 842, + /* 210 */ 842, 842, 842, 842, 777, 842, 771, 785, 782, 783, + /* 220 */ 762, 842, 842, 842, 770, 842, 785, 842, 774, 842, + /* 230 */ 773, 699, 698, 694, 842, 704, 842, 785, 702, 842, + /* 240 */ 711, 666, 677, 675, 676, 682, 683, 842, 684, 842, + /* 250 */ 685, 842, 686, 842, 680, 673, 581, 582, 842, 671, + /* 260 */ 672, 688, 690, 678, 842, 842, 842, 689, 842, 791, + /* 270 */ 698, 793, 792, 842, 687, 842, 681, 842, 842, 673, + /* 280 */ 688, 690, 679, 842, 673, 668, 669, 842, 842, 670, + /* 290 */ 663, 664, 768, 842, 725, 842, 735, 842, 736, 842, + /* 300 */ 643, 612, 842, 789, 616, 613, 617, 842, 618, 842, + /* 310 */ 842, 619, 842, 622, 623, 624, 625, 842, 620, 842, + /* 320 */ 621, 842, 842, 790, 614, 842, 615, 628, 627, 598, + /* 330 */ 842, 599, 600, 601, 842, 602, 605, 842, 603, 606, + /* 340 */ 604, 607, 587, 842, 842, 588, 842, 842, 589, 591, + /* 350 */ 590, 579, 842, 842, 633, 842, 636, 842, 842, 842, + /* 360 */ 842, 643, 637, 842, 842, 842, 643, 638, 842, 643, + /* 370 */ 639, 842, 842, 842, 842, 842, 842, 789, 616, 641, + /* 380 */ 842, 640, 642, 634, 635, 577, 842, 842, 573, 842, + /* 390 */ 842, 571, 842, 842, 842, 842, 842, 816, 842, 842, + /* 400 */ 842, 680, 821, 842, 842, 842, 842, 842, 842, 822, + /* 410 */ 823, 842, 842, 842, 842, 842, 842, 723, 724, 813, + /* 420 */ 814, 842, 815, 572, 842, 842, 842, 842, 842, 842, + /* 430 */ 842, 842, 842, 842, 842, 842, 842, 842, 842, 842, + /* 440 */ 842, 842, 842, 645, 842, 646, 842, 842, 842, 842, + /* 450 */ 842, 842, 842, 713, 842, 842, 842, 714, 842, 842, + /* 460 */ 842, 721, 842, 842, 722, 842, 842, 842, 842, 842, + /* 470 */ 842, 719, 842, 720, 842, 842, 842, 842, 842, 842, + /* 480 */ 842, 842, 842, 842, 842, 842, 842, 842, 842, 842, + /* 490 */ 842, 842, 680, 842, 842, 645, 842, 842, 842, 842, + /* 500 */ 842, 842, 842, 842, 680, 721, 842, 842, 842, 842, + /* 510 */ 842, 842, 842, 842, 842, 645, 842, 842, 842, 842, + /* 520 */ 842, 842, 842, 842, 842, 842, 842, 842, 810, 842, + /* 530 */ 842, 842, 842, 842, 842, 842, 842, 842, 842, 809, + /* 540 */ 842, 842, 842, 840, 842, 842, 842, 842, 839, 840, + /* 550 */ 842, 842, 559, 561, 556, +}; +#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0])) /* The next table maps tokens into fallback tokens. If a construct ** like the following: @@ -3822,7 +730,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* FROM => nothing */ 0, /* FUNCTION => nothing */ 0, /* GE => nothing */ - 0, /* GLOB => nothing */ + 59, /* GLOB => ID */ 0, /* GROUP => nothing */ 0, /* GT => nothing */ 0, /* HAVING => nothing */ @@ -3844,7 +752,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* JOIN_KW => nothing */ 59, /* KEY => ID */ 0, /* LE => nothing */ - 0, /* LIKE => nothing */ + 59, /* LIKE => ID */ 0, /* LIMIT => nothing */ 0, /* LP => nothing */ 0, /* LSHIFT => nothing */ @@ -3859,7 +767,6 @@ static const YYCODETYPE yyFallback[] = { 59, /* OFFSET => ID */ 0, /* ON => nothing */ 0, /* OR => nothing */ - 0, /* ORACLE_OUTER_JOIN => nothing */ 0, /* ORDER => nothing */ 0, /* PLUS => nothing */ 59, /* PRAGMA => ID */ @@ -3895,6 +802,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* USING => nothing */ 59, /* VACUUM => ID */ 0, /* VALUES => nothing */ + 0, /* VARIABLE => nothing */ 59, /* VIEW => ID */ 0, /* WHEN => nothing */ 0, /* WHERE => nothing */ @@ -3927,7 +835,6 @@ typedef struct yyStackEntry yyStackEntry; struct yyParser { int yyidx; /* Index of top element in stack */ int yyerrcnt; /* Shifts left before out of the error */ - yyStackEntry *yytop; /* Pointer to the top stack element */ sqliteParserARG_SDECL /* A place to hold %extra_argument */ yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ }; @@ -3992,15 +899,15 @@ static const char *yyTokenName[] = { "LSHIFT", "LT", "MATCH", "MINUS", "NE", "NOT", "NOTNULL", "NULL", "OF", "OFFSET", "ON", "OR", - "ORACLE_OUTER_JOIN", "ORDER", "PLUS", "PRAGMA", - "PRIMARY", "RAISE", "REFERENCES", "REM", - "REPLACE", "RESTRICT", "ROLLBACK", "ROW", - "RP", "RSHIFT", "SELECT", "SEMI", - "SET", "SLASH", "SPACE", "STAR", - "STATEMENT", "STRING", "TABLE", "TEMP", - "THEN", "TRANSACTION", "TRIGGER", "UMINUS", - "UNCLOSED_STRING", "UNION", "UNIQUE", "UPDATE", - "UPLUS", "USING", "VACUUM", "VALUES", + "ORDER", "PLUS", "PRAGMA", "PRIMARY", + "RAISE", "REFERENCES", "REM", "REPLACE", + "RESTRICT", "ROLLBACK", "ROW", "RP", + "RSHIFT", "SELECT", "SEMI", "SET", + "SLASH", "SPACE", "STAR", "STATEMENT", + "STRING", "TABLE", "TEMP", "THEN", + "TRANSACTION", "TRIGGER", "UMINUS", "UNCLOSED_STRING", + "UNION", "UNIQUE", "UPDATE", "UPLUS", + "USING", "VACUUM", "VALUES", "VARIABLE", "VIEW", "WHEN", "WHERE", "as", "carg", "carglist", "case_else", "case_exprlist", "case_operand", "ccons", "cmd", "cmdlist", @@ -4182,9 +1089,9 @@ static const char *yyRuleName[] = { /* 148 */ "having_opt ::=", /* 149 */ "having_opt ::= HAVING expr", /* 150 */ "limit_opt ::=", - /* 151 */ "limit_opt ::= LIMIT INTEGER", - /* 152 */ "limit_opt ::= LIMIT INTEGER OFFSET INTEGER", - /* 153 */ "limit_opt ::= LIMIT INTEGER COMMA INTEGER", + /* 151 */ "limit_opt ::= LIMIT signed", + /* 152 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 153 */ "limit_opt ::= LIMIT signed COMMA signed", /* 154 */ "cmd ::= DELETE FROM nm dbnm where_opt", /* 155 */ "where_opt ::=", /* 156 */ "where_opt ::= WHERE expr", @@ -4207,10 +1114,10 @@ static const char *yyRuleName[] = { /* 173 */ "expr ::= JOIN_KW", /* 174 */ "expr ::= nm DOT nm", /* 175 */ "expr ::= nm DOT nm DOT nm", - /* 176 */ "expr ::= expr ORACLE_OUTER_JOIN", - /* 177 */ "expr ::= INTEGER", - /* 178 */ "expr ::= FLOAT", - /* 179 */ "expr ::= STRING", + /* 176 */ "expr ::= INTEGER", + /* 177 */ "expr ::= FLOAT", + /* 178 */ "expr ::= STRING", + /* 179 */ "expr ::= VARIABLE", /* 180 */ "expr ::= ID LP exprlist RP", /* 181 */ "expr ::= ID LP STAR RP", /* 182 */ "expr ::= expr AND expr", @@ -4262,7 +1169,7 @@ static const char *yyRuleName[] = { /* 228 */ "exprlist ::= expritem", /* 229 */ "expritem ::= expr", /* 230 */ "expritem ::=", - /* 231 */ "cmd ::= CREATE temp uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", + /* 231 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf", /* 232 */ "uniqueflag ::= UNIQUE", /* 233 */ "uniqueflag ::=", /* 234 */ "idxlist_opt ::=", @@ -4376,144 +1283,144 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ ** inside the C code. */ case 135: -#line 673 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 675 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4380 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1288 "parse.c" break; case 157: -#line 520 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 520 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4385 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1293 "parse.c" break; case 158: -#line 692 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 694 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4390 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1298 "parse.c" break; case 159: -#line 690 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 692 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4395 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1303 "parse.c" break; case 161: -#line 341 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 342 "parse.y" {sqliteSrcListDelete((yypminor->yy335));} -#line 4400 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1308 "parse.c" break; case 162: -#line 435 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 436 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4405 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1313 "parse.c" break; case 163: -#line 440 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 441 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4410 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1318 "parse.c" break; case 167: -#line 715 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 717 "parse.y" {sqliteIdListDelete((yypminor->yy92));} -#line 4415 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1323 "parse.c" break; case 168: -#line 717 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 719 "parse.y" {sqliteIdListDelete((yypminor->yy92));} -#line 4420 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1328 "parse.c" break; case 171: -#line 498 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 499 "parse.y" {sqliteIdListDelete((yypminor->yy92));} -#line 4425 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1333 "parse.c" break; case 172: -#line 496 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 497 "parse.y" {sqliteIdListDelete((yypminor->yy92));} -#line 4430 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1338 "parse.c" break; case 174: -#line 490 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 491 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4435 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1343 "parse.c" break; case 183: -#line 396 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 397 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4440 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1348 "parse.c" break; case 185: -#line 276 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 277 "parse.y" {sqliteSelectDelete((yypminor->yy11));} -#line 4445 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1353 "parse.c" break; case 187: -#line 407 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 408 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4450 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1358 "parse.c" break; case 194: -#line 312 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 313 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4455 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1363 "parse.c" break; case 195: -#line 310 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 311 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4460 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1368 "parse.c" break; case 196: -#line 274 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 275 "parse.y" {sqliteSelectDelete((yypminor->yy11));} -#line 4465 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1373 "parse.c" break; case 197: -#line 337 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 338 "parse.y" {sqliteSrcListDelete((yypminor->yy335));} -#line 4470 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1378 "parse.c" break; case 198: -#line 465 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 466 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4475 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1383 "parse.c" break; case 200: -#line 411 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 412 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4480 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1388 "parse.c" break; case 201: -#line 409 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 410 "parse.y" {sqliteExprListDelete((yypminor->yy62));} -#line 4485 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1393 "parse.c" break; case 203: -#line 339 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 340 "parse.y" {sqliteSrcListDelete((yypminor->yy335));} -#line 4490 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1398 "parse.c" break; case 207: -#line 807 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 809 "parse.y" {sqliteDeleteTriggerStep((yypminor->yy347));} -#line 4495 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1403 "parse.c" break; case 208: -#line 799 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 801 "parse.y" {sqliteDeleteTriggerStep((yypminor->yy347));} -#line 4500 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1408 "parse.c" break; case 210: -#line 783 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 785 "parse.y" {sqliteIdListDelete((yypminor->yy234).b);} -#line 4505 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1413 "parse.c" break; case 215: -#line 401 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 402 "parse.y" {sqliteIdListDelete((yypminor->yy92));} -#line 4510 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1418 "parse.c" break; case 217: -#line 459 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 460 "parse.y" {sqliteExprDelete((yypminor->yy334));} -#line 4515 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1423 "parse.c" break; default: break; /* If no destructor action specified: do nothing */ } @@ -4529,19 +1436,19 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){ */ static int yy_pop_parser_stack(yyParser *pParser){ YYCODETYPE yymajor; + yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; if( pParser->yyidx<0 ) return 0; #ifndef NDEBUG if( yyTraceFILE && pParser->yyidx>=0 ){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, - yyTokenName[pParser->yytop->major]); + yyTokenName[yytos->major]); } #endif - yymajor = pParser->yytop->major; - yy_destructor( yymajor, &pParser->yytop->minor); + yymajor = yytos->major; + yy_destructor( yymajor, &yytos->minor); pParser->yyidx--; - pParser->yytop--; return yymajor; } @@ -4568,32 +1475,32 @@ void sqliteParserFree( } /* -** Find the appropriate action for a parser given the look-ahead token. +** Find the appropriate action for a parser given the terminal +** look-ahead token iLookAhead. ** ** If the look-ahead token is YYNOCODE, then check to see if the action is ** independent of the look-ahead. If it is, return the action, otherwise ** return YY_NO_ACTION. */ -static int yy_find_parser_action( +static int yy_find_shift_action( yyParser *pParser, /* The parser */ - int iLookAhead /* The look-ahead token */ + int iLookAhead /* The look-ahead token */ ){ - const yyStateEntry *pState; /* Appropriate entry in the state table */ - const yyActionEntry *pAction; /* Action appropriate for the look-ahead */ - int iFallback; /* Fallback token */ + int i; + int stateno = pParser->yystack[pParser->yyidx].stateno; /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */ - pState = &yyStateTable[pParser->yytop->stateno]; - if( pState->nEntry==0 ){ - return pState->actionDefault; - }else if( iLookAhead!=YYNOCODE ){ - pAction = &pState->hashtbl[iLookAhead % pState->nEntry]; - while( 1 ){ - if( pAction->lookahead==iLookAhead ) return pAction->action; - if( pAction->next==0 ) break; - pAction = &pState->hashtbl[pAction->next-1]; - } + i = yy_shift_ofst[stateno]; + if( i==YY_SHIFT_USE_DFLT ){ + return yy_default[stateno]; + } + if( iLookAhead==YYNOCODE ){ + return YY_NO_ACTION; + } + i += iLookAhead; + if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK + int iFallback; /* Fallback token */ if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) && (iFallback = yyFallback[iLookAhead])!=0 ){ #ifndef NDEBUG @@ -4602,13 +1509,43 @@ static int yy_find_parser_action( yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif - return yy_find_parser_action(pParser, iFallback); + return yy_find_shift_action(pParser, iFallback); } #endif - }else if( pState->hashtbl->lookahead!=YYNOCODE ){ + return yy_default[stateno]; + }else{ + return yy_action[i]; + } +} + +/* +** Find the appropriate action for a parser given the non-terminal +** look-ahead token iLookAhead. +** +** If the look-ahead token is YYNOCODE, then check to see if the action is +** independent of the look-ahead. If it is, return the action, otherwise +** return YY_NO_ACTION. +*/ +static int yy_find_reduce_action( + yyParser *pParser, /* The parser */ + int iLookAhead /* The look-ahead token */ +){ + int i; + int stateno = pParser->yystack[pParser->yyidx].stateno; + + i = yy_reduce_ofst[stateno]; + if( i==YY_REDUCE_USE_DFLT ){ + return yy_default[stateno]; + } + if( iLookAhead==YYNOCODE ){ return YY_NO_ACTION; } - return pState->actionDefault; + i += iLookAhead; + if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ + return yy_default[stateno]; + }else{ + return yy_action[i]; + } } /* @@ -4620,12 +1557,11 @@ static void yy_shift( int yyMajor, /* The major token to shift in */ YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */ ){ + yyStackEntry *yytos; yypParser->yyidx++; - yypParser->yytop++; if( yypParser->yyidx>=YYSTACKDEPTH ){ sqliteParserARG_FETCH; yypParser->yyidx--; - yypParser->yytop--; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); @@ -4637,9 +1573,10 @@ static void yy_shift( sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument var */ return; } - yypParser->yytop->stateno = yyNewState; - yypParser->yytop->major = yyMajor; - yypParser->yytop->minor = *yypMinor; + yytos = &yypParser->yystack[yypParser->yyidx]; + yytos->stateno = yyNewState; + yytos->major = yyMajor; + yytos->minor = *yypMinor; #ifndef NDEBUG if( yyTraceFILE && yypParser->yyidx>0 ){ int i; @@ -4835,7 +1772,7 @@ static struct { { 157, 1 }, { 157, 3 }, { 157, 5 }, - { 157, 2 }, + { 157, 1 }, { 157, 1 }, { 157, 1 }, { 157, 1 }, @@ -4890,7 +1827,7 @@ static struct { { 159, 1 }, { 158, 1 }, { 158, 0 }, - { 138, 12 }, + { 138, 11 }, { 214, 1 }, { 214, 0 }, { 168, 0 }, @@ -4964,7 +1901,7 @@ static void yy_reduce( yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ sqliteParserARG_FETCH; - yymsp = yypParser->yytop; + yymsp = &yypParser->yystack[yypParser->yyidx]; #ifndef NDEBUG if( yyTraceFILE && yyruleno>=0 && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ @@ -5001,26 +1938,26 @@ static void yy_reduce( /* No destructor defined for SEMI */ break; case 5: -#line 77 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 77 "parse.y" { sqliteExec(pParse); } -#line 5005 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1943 "parse.c" /* No destructor defined for cmd */ break; case 6: -#line 78 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 78 "parse.y" { sqliteBeginParse(pParse, 1); } -#line 5011 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1949 "parse.c" /* No destructor defined for EXPLAIN */ break; case 7: -#line 79 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 79 "parse.y" { sqliteBeginParse(pParse, 0); } -#line 5017 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1955 "parse.c" break; case 8: -#line 84 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 84 "parse.y" {sqliteBeginTransaction(pParse,yymsp[0].minor.yy52);} -#line 5022 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1960 "parse.c" /* No destructor defined for BEGIN */ /* No destructor defined for trans_opt */ break; @@ -5034,23 +1971,23 @@ static void yy_reduce( /* No destructor defined for nm */ break; case 12: -#line 88 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 88 "parse.y" {sqliteCommitTransaction(pParse);} -#line 5038 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1976 "parse.c" /* No destructor defined for COMMIT */ /* No destructor defined for trans_opt */ break; case 13: -#line 89 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 89 "parse.y" {sqliteCommitTransaction(pParse);} -#line 5045 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1983 "parse.c" /* No destructor defined for END */ /* No destructor defined for trans_opt */ break; case 14: -#line 90 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 90 "parse.y" {sqliteRollbackTransaction(pParse);} -#line 5052 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 1990 "parse.c" /* No destructor defined for ROLLBACK */ /* No destructor defined for trans_opt */ break; @@ -5059,41 +1996,41 @@ static void yy_reduce( /* No destructor defined for create_table_args */ break; case 16: -#line 95 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 95 "parse.y" { sqliteStartTable(pParse,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy210,yymsp[-2].minor.yy52,0); } -#line 5065 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2003 "parse.c" /* No destructor defined for TABLE */ break; case 17: -#line 99 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 99 "parse.y" {yygotominor.yy52 = 1;} -#line 5071 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2009 "parse.c" /* No destructor defined for TEMP */ break; case 18: -#line 100 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 100 "parse.y" {yygotominor.yy52 = 0;} -#line 5077 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2015 "parse.c" break; case 19: -#line 101 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 101 "parse.y" { sqliteEndTable(pParse,&yymsp[0].minor.yy0,0); } -#line 5084 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2022 "parse.c" /* No destructor defined for LP */ /* No destructor defined for columnlist */ /* No destructor defined for conslist_opt */ break; case 20: -#line 104 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 104 "parse.y" { sqliteEndTable(pParse,0,yymsp[0].minor.yy11); sqliteSelectDelete(yymsp[0].minor.yy11); } -#line 5095 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2033 "parse.c" /* No destructor defined for AS */ break; case 21: @@ -5110,84 +2047,90 @@ static void yy_reduce( /* No destructor defined for carglist */ break; case 24: -#line 116 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 116 "parse.y" {sqliteAddColumn(pParse,&yymsp[0].minor.yy210);} -#line 5114 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2052 "parse.c" break; case 25: -#line 122 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 122 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5119 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2057 "parse.c" break; case 26: -#line 138 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 138 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5124 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2062 "parse.c" break; case 27: -#line 139 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 139 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5129 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2067 "parse.c" break; case 28: -#line 144 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 144 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5134 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2072 "parse.c" break; case 29: -#line 145 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 145 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5139 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2077 "parse.c" break; case 30: -#line 146 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 146 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 5144 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2082 "parse.c" break; case 31: break; case 32: -#line 149 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 149 "parse.y" {sqliteAddColumnType(pParse,&yymsp[0].minor.yy210,&yymsp[0].minor.yy210);} -#line 5151 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2089 "parse.c" break; case 33: -#line 150 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 150 "parse.y" {sqliteAddColumnType(pParse,&yymsp[-3].minor.yy210,&yymsp[0].minor.yy0);} -#line 5156 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2094 "parse.c" /* No destructor defined for LP */ /* No destructor defined for signed */ break; case 34: -#line 152 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 152 "parse.y" {sqliteAddColumnType(pParse,&yymsp[-5].minor.yy210,&yymsp[0].minor.yy0);} -#line 5163 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2101 "parse.c" /* No destructor defined for LP */ /* No destructor defined for signed */ /* No destructor defined for COMMA */ /* No destructor defined for signed */ break; case 35: -#line 154 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 154 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy210;} -#line 5172 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2110 "parse.c" break; case 36: -#line 155 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 155 "parse.y" {yygotominor.yy210 = yymsp[-1].minor.yy210;} -#line 5177 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2115 "parse.c" /* No destructor defined for ids */ break; case 37: - /* No destructor defined for INTEGER */ +#line 157 "parse.y" +{ yygotominor.yy52 = atoi(yymsp[0].minor.yy0.z); } +#line 2121 "parse.c" break; case 38: +#line 158 "parse.y" +{ yygotominor.yy52 = atoi(yymsp[0].minor.yy0.z); } +#line 2126 "parse.c" /* No destructor defined for PLUS */ - /* No destructor defined for INTEGER */ break; case 39: +#line 159 "parse.y" +{ yygotominor.yy52 = -atoi(yymsp[0].minor.yy0.z); } +#line 2132 "parse.c" /* No destructor defined for MINUS */ - /* No destructor defined for INTEGER */ break; case 40: /* No destructor defined for carglist */ @@ -5204,54 +2147,54 @@ static void yy_reduce( /* No destructor defined for ccons */ break; case 44: -#line 163 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 164 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5208 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2152 "parse.c" /* No destructor defined for DEFAULT */ break; case 45: -#line 164 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 165 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5214 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2158 "parse.c" /* No destructor defined for DEFAULT */ break; case 46: -#line 165 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 166 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5220 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2164 "parse.c" /* No destructor defined for DEFAULT */ break; case 47: -#line 166 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 167 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5226 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2170 "parse.c" /* No destructor defined for DEFAULT */ /* No destructor defined for PLUS */ break; case 48: -#line 167 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 168 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);} -#line 5233 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2177 "parse.c" /* No destructor defined for DEFAULT */ /* No destructor defined for MINUS */ break; case 49: -#line 168 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 169 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5240 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2184 "parse.c" /* No destructor defined for DEFAULT */ break; case 50: -#line 169 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 170 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,0);} -#line 5246 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2190 "parse.c" /* No destructor defined for DEFAULT */ /* No destructor defined for PLUS */ break; case 51: -#line 170 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 171 "parse.y" {sqliteAddDefaultValue(pParse,&yymsp[0].minor.yy0,1);} -#line 5253 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2197 "parse.c" /* No destructor defined for DEFAULT */ /* No destructor defined for MINUS */ break; @@ -5264,24 +2207,24 @@ static void yy_reduce( /* No destructor defined for onconf */ break; case 54: -#line 177 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 178 "parse.y" {sqliteAddNotNull(pParse, yymsp[0].minor.yy52);} -#line 5268 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2212 "parse.c" /* No destructor defined for NOT */ /* No destructor defined for NULL */ break; case 55: -#line 178 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 179 "parse.y" {sqliteAddPrimaryKey(pParse,0,yymsp[0].minor.yy52);} -#line 5275 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2219 "parse.c" /* No destructor defined for PRIMARY */ /* No destructor defined for KEY */ /* No destructor defined for sortorder */ break; case 56: -#line 179 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy52,0,0,0);} -#line 5283 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 180 "parse.y" +{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy52,0,0);} +#line 2227 "parse.c" /* No destructor defined for UNIQUE */ break; case 57: @@ -5292,117 +2235,117 @@ static void yy_reduce( /* No destructor defined for onconf */ break; case 58: -#line 182 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 183 "parse.y" {sqliteCreateForeignKey(pParse,0,&yymsp[-2].minor.yy210,yymsp[-1].minor.yy92,yymsp[0].minor.yy52);} -#line 5296 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2240 "parse.c" /* No destructor defined for REFERENCES */ break; case 59: -#line 183 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 184 "parse.y" {sqliteDeferForeignKey(pParse,yymsp[0].minor.yy52);} -#line 5302 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2246 "parse.c" break; case 60: -#line 184 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 185 "parse.y" { sqliteAddCollateType(pParse, sqliteCollateType(yymsp[0].minor.yy210.z, yymsp[0].minor.yy210.n)); } -#line 5309 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2253 "parse.c" /* No destructor defined for COLLATE */ break; case 61: -#line 194 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 195 "parse.y" { yygotominor.yy52 = OE_Restrict * 0x010101; } -#line 5315 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2259 "parse.c" break; case 62: -#line 195 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 196 "parse.y" { yygotominor.yy52 = (yymsp[-1].minor.yy52 & yymsp[0].minor.yy279.mask) | yymsp[0].minor.yy279.value; } -#line 5320 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2264 "parse.c" break; case 63: -#line 197 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 198 "parse.y" { yygotominor.yy279.value = 0; yygotominor.yy279.mask = 0x000000; } -#line 5325 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2269 "parse.c" /* No destructor defined for MATCH */ /* No destructor defined for nm */ break; case 64: -#line 198 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 199 "parse.y" { yygotominor.yy279.value = yymsp[0].minor.yy52; yygotominor.yy279.mask = 0x0000ff; } -#line 5332 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2276 "parse.c" /* No destructor defined for ON */ /* No destructor defined for DELETE */ break; case 65: -#line 199 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 200 "parse.y" { yygotominor.yy279.value = yymsp[0].minor.yy52<<8; yygotominor.yy279.mask = 0x00ff00; } -#line 5339 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2283 "parse.c" /* No destructor defined for ON */ /* No destructor defined for UPDATE */ break; case 66: -#line 200 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 201 "parse.y" { yygotominor.yy279.value = yymsp[0].minor.yy52<<16; yygotominor.yy279.mask = 0xff0000; } -#line 5346 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2290 "parse.c" /* No destructor defined for ON */ /* No destructor defined for INSERT */ break; case 67: -#line 202 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 203 "parse.y" { yygotominor.yy52 = OE_SetNull; } -#line 5353 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2297 "parse.c" /* No destructor defined for SET */ /* No destructor defined for NULL */ break; case 68: -#line 203 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 204 "parse.y" { yygotominor.yy52 = OE_SetDflt; } -#line 5360 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2304 "parse.c" /* No destructor defined for SET */ /* No destructor defined for DEFAULT */ break; case 69: -#line 204 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 205 "parse.y" { yygotominor.yy52 = OE_Cascade; } -#line 5367 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2311 "parse.c" /* No destructor defined for CASCADE */ break; case 70: -#line 205 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 206 "parse.y" { yygotominor.yy52 = OE_Restrict; } -#line 5373 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2317 "parse.c" /* No destructor defined for RESTRICT */ break; case 71: -#line 207 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 208 "parse.y" {yygotominor.yy52 = yymsp[0].minor.yy52;} -#line 5379 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2323 "parse.c" /* No destructor defined for NOT */ /* No destructor defined for DEFERRABLE */ break; case 72: -#line 208 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 209 "parse.y" {yygotominor.yy52 = yymsp[0].minor.yy52;} -#line 5386 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2330 "parse.c" /* No destructor defined for DEFERRABLE */ break; case 73: -#line 210 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 211 "parse.y" {yygotominor.yy52 = 0;} -#line 5392 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2336 "parse.c" break; case 74: -#line 211 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 212 "parse.y" {yygotominor.yy52 = 1;} -#line 5397 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2341 "parse.c" /* No destructor defined for INITIALLY */ /* No destructor defined for DEFERRED */ break; case 75: -#line 212 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 213 "parse.y" {yygotominor.yy52 = 0;} -#line 5404 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2348 "parse.c" /* No destructor defined for INITIALLY */ /* No destructor defined for IMMEDIATE */ break; @@ -5429,18 +2372,18 @@ static void yy_reduce( /* No destructor defined for nm */ break; case 82: -#line 224 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 225 "parse.y" {sqliteAddPrimaryKey(pParse,yymsp[-2].minor.yy92,yymsp[0].minor.yy52);} -#line 5433 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2377 "parse.c" /* No destructor defined for PRIMARY */ /* No destructor defined for KEY */ /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 83: -#line 226 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy92,yymsp[0].minor.yy52,0,0,0);} -#line 5442 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 227 "parse.y" +{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy92,yymsp[0].minor.yy52,0,0);} +#line 2386 "parse.c" /* No destructor defined for UNIQUE */ /* No destructor defined for LP */ /* No destructor defined for RP */ @@ -5451,12 +2394,12 @@ static void yy_reduce( /* No destructor defined for onconf */ break; case 85: -#line 229 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 230 "parse.y" { sqliteCreateForeignKey(pParse, yymsp[-6].minor.yy92, &yymsp[-3].minor.yy210, yymsp[-2].minor.yy92, yymsp[-1].minor.yy52); sqliteDeferForeignKey(pParse, yymsp[0].minor.yy52); } -#line 5458 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2402 "parse.c" /* No destructor defined for FOREIGN */ /* No destructor defined for KEY */ /* No destructor defined for LP */ @@ -5464,108 +2407,108 @@ static void yy_reduce( /* No destructor defined for REFERENCES */ break; case 86: -#line 234 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 235 "parse.y" {yygotominor.yy52 = 0;} -#line 5468 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2412 "parse.c" break; case 87: -#line 235 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 236 "parse.y" {yygotominor.yy52 = yymsp[0].minor.yy52;} -#line 5473 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2417 "parse.c" break; case 88: -#line 243 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 244 "parse.y" { yygotominor.yy52 = OE_Default; } -#line 5478 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2422 "parse.c" break; case 89: -#line 244 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 245 "parse.y" { yygotominor.yy52 = yymsp[0].minor.yy52; } -#line 5483 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2427 "parse.c" /* No destructor defined for ON */ /* No destructor defined for CONFLICT */ break; case 90: -#line 245 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 246 "parse.y" { yygotominor.yy52 = OE_Default; } -#line 5490 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2434 "parse.c" break; case 91: -#line 246 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 247 "parse.y" { yygotominor.yy52 = yymsp[0].minor.yy52; } -#line 5495 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2439 "parse.c" /* No destructor defined for OR */ break; case 92: -#line 247 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 248 "parse.y" { yygotominor.yy52 = OE_Rollback; } -#line 5501 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2445 "parse.c" /* No destructor defined for ROLLBACK */ break; case 93: -#line 248 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 249 "parse.y" { yygotominor.yy52 = OE_Abort; } -#line 5507 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2451 "parse.c" /* No destructor defined for ABORT */ break; case 94: -#line 249 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 250 "parse.y" { yygotominor.yy52 = OE_Fail; } -#line 5513 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2457 "parse.c" /* No destructor defined for FAIL */ break; case 95: -#line 250 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 251 "parse.y" { yygotominor.yy52 = OE_Ignore; } -#line 5519 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2463 "parse.c" /* No destructor defined for IGNORE */ break; case 96: -#line 251 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 252 "parse.y" { yygotominor.yy52 = OE_Replace; } -#line 5525 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2469 "parse.c" /* No destructor defined for REPLACE */ break; case 97: -#line 255 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 256 "parse.y" {sqliteDropTable(pParse,&yymsp[0].minor.yy210,0);} -#line 5531 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2475 "parse.c" /* No destructor defined for DROP */ /* No destructor defined for TABLE */ break; case 98: -#line 259 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 260 "parse.y" { sqliteCreateView(pParse, &yymsp[-5].minor.yy0, &yymsp[-2].minor.yy210, yymsp[0].minor.yy11, yymsp[-4].minor.yy52); } -#line 5540 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2484 "parse.c" /* No destructor defined for VIEW */ /* No destructor defined for AS */ break; case 99: -#line 262 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 263 "parse.y" { sqliteDropTable(pParse, &yymsp[0].minor.yy210, 1); } -#line 5549 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2493 "parse.c" /* No destructor defined for DROP */ /* No destructor defined for VIEW */ break; case 100: -#line 268 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 269 "parse.y" { sqliteSelect(pParse, yymsp[0].minor.yy11, SRT_Callback, 0, 0, 0, 0); sqliteSelectDelete(yymsp[0].minor.yy11); } -#line 5559 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2503 "parse.c" break; case 101: -#line 278 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 279 "parse.y" {yygotominor.yy11 = yymsp[0].minor.yy11;} -#line 5564 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2508 "parse.c" break; case 102: -#line 279 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 280 "parse.y" { if( yymsp[0].minor.yy11 ){ yymsp[0].minor.yy11->op = yymsp[-1].minor.yy52; @@ -5573,137 +2516,137 @@ static void yy_reduce( } yygotominor.yy11 = yymsp[0].minor.yy11; } -#line 5575 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2519 "parse.c" break; case 103: -#line 287 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 288 "parse.y" {yygotominor.yy52 = TK_UNION;} -#line 5580 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2524 "parse.c" /* No destructor defined for UNION */ break; case 104: -#line 288 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 289 "parse.y" {yygotominor.yy52 = TK_ALL;} -#line 5586 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2530 "parse.c" /* No destructor defined for UNION */ /* No destructor defined for ALL */ break; case 105: -#line 289 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 290 "parse.y" {yygotominor.yy52 = TK_INTERSECT;} -#line 5593 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2537 "parse.c" /* No destructor defined for INTERSECT */ break; case 106: -#line 290 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 291 "parse.y" {yygotominor.yy52 = TK_EXCEPT;} -#line 5599 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2543 "parse.c" /* No destructor defined for EXCEPT */ break; case 107: -#line 292 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 293 "parse.y" { yygotominor.yy11 = sqliteSelectNew(yymsp[-6].minor.yy62,yymsp[-5].minor.yy335,yymsp[-4].minor.yy334,yymsp[-3].minor.yy62,yymsp[-2].minor.yy334,yymsp[-1].minor.yy62,yymsp[-7].minor.yy52,yymsp[0].minor.yy280.limit,yymsp[0].minor.yy280.offset); } -#line 5607 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2551 "parse.c" /* No destructor defined for SELECT */ break; case 108: -#line 300 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 301 "parse.y" {yygotominor.yy52 = 1;} -#line 5613 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2557 "parse.c" /* No destructor defined for DISTINCT */ break; case 109: -#line 301 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 302 "parse.y" {yygotominor.yy52 = 0;} -#line 5619 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2563 "parse.c" /* No destructor defined for ALL */ break; case 110: -#line 302 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 303 "parse.y" {yygotominor.yy52 = 0;} -#line 5625 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2569 "parse.c" break; case 111: -#line 313 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 314 "parse.y" {yygotominor.yy62 = yymsp[-1].minor.yy62;} -#line 5630 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2574 "parse.c" /* No destructor defined for COMMA */ break; case 112: -#line 314 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 315 "parse.y" {yygotominor.yy62 = 0;} -#line 5636 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2580 "parse.c" break; case 113: -#line 315 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 316 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(yymsp[-2].minor.yy62,yymsp[-1].minor.yy334,yymsp[0].minor.yy210.n?&yymsp[0].minor.yy210:0); } -#line 5643 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2587 "parse.c" break; case 114: -#line 318 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 319 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(yymsp[-1].minor.yy62, sqliteExpr(TK_ALL, 0, 0, 0), 0); } -#line 5650 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2594 "parse.c" /* No destructor defined for STAR */ break; case 115: -#line 321 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 322 "parse.y" { Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0); Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy210); yygotominor.yy62 = sqliteExprListAppend(yymsp[-3].minor.yy62, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0); } -#line 5660 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2604 "parse.c" /* No destructor defined for DOT */ /* No destructor defined for STAR */ break; case 116: -#line 331 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 332 "parse.y" { yygotominor.yy210 = yymsp[0].minor.yy210; } -#line 5667 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2611 "parse.c" /* No destructor defined for AS */ break; case 117: -#line 332 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 333 "parse.y" { yygotominor.yy210 = yymsp[0].minor.yy210; } -#line 5673 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2617 "parse.c" break; case 118: -#line 333 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 334 "parse.y" { yygotominor.yy210.n = 0; } -#line 5678 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2622 "parse.c" break; case 119: -#line 345 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 346 "parse.y" {yygotominor.yy335 = sqliteMalloc(sizeof(*yygotominor.yy335));} -#line 5683 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2627 "parse.c" break; case 120: -#line 346 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 347 "parse.y" {yygotominor.yy335 = yymsp[0].minor.yy335;} -#line 5688 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2632 "parse.c" /* No destructor defined for FROM */ break; case 121: -#line 351 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 352 "parse.y" { yygotominor.yy335 = yymsp[-1].minor.yy335; if( yygotominor.yy335 && yygotominor.yy335->nSrc>0 ) yygotominor.yy335->a[yygotominor.yy335->nSrc-1].jointype = yymsp[0].minor.yy52; } -#line 5697 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2641 "parse.c" break; case 122: -#line 355 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 356 "parse.y" {yygotominor.yy335 = 0;} -#line 5702 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2646 "parse.c" break; case 123: -#line 356 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 357 "parse.y" { yygotominor.yy335 = sqliteSrcListAppend(yymsp[-5].minor.yy335,&yymsp[-4].minor.yy210,&yymsp[-3].minor.yy210); if( yymsp[-2].minor.yy210.n ) sqliteSrcListAddAlias(yygotominor.yy335,&yymsp[-2].minor.yy210); @@ -5716,10 +2659,10 @@ static void yy_reduce( else { sqliteIdListDelete(yymsp[0].minor.yy92); } } } -#line 5718 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2662 "parse.c" break; case 124: -#line 368 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 369 "parse.y" { yygotominor.yy335 = sqliteSrcListAppend(yymsp[-6].minor.yy335,0,0); yygotominor.yy335->a[yygotominor.yy335->nSrc-1].pSelect = yymsp[-4].minor.yy11; @@ -5733,318 +2676,318 @@ static void yy_reduce( else { sqliteIdListDelete(yymsp[0].minor.yy92); } } } -#line 5735 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2679 "parse.c" /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 125: -#line 383 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 384 "parse.y" {yygotominor.yy210.z=0; yygotominor.yy210.n=0;} -#line 5742 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2686 "parse.c" break; case 126: -#line 384 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 385 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy210;} -#line 5747 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2691 "parse.c" /* No destructor defined for DOT */ break; case 127: -#line 388 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 389 "parse.y" { yygotominor.yy52 = JT_INNER; } -#line 5753 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2697 "parse.c" /* No destructor defined for COMMA */ break; case 128: -#line 389 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 390 "parse.y" { yygotominor.yy52 = JT_INNER; } -#line 5759 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2703 "parse.c" /* No destructor defined for JOIN */ break; case 129: -#line 390 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 391 "parse.y" { yygotominor.yy52 = sqliteJoinType(pParse,&yymsp[-1].minor.yy0,0,0); } -#line 5765 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2709 "parse.c" /* No destructor defined for JOIN */ break; case 130: -#line 391 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 392 "parse.y" { yygotominor.yy52 = sqliteJoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy210,0); } -#line 5771 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2715 "parse.c" /* No destructor defined for JOIN */ break; case 131: -#line 393 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 394 "parse.y" { yygotominor.yy52 = sqliteJoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy210,&yymsp[-1].minor.yy210); } -#line 5777 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2721 "parse.c" /* No destructor defined for JOIN */ break; case 132: -#line 397 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 398 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 5783 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2727 "parse.c" /* No destructor defined for ON */ break; case 133: -#line 398 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 399 "parse.y" {yygotominor.yy334 = 0;} -#line 5789 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2733 "parse.c" break; case 134: -#line 402 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 403 "parse.y" {yygotominor.yy92 = yymsp[-1].minor.yy92;} -#line 5794 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2738 "parse.c" /* No destructor defined for USING */ /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 135: -#line 403 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 404 "parse.y" {yygotominor.yy92 = 0;} -#line 5802 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2746 "parse.c" break; case 136: -#line 413 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 414 "parse.y" {yygotominor.yy62 = 0;} -#line 5807 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2751 "parse.c" break; case 137: -#line 414 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 415 "parse.y" {yygotominor.yy62 = yymsp[0].minor.yy62;} -#line 5812 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2756 "parse.c" /* No destructor defined for ORDER */ /* No destructor defined for BY */ break; case 138: -#line 415 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 416 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(yymsp[-4].minor.yy62,yymsp[-2].minor.yy334,0); if( yygotominor.yy62 ) yygotominor.yy62->a[yygotominor.yy62->nExpr-1].sortOrder = yymsp[-1].minor.yy52+yymsp[0].minor.yy52; } -#line 5822 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2766 "parse.c" /* No destructor defined for COMMA */ break; case 139: -#line 419 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 420 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(0,yymsp[-2].minor.yy334,0); if( yygotominor.yy62 ) yygotominor.yy62->a[0].sortOrder = yymsp[-1].minor.yy52+yymsp[0].minor.yy52; } -#line 5831 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2775 "parse.c" break; case 140: -#line 423 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 424 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 5836 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2780 "parse.c" break; case 141: -#line 428 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 429 "parse.y" {yygotominor.yy52 = SQLITE_SO_ASC;} -#line 5841 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2785 "parse.c" /* No destructor defined for ASC */ break; case 142: -#line 429 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 430 "parse.y" {yygotominor.yy52 = SQLITE_SO_DESC;} -#line 5847 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2791 "parse.c" /* No destructor defined for DESC */ break; case 143: -#line 430 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 431 "parse.y" {yygotominor.yy52 = SQLITE_SO_ASC;} -#line 5853 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2797 "parse.c" break; case 144: -#line 431 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 432 "parse.y" {yygotominor.yy52 = SQLITE_SO_UNK;} -#line 5858 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2802 "parse.c" break; case 145: -#line 432 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 433 "parse.y" {yygotominor.yy52 = sqliteCollateType(yymsp[0].minor.yy210.z, yymsp[0].minor.yy210.n);} -#line 5863 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2807 "parse.c" /* No destructor defined for COLLATE */ break; case 146: -#line 436 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 437 "parse.y" {yygotominor.yy62 = 0;} -#line 5869 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2813 "parse.c" break; case 147: -#line 437 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 438 "parse.y" {yygotominor.yy62 = yymsp[0].minor.yy62;} -#line 5874 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2818 "parse.c" /* No destructor defined for GROUP */ /* No destructor defined for BY */ break; case 148: -#line 441 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 442 "parse.y" {yygotominor.yy334 = 0;} -#line 5881 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2825 "parse.c" break; case 149: -#line 442 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 443 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 5886 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2830 "parse.c" /* No destructor defined for HAVING */ break; case 150: -#line 445 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 446 "parse.y" {yygotominor.yy280.limit = -1; yygotominor.yy280.offset = 0;} -#line 5892 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2836 "parse.c" break; case 151: -#line 446 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy280.limit = atoi(yymsp[0].minor.yy0.z); yygotominor.yy280.offset = 0;} -#line 5897 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 447 "parse.y" +{yygotominor.yy280.limit = yymsp[0].minor.yy52; yygotominor.yy280.offset = 0;} +#line 2841 "parse.c" /* No destructor defined for LIMIT */ break; case 152: -#line 448 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy280.limit = atoi(yymsp[-2].minor.yy0.z); yygotominor.yy280.offset = atoi(yymsp[0].minor.yy0.z);} -#line 5903 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 449 "parse.y" +{yygotominor.yy280.limit = yymsp[-2].minor.yy52; yygotominor.yy280.offset = yymsp[0].minor.yy52;} +#line 2847 "parse.c" /* No destructor defined for LIMIT */ /* No destructor defined for OFFSET */ break; case 153: -#line 450 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy280.limit = atoi(yymsp[0].minor.yy0.z); yygotominor.yy280.offset = atoi(yymsp[-2].minor.yy0.z);} -#line 5910 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 451 "parse.y" +{yygotominor.yy280.limit = yymsp[0].minor.yy52; yygotominor.yy280.offset = yymsp[-2].minor.yy52;} +#line 2854 "parse.c" /* No destructor defined for LIMIT */ /* No destructor defined for COMMA */ break; case 154: -#line 454 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 455 "parse.y" { sqliteDeleteFrom(pParse, sqliteSrcListAppend(0,&yymsp[-2].minor.yy210,&yymsp[-1].minor.yy210), yymsp[0].minor.yy334); } -#line 5919 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2863 "parse.c" /* No destructor defined for DELETE */ /* No destructor defined for FROM */ break; case 155: -#line 461 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 462 "parse.y" {yygotominor.yy334 = 0;} -#line 5926 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2870 "parse.c" break; case 156: -#line 462 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 463 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 5931 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2875 "parse.c" /* No destructor defined for WHERE */ break; case 157: -#line 470 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 471 "parse.y" {sqliteUpdate(pParse,sqliteSrcListAppend(0,&yymsp[-4].minor.yy210,&yymsp[-3].minor.yy210),yymsp[-1].minor.yy62,yymsp[0].minor.yy334,yymsp[-5].minor.yy52);} -#line 5937 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2881 "parse.c" /* No destructor defined for UPDATE */ /* No destructor defined for SET */ break; case 158: -#line 473 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 474 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(yymsp[-4].minor.yy62,yymsp[0].minor.yy334,&yymsp[-2].minor.yy210);} -#line 5944 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2888 "parse.c" /* No destructor defined for COMMA */ /* No destructor defined for EQ */ break; case 159: -#line 474 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 475 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(0,yymsp[0].minor.yy334,&yymsp[-2].minor.yy210);} -#line 5951 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2895 "parse.c" /* No destructor defined for EQ */ break; case 160: -#line 480 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 481 "parse.y" {sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-6].minor.yy210,&yymsp[-5].minor.yy210), yymsp[-1].minor.yy62, 0, yymsp[-4].minor.yy92, yymsp[-8].minor.yy52);} -#line 5957 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2901 "parse.c" /* No destructor defined for INTO */ /* No destructor defined for VALUES */ /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 161: -#line 482 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 483 "parse.y" {sqliteInsert(pParse, sqliteSrcListAppend(0,&yymsp[-3].minor.yy210,&yymsp[-2].minor.yy210), 0, yymsp[0].minor.yy11, yymsp[-1].minor.yy92, yymsp[-5].minor.yy52);} -#line 5966 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2910 "parse.c" /* No destructor defined for INTO */ break; case 162: -#line 485 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 486 "parse.y" {yygotominor.yy52 = yymsp[0].minor.yy52;} -#line 5972 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2916 "parse.c" /* No destructor defined for INSERT */ break; case 163: -#line 486 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 487 "parse.y" {yygotominor.yy52 = OE_Replace;} -#line 5978 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2922 "parse.c" /* No destructor defined for REPLACE */ break; case 164: -#line 492 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 493 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(yymsp[-2].minor.yy62,yymsp[0].minor.yy334,0);} -#line 5984 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2928 "parse.c" /* No destructor defined for COMMA */ break; case 165: -#line 493 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 494 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(0,yymsp[0].minor.yy334,0);} -#line 5990 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2934 "parse.c" break; case 166: -#line 500 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 501 "parse.y" {yygotominor.yy92 = 0;} -#line 5995 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2939 "parse.c" break; case 167: -#line 501 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 502 "parse.y" {yygotominor.yy92 = yymsp[-1].minor.yy92;} -#line 6000 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2944 "parse.c" /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 168: -#line 502 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 503 "parse.y" {yygotominor.yy92 = sqliteIdListAppend(yymsp[-2].minor.yy92,&yymsp[0].minor.yy210);} -#line 6007 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2951 "parse.c" /* No destructor defined for COMMA */ break; case 169: -#line 503 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 504 "parse.y" {yygotominor.yy92 = sqliteIdListAppend(0,&yymsp[0].minor.yy210);} -#line 6013 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2957 "parse.c" break; case 170: -#line 522 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 522 "parse.y" {yygotominor.yy334 = yymsp[-1].minor.yy334; sqliteExprSpan(yygotominor.yy334,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } -#line 6018 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2962 "parse.c" break; case 171: -#line 523 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 523 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_NULL, 0, 0, &yymsp[0].minor.yy0);} -#line 6023 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2967 "parse.c" break; case 172: -#line 524 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 524 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} -#line 6028 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2972 "parse.c" break; case 173: -#line 525 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 525 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy0);} -#line 6033 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2977 "parse.c" break; case 174: -#line 526 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 526 "parse.y" { Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy210); Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[0].minor.yy210); yygotominor.yy334 = sqliteExpr(TK_DOT, temp1, temp2, 0); } -#line 6042 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2986 "parse.c" /* No destructor defined for DOT */ break; case 175: -#line 531 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 531 "parse.y" { Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &yymsp[-4].minor.yy210); Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &yymsp[-2].minor.yy210); @@ -6052,124 +2995,126 @@ static void yy_reduce( Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); yygotominor.yy334 = sqliteExpr(TK_DOT, temp1, temp4, 0); } -#line 6054 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 2998 "parse.c" /* No destructor defined for DOT */ /* No destructor defined for DOT */ break; case 176: -#line 539 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy334 = yymsp[-1].minor.yy334; ExprSetProperty(yygotominor.yy334,EP_Oracle8Join);} -#line 6061 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" - /* No destructor defined for ORACLE_OUTER_JOIN */ +#line 538 "parse.y" +{yygotominor.yy334 = sqliteExpr(TK_INTEGER, 0, 0, &yymsp[0].minor.yy0);} +#line 3005 "parse.c" break; case 177: -#line 540 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy334 = sqliteExpr(TK_INTEGER, 0, 0, &yymsp[0].minor.yy0);} -#line 6067 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 539 "parse.y" +{yygotominor.yy334 = sqliteExpr(TK_FLOAT, 0, 0, &yymsp[0].minor.yy0);} +#line 3010 "parse.c" break; case 178: -#line 541 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy334 = sqliteExpr(TK_FLOAT, 0, 0, &yymsp[0].minor.yy0);} -#line 6072 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 540 "parse.y" +{yygotominor.yy334 = sqliteExpr(TK_STRING, 0, 0, &yymsp[0].minor.yy0);} +#line 3015 "parse.c" break; case 179: -#line 542 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" -{yygotominor.yy334 = sqliteExpr(TK_STRING, 0, 0, &yymsp[0].minor.yy0);} -#line 6077 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 541 "parse.y" +{ + yygotominor.yy334 = sqliteExpr(TK_VARIABLE, 0, 0, &yymsp[0].minor.yy0); + if( yygotominor.yy334 ) yygotominor.yy334->iTable = ++pParse->nVar; +} +#line 3023 "parse.c" break; case 180: -#line 543 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 545 "parse.y" { yygotominor.yy334 = sqliteExprFunction(yymsp[-1].minor.yy62, &yymsp[-3].minor.yy0); sqliteExprSpan(yygotominor.yy334,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); } -#line 6085 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3031 "parse.c" /* No destructor defined for LP */ break; case 181: -#line 547 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 549 "parse.y" { yygotominor.yy334 = sqliteExprFunction(0, &yymsp[-3].minor.yy0); sqliteExprSpan(yygotominor.yy334,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); } -#line 6094 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3040 "parse.c" /* No destructor defined for LP */ /* No destructor defined for STAR */ break; case 182: -#line 551 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 553 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_AND, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6101 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3047 "parse.c" /* No destructor defined for AND */ break; case 183: -#line 552 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 554 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_OR, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6107 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3053 "parse.c" /* No destructor defined for OR */ break; case 184: -#line 553 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 555 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_LT, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6113 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3059 "parse.c" /* No destructor defined for LT */ break; case 185: -#line 554 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 556 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_GT, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6119 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3065 "parse.c" /* No destructor defined for GT */ break; case 186: -#line 555 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 557 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_LE, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6125 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3071 "parse.c" /* No destructor defined for LE */ break; case 187: -#line 556 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 558 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_GE, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6131 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3077 "parse.c" /* No destructor defined for GE */ break; case 188: -#line 557 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 559 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_NE, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6137 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3083 "parse.c" /* No destructor defined for NE */ break; case 189: -#line 558 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 560 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_EQ, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6143 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3089 "parse.c" /* No destructor defined for EQ */ break; case 190: -#line 559 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 561 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_BITAND, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6149 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3095 "parse.c" /* No destructor defined for BITAND */ break; case 191: -#line 560 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 562 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_BITOR, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6155 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3101 "parse.c" /* No destructor defined for BITOR */ break; case 192: -#line 561 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 563 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_LSHIFT, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6161 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3107 "parse.c" /* No destructor defined for LSHIFT */ break; case 193: -#line 562 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 564 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_RSHIFT, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6167 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3113 "parse.c" /* No destructor defined for RSHIFT */ break; case 194: -#line 563 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 565 "parse.y" { ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy334, 0); pList = sqliteExprListAppend(pList, yymsp[-2].minor.yy334, 0); @@ -6177,10 +3122,10 @@ static void yy_reduce( if( yygotominor.yy334 ) yygotominor.yy334->op = yymsp[-1].minor.yy52; sqliteExprSpan(yygotominor.yy334, &yymsp[-2].minor.yy334->span, &yymsp[0].minor.yy334->span); } -#line 6179 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3125 "parse.c" break; case 195: -#line 570 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 572 "parse.y" { ExprList *pList = sqliteExprListAppend(0, yymsp[0].minor.yy334, 0); pList = sqliteExprListAppend(pList, yymsp[-3].minor.yy334, 0); @@ -6189,144 +3134,144 @@ static void yy_reduce( yygotominor.yy334 = sqliteExpr(TK_NOT, yygotominor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-3].minor.yy334->span,&yymsp[0].minor.yy334->span); } -#line 6191 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3137 "parse.c" /* No destructor defined for NOT */ break; case 196: -#line 579 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 581 "parse.y" {yygotominor.yy52 = TK_LIKE;} -#line 6197 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3143 "parse.c" /* No destructor defined for LIKE */ break; case 197: -#line 580 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 582 "parse.y" {yygotominor.yy52 = TK_GLOB;} -#line 6203 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3149 "parse.c" /* No destructor defined for GLOB */ break; case 198: -#line 581 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 583 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_PLUS, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6209 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3155 "parse.c" /* No destructor defined for PLUS */ break; case 199: -#line 582 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 584 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_MINUS, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6215 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3161 "parse.c" /* No destructor defined for MINUS */ break; case 200: -#line 583 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 585 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_STAR, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6221 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3167 "parse.c" /* No destructor defined for STAR */ break; case 201: -#line 584 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 586 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_SLASH, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6227 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3173 "parse.c" /* No destructor defined for SLASH */ break; case 202: -#line 585 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 587 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_REM, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6233 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3179 "parse.c" /* No destructor defined for REM */ break; case 203: -#line 586 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 588 "parse.y" {yygotominor.yy334 = sqliteExpr(TK_CONCAT, yymsp[-2].minor.yy334, yymsp[0].minor.yy334, 0);} -#line 6239 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3185 "parse.c" /* No destructor defined for CONCAT */ break; case 204: -#line 587 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 589 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_ISNULL, yymsp[-1].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6248 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3194 "parse.c" break; case 205: -#line 591 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 593 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_ISNULL, yymsp[-2].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-2].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6256 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3202 "parse.c" /* No destructor defined for IS */ break; case 206: -#line 595 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 597 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_NOTNULL, yymsp[-1].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6265 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3211 "parse.c" break; case 207: -#line 599 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 601 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_NOTNULL, yymsp[-2].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-2].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6273 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3219 "parse.c" /* No destructor defined for NOT */ break; case 208: -#line 603 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 605 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_NOTNULL, yymsp[-3].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-3].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6282 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3228 "parse.c" /* No destructor defined for IS */ /* No destructor defined for NOT */ break; case 209: -#line 607 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 609 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_NOT, yymsp[0].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy334->span); } -#line 6292 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3238 "parse.c" break; case 210: -#line 611 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 613 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_BITNOT, yymsp[0].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy334->span); } -#line 6300 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3246 "parse.c" break; case 211: -#line 615 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 617 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_UMINUS, yymsp[0].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy334->span); } -#line 6308 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3254 "parse.c" break; case 212: -#line 619 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 621 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_UPLUS, yymsp[0].minor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy334->span); } -#line 6316 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3262 "parse.c" break; case 213: -#line 623 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 625 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_SELECT, 0, 0, 0); if( yygotominor.yy334 ) yygotominor.yy334->pSelect = yymsp[-1].minor.yy11; sqliteExprSpan(yygotominor.yy334,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } -#line 6325 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3271 "parse.c" break; case 214: -#line 628 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 630 "parse.y" { ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy334, 0); pList = sqliteExprListAppend(pList, yymsp[0].minor.yy334, 0); @@ -6334,12 +3279,12 @@ static void yy_reduce( if( yygotominor.yy334 ) yygotominor.yy334->pList = pList; sqliteExprSpan(yygotominor.yy334,&yymsp[-4].minor.yy334->span,&yymsp[0].minor.yy334->span); } -#line 6336 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3282 "parse.c" /* No destructor defined for BETWEEN */ /* No destructor defined for AND */ break; case 215: -#line 635 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 637 "parse.y" { ExprList *pList = sqliteExprListAppend(0, yymsp[-2].minor.yy334, 0); pList = sqliteExprListAppend(pList, yymsp[0].minor.yy334, 0); @@ -6348,283 +3293,283 @@ static void yy_reduce( yygotominor.yy334 = sqliteExpr(TK_NOT, yygotominor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-5].minor.yy334->span,&yymsp[0].minor.yy334->span); } -#line 6350 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3296 "parse.c" /* No destructor defined for NOT */ /* No destructor defined for BETWEEN */ /* No destructor defined for AND */ break; case 216: -#line 643 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 645 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_IN, yymsp[-4].minor.yy334, 0, 0); if( yygotominor.yy334 ) yygotominor.yy334->pList = yymsp[-1].minor.yy62; sqliteExprSpan(yygotominor.yy334,&yymsp[-4].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6362 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3308 "parse.c" /* No destructor defined for IN */ /* No destructor defined for LP */ break; case 217: -#line 648 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 650 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_IN, yymsp[-4].minor.yy334, 0, 0); if( yygotominor.yy334 ) yygotominor.yy334->pSelect = yymsp[-1].minor.yy11; sqliteExprSpan(yygotominor.yy334,&yymsp[-4].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6373 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3319 "parse.c" /* No destructor defined for IN */ /* No destructor defined for LP */ break; case 218: -#line 653 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 655 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_IN, yymsp[-5].minor.yy334, 0, 0); if( yygotominor.yy334 ) yygotominor.yy334->pList = yymsp[-1].minor.yy62; yygotominor.yy334 = sqliteExpr(TK_NOT, yygotominor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-5].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6385 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3331 "parse.c" /* No destructor defined for NOT */ /* No destructor defined for IN */ /* No destructor defined for LP */ break; case 219: -#line 659 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 661 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_IN, yymsp[-5].minor.yy334, 0, 0); if( yygotominor.yy334 ) yygotominor.yy334->pSelect = yymsp[-1].minor.yy11; yygotominor.yy334 = sqliteExpr(TK_NOT, yygotominor.yy334, 0, 0); sqliteExprSpan(yygotominor.yy334,&yymsp[-5].minor.yy334->span,&yymsp[0].minor.yy0); } -#line 6398 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3344 "parse.c" /* No destructor defined for NOT */ /* No destructor defined for IN */ /* No destructor defined for LP */ break; case 220: -#line 667 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 669 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_CASE, yymsp[-3].minor.yy334, yymsp[-1].minor.yy334, 0); if( yygotominor.yy334 ) yygotominor.yy334->pList = yymsp[-2].minor.yy62; sqliteExprSpan(yygotominor.yy334, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0); } -#line 6410 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3356 "parse.c" break; case 221: -#line 674 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 676 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(yymsp[-4].minor.yy62, yymsp[-2].minor.yy334, 0); yygotominor.yy62 = sqliteExprListAppend(yygotominor.yy62, yymsp[0].minor.yy334, 0); } -#line 6418 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3364 "parse.c" /* No destructor defined for WHEN */ /* No destructor defined for THEN */ break; case 222: -#line 678 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 680 "parse.y" { yygotominor.yy62 = sqliteExprListAppend(0, yymsp[-2].minor.yy334, 0); yygotominor.yy62 = sqliteExprListAppend(yygotominor.yy62, yymsp[0].minor.yy334, 0); } -#line 6428 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3374 "parse.c" /* No destructor defined for WHEN */ /* No destructor defined for THEN */ break; case 223: -#line 683 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 685 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 6435 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3381 "parse.c" /* No destructor defined for ELSE */ break; case 224: -#line 684 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 686 "parse.y" {yygotominor.yy334 = 0;} -#line 6441 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3387 "parse.c" break; case 225: -#line 686 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 688 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 6446 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3392 "parse.c" break; case 226: -#line 687 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 689 "parse.y" {yygotominor.yy334 = 0;} -#line 6451 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3397 "parse.c" break; case 227: -#line 695 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 697 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(yymsp[-2].minor.yy62,yymsp[0].minor.yy334,0);} -#line 6456 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3402 "parse.c" /* No destructor defined for COMMA */ break; case 228: -#line 696 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 698 "parse.y" {yygotominor.yy62 = sqliteExprListAppend(0,yymsp[0].minor.yy334,0);} -#line 6462 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3408 "parse.c" break; case 229: -#line 697 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 699 "parse.y" {yygotominor.yy334 = yymsp[0].minor.yy334;} -#line 6467 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3413 "parse.c" break; case 230: -#line 698 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 700 "parse.y" {yygotominor.yy334 = 0;} -#line 6472 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3418 "parse.c" break; case 231: -#line 703 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 705 "parse.y" { SrcList *pSrc = sqliteSrcListAppend(0, &yymsp[-5].minor.yy210, &yymsp[-4].minor.yy210); if( yymsp[-9].minor.yy52!=OE_None ) yymsp[-9].minor.yy52 = yymsp[0].minor.yy52; if( yymsp[-9].minor.yy52==OE_Default) yymsp[-9].minor.yy52 = OE_Abort; - sqliteCreateIndex(pParse, &yymsp[-7].minor.yy210, pSrc, yymsp[-2].minor.yy92, yymsp[-9].minor.yy52, yymsp[-10].minor.yy52, &yymsp[-11].minor.yy0, &yymsp[-1].minor.yy0); + sqliteCreateIndex(pParse, &yymsp[-7].minor.yy210, pSrc, yymsp[-2].minor.yy92, yymsp[-9].minor.yy52, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0); } -#line 6482 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3428 "parse.c" /* No destructor defined for INDEX */ /* No destructor defined for ON */ /* No destructor defined for LP */ break; case 232: -#line 711 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 713 "parse.y" { yygotominor.yy52 = OE_Abort; } -#line 6490 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3436 "parse.c" /* No destructor defined for UNIQUE */ break; case 233: -#line 712 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 714 "parse.y" { yygotominor.yy52 = OE_None; } -#line 6496 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3442 "parse.c" break; case 234: -#line 720 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 722 "parse.y" {yygotominor.yy92 = 0;} -#line 6501 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3447 "parse.c" break; case 235: -#line 721 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 723 "parse.y" {yygotominor.yy92 = yymsp[-1].minor.yy92;} -#line 6506 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3452 "parse.c" /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 236: -#line 722 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 724 "parse.y" {yygotominor.yy92 = sqliteIdListAppend(yymsp[-2].minor.yy92,&yymsp[0].minor.yy210);} -#line 6513 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3459 "parse.c" /* No destructor defined for COMMA */ break; case 237: -#line 723 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 725 "parse.y" {yygotominor.yy92 = sqliteIdListAppend(0,&yymsp[0].minor.yy210);} -#line 6519 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3465 "parse.c" break; case 238: -#line 724 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 726 "parse.y" {yygotominor.yy210 = yymsp[-1].minor.yy210;} -#line 6524 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3470 "parse.c" /* No destructor defined for sortorder */ break; case 239: -#line 729 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 731 "parse.y" { sqliteDropIndex(pParse, sqliteSrcListAppend(0,&yymsp[-1].minor.yy210,&yymsp[0].minor.yy210)); } -#line 6532 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3478 "parse.c" /* No destructor defined for DROP */ /* No destructor defined for INDEX */ break; case 240: -#line 737 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 739 "parse.y" {sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-6].minor.yy210,&yymsp[-5].minor.yy210),&yymsp[-3].minor.yy210,&yymsp[0].minor.yy0,yymsp[-7].minor.yy52);} -#line 6539 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3485 "parse.c" /* No destructor defined for COPY */ /* No destructor defined for FROM */ /* No destructor defined for USING */ /* No destructor defined for DELIMITERS */ break; case 241: -#line 739 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 741 "parse.y" {sqliteCopy(pParse,sqliteSrcListAppend(0,&yymsp[-3].minor.yy210,&yymsp[-2].minor.yy210),&yymsp[0].minor.yy210,0,yymsp[-4].minor.yy52);} -#line 6548 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3494 "parse.c" /* No destructor defined for COPY */ /* No destructor defined for FROM */ break; case 242: -#line 743 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 745 "parse.y" {sqliteVacuum(pParse,0);} -#line 6555 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3501 "parse.c" /* No destructor defined for VACUUM */ break; case 243: -#line 744 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 746 "parse.y" {sqliteVacuum(pParse,&yymsp[0].minor.yy210);} -#line 6561 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3507 "parse.c" /* No destructor defined for VACUUM */ break; case 244: -#line 748 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 750 "parse.y" {sqlitePragma(pParse,&yymsp[-2].minor.yy210,&yymsp[0].minor.yy210,0);} -#line 6567 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3513 "parse.c" /* No destructor defined for PRAGMA */ /* No destructor defined for EQ */ break; case 245: -#line 749 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 751 "parse.y" {sqlitePragma(pParse,&yymsp[-2].minor.yy210,&yymsp[0].minor.yy0,0);} -#line 6574 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3520 "parse.c" /* No destructor defined for PRAGMA */ /* No destructor defined for EQ */ break; case 246: -#line 750 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 752 "parse.y" {sqlitePragma(pParse,&yymsp[-2].minor.yy210,&yymsp[0].minor.yy210,0);} -#line 6581 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3527 "parse.c" /* No destructor defined for PRAGMA */ /* No destructor defined for EQ */ break; case 247: -#line 751 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 753 "parse.y" {sqlitePragma(pParse,&yymsp[-2].minor.yy210,&yymsp[0].minor.yy210,1);} -#line 6588 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3534 "parse.c" /* No destructor defined for PRAGMA */ /* No destructor defined for EQ */ break; case 248: -#line 752 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 754 "parse.y" {sqlitePragma(pParse,&yymsp[-3].minor.yy210,&yymsp[-1].minor.yy210,0);} -#line 6595 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3541 "parse.c" /* No destructor defined for PRAGMA */ /* No destructor defined for LP */ /* No destructor defined for RP */ break; case 249: -#line 753 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 755 "parse.y" {sqlitePragma(pParse,&yymsp[0].minor.yy210,&yymsp[0].minor.yy210,0);} -#line 6603 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3549 "parse.c" /* No destructor defined for PRAGMA */ break; case 250: -#line 754 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 756 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy210;} -#line 6609 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3555 "parse.c" /* No destructor defined for plus_opt */ break; case 251: -#line 755 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 757 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy210;} -#line 6615 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3561 "parse.c" /* No destructor defined for MINUS */ break; case 252: -#line 756 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 758 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 6621 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3567 "parse.c" break; case 253: -#line 757 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 759 "parse.y" {yygotominor.yy210 = yymsp[0].minor.yy0;} -#line 6626 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3572 "parse.c" break; case 254: /* No destructor defined for PLUS */ @@ -6632,133 +3577,133 @@ static void yy_reduce( case 255: break; case 256: -#line 763 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 765 "parse.y" { Token all; all.z = yymsp[-4].minor.yy0.z; all.n = (yymsp[0].minor.yy0.z - yymsp[-4].minor.yy0.z) + yymsp[0].minor.yy0.n; sqliteFinishTrigger(pParse, yymsp[-1].minor.yy347, &all); } -#line 6641 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3587 "parse.c" /* No destructor defined for trigger_decl */ /* No destructor defined for BEGIN */ break; case 257: -#line 771 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 773 "parse.y" { SrcList *pTab = sqliteSrcListAppend(0, &yymsp[-3].minor.yy210, &yymsp[-2].minor.yy210); sqliteBeginTrigger(pParse, &yymsp[-7].minor.yy210, yymsp[-6].minor.yy52, yymsp[-5].minor.yy234.a, yymsp[-5].minor.yy234.b, pTab, yymsp[-1].minor.yy52, yymsp[0].minor.yy270, yymsp[-9].minor.yy52); } -#line 6651 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3597 "parse.c" /* No destructor defined for TRIGGER */ /* No destructor defined for ON */ break; case 258: -#line 777 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 779 "parse.y" { yygotominor.yy52 = TK_BEFORE; } -#line 6658 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3604 "parse.c" /* No destructor defined for BEFORE */ break; case 259: -#line 778 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 780 "parse.y" { yygotominor.yy52 = TK_AFTER; } -#line 6664 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3610 "parse.c" /* No destructor defined for AFTER */ break; case 260: -#line 779 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 781 "parse.y" { yygotominor.yy52 = TK_INSTEAD;} -#line 6670 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3616 "parse.c" /* No destructor defined for INSTEAD */ /* No destructor defined for OF */ break; case 261: -#line 780 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 782 "parse.y" { yygotominor.yy52 = TK_BEFORE; } -#line 6677 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3623 "parse.c" break; case 262: -#line 784 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 786 "parse.y" { yygotominor.yy234.a = TK_DELETE; yygotominor.yy234.b = 0; } -#line 6682 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3628 "parse.c" /* No destructor defined for DELETE */ break; case 263: -#line 785 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 787 "parse.y" { yygotominor.yy234.a = TK_INSERT; yygotominor.yy234.b = 0; } -#line 6688 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3634 "parse.c" /* No destructor defined for INSERT */ break; case 264: -#line 786 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 788 "parse.y" { yygotominor.yy234.a = TK_UPDATE; yygotominor.yy234.b = 0;} -#line 6694 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3640 "parse.c" /* No destructor defined for UPDATE */ break; case 265: -#line 787 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 789 "parse.y" {yygotominor.yy234.a = TK_UPDATE; yygotominor.yy234.b = yymsp[0].minor.yy92; } -#line 6700 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3646 "parse.c" /* No destructor defined for UPDATE */ /* No destructor defined for OF */ break; case 266: -#line 790 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 792 "parse.y" { yygotominor.yy52 = TK_ROW; } -#line 6707 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3653 "parse.c" break; case 267: -#line 791 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 793 "parse.y" { yygotominor.yy52 = TK_ROW; } -#line 6712 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3658 "parse.c" /* No destructor defined for FOR */ /* No destructor defined for EACH */ /* No destructor defined for ROW */ break; case 268: -#line 792 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 794 "parse.y" { yygotominor.yy52 = TK_STATEMENT; } -#line 6720 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3666 "parse.c" /* No destructor defined for FOR */ /* No destructor defined for EACH */ /* No destructor defined for STATEMENT */ break; case 269: -#line 795 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 797 "parse.y" { yygotominor.yy270 = 0; } -#line 6728 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3674 "parse.c" break; case 270: -#line 796 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 798 "parse.y" { yygotominor.yy270 = yymsp[0].minor.yy334; } -#line 6733 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3679 "parse.c" /* No destructor defined for WHEN */ break; case 271: -#line 800 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 802 "parse.y" { yymsp[-2].minor.yy347->pNext = yymsp[0].minor.yy347; yygotominor.yy347 = yymsp[-2].minor.yy347; } -#line 6742 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3688 "parse.c" /* No destructor defined for SEMI */ break; case 272: -#line 804 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 806 "parse.y" { yygotominor.yy347 = 0; } -#line 6748 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3694 "parse.c" break; case 273: -#line 810 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 812 "parse.y" { yygotominor.yy347 = sqliteTriggerUpdateStep(&yymsp[-3].minor.yy210, yymsp[-1].minor.yy62, yymsp[0].minor.yy334, yymsp[-4].minor.yy52); } -#line 6753 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3699 "parse.c" /* No destructor defined for UPDATE */ /* No destructor defined for SET */ break; case 274: -#line 815 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 817 "parse.y" {yygotominor.yy347 = sqliteTriggerInsertStep(&yymsp[-5].minor.yy210, yymsp[-4].minor.yy92, yymsp[-1].minor.yy62, 0, yymsp[-7].minor.yy52);} -#line 6760 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3706 "parse.c" /* No destructor defined for INSERT */ /* No destructor defined for INTO */ /* No destructor defined for VALUES */ @@ -6766,86 +3711,86 @@ static void yy_reduce( /* No destructor defined for RP */ break; case 275: -#line 818 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 820 "parse.y" {yygotominor.yy347 = sqliteTriggerInsertStep(&yymsp[-2].minor.yy210, yymsp[-1].minor.yy92, 0, yymsp[0].minor.yy11, yymsp[-4].minor.yy52);} -#line 6770 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3716 "parse.c" /* No destructor defined for INSERT */ /* No destructor defined for INTO */ break; case 276: -#line 822 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 824 "parse.y" {yygotominor.yy347 = sqliteTriggerDeleteStep(&yymsp[-1].minor.yy210, yymsp[0].minor.yy334);} -#line 6777 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3723 "parse.c" /* No destructor defined for DELETE */ /* No destructor defined for FROM */ break; case 277: -#line 825 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 827 "parse.y" {yygotominor.yy347 = sqliteTriggerSelectStep(yymsp[0].minor.yy11); } -#line 6784 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3730 "parse.c" break; case 278: -#line 828 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 830 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_RAISE, 0, 0, 0); yygotominor.yy334->iColumn = OE_Ignore; sqliteExprSpan(yygotominor.yy334, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); } -#line 6793 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3739 "parse.c" /* No destructor defined for LP */ /* No destructor defined for IGNORE */ break; case 279: -#line 833 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 835 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy210); yygotominor.yy334->iColumn = OE_Rollback; sqliteExprSpan(yygotominor.yy334, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); } -#line 6804 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3750 "parse.c" /* No destructor defined for LP */ /* No destructor defined for ROLLBACK */ /* No destructor defined for COMMA */ break; case 280: -#line 838 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 840 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy210); yygotominor.yy334->iColumn = OE_Abort; sqliteExprSpan(yygotominor.yy334, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); } -#line 6816 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3762 "parse.c" /* No destructor defined for LP */ /* No destructor defined for ABORT */ /* No destructor defined for COMMA */ break; case 281: -#line 843 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 845 "parse.y" { yygotominor.yy334 = sqliteExpr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy210); yygotominor.yy334->iColumn = OE_Fail; sqliteExprSpan(yygotominor.yy334, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0); } -#line 6828 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3774 "parse.c" /* No destructor defined for LP */ /* No destructor defined for FAIL */ /* No destructor defined for COMMA */ break; case 282: -#line 850 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 852 "parse.y" { sqliteDropTrigger(pParse,sqliteSrcListAppend(0,&yymsp[-1].minor.yy210,&yymsp[0].minor.yy210)); } -#line 6838 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3784 "parse.c" /* No destructor defined for DROP */ /* No destructor defined for TRIGGER */ break; case 283: -#line 855 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 857 "parse.y" { sqliteAttach(pParse, &yymsp[-2].minor.yy210, &yymsp[0].minor.yy210); } -#line 6847 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3793 "parse.c" /* No destructor defined for ATTACH */ /* No destructor defined for database_kw_opt */ /* No destructor defined for AS */ @@ -6856,11 +3801,11 @@ static void yy_reduce( case 285: break; case 286: -#line 863 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 865 "parse.y" { sqliteDetach(pParse, &yymsp[0].minor.yy210); } -#line 6862 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3808 "parse.c" /* No destructor defined for DETACH */ /* No destructor defined for database_kw_opt */ break; @@ -6868,8 +3813,7 @@ static void yy_reduce( yygoto = yyRuleInfo[yyruleno].lhs; yysize = yyRuleInfo[yyruleno].nrhs; yypParser->yyidx -= yysize; - yypParser->yytop -= yysize; - yyact = yy_find_parser_action(yypParser,yygoto); + yyact = yy_find_reduce_action(yypParser,yygoto); if( yyact < YYNSTATE ){ yy_shift(yypParser,yyact,yygoto,&yygotominor); }else if( yyact == YYNSTATE + YYNRULE + 1 ){ @@ -6905,19 +3849,19 @@ static void yy_syntax_error( ){ sqliteParserARG_FETCH; #define TOKEN (yyminor.yy0) -#line 23 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.y" +#line 23 "parse.y" if( pParse->zErrMsg==0 ){ if( TOKEN.z[0] ){ sqliteSetNString(&pParse->zErrMsg, "near \"", -1, TOKEN.z, TOKEN.n, "\": syntax error", -1, 0); }else{ - sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", 0); + sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", (char*)0); } } pParse->nErr++; -#line 6919 "/home/wez/src/php/php4.3-cvs/ext/sqlite/libsqlite/src/parse.c" +#line 3864 "parse.c" sqliteParserARG_STORE; /* Suppress warning about unused %extra_argument variable */ } @@ -6976,9 +3920,8 @@ void sqliteParser( if( yymajor==0 ) return; yypParser->yyidx = 0; yypParser->yyerrcnt = -1; - yypParser->yytop = &yypParser->yystack[0]; - yypParser->yytop->stateno = 0; - yypParser->yytop->major = 0; + yypParser->yystack[0].stateno = 0; + yypParser->yystack[0].major = 0; } yyminorunion.yy0 = yyminor; yyendofinput = (yymajor==0); @@ -6991,7 +3934,7 @@ void sqliteParser( #endif do{ - yyact = yy_find_parser_action(yypParser,yymajor); + yyact = yy_find_shift_action(yypParser,yymajor); if( yyact<YYNSTATE ){ yy_shift(yypParser,yyact,yymajor,&yyminorunion); yypParser->yyerrcnt--; @@ -7003,6 +3946,7 @@ void sqliteParser( }else if( yyact < YYNSTATE + YYNRULE ){ yy_reduce(yypParser,yyact-YYNSTATE); }else if( yyact == YY_ERROR_ACTION ){ + int yymx; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); @@ -7031,7 +3975,8 @@ void sqliteParser( if( yypParser->yyerrcnt<0 ){ yy_syntax_error(yypParser,yymajor,yyminorunion); } - if( yypParser->yytop->major==YYERRORSYMBOL || yyerrorhit ){ + yymx = yypParser->yystack[yypParser->yyidx].major; + if( yymx==YYERRORSYMBOL || yyerrorhit ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", @@ -7043,8 +3988,8 @@ void sqliteParser( }else{ while( yypParser->yyidx >= 0 && - yypParser->yytop->major != YYERRORSYMBOL && - (yyact = yy_find_parser_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE + yymx != YYERRORSYMBOL && + (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE ){ yy_pop_parser_stack(yypParser); } @@ -7052,7 +3997,7 @@ void sqliteParser( yy_destructor(yymajor,&yyminorunion); yy_parse_failed(yypParser); yymajor = YYNOCODE; - }else if( yypParser->yytop->major!=YYERRORSYMBOL ){ + }else if( yymx!=YYERRORSYMBOL ){ YYMINORTYPE u2; u2.YYERRSYMDT = 0; yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2); diff --git a/ext/sqlite/libsqlite/src/parse.h b/ext/sqlite/libsqlite/src/parse.h index aba9766596..60e93cc501 100644 --- a/ext/sqlite/libsqlite/src/parse.h +++ b/ext/sqlite/libsqlite/src/parse.h @@ -89,42 +89,42 @@ #define TK_OFFSET 89 #define TK_ON 90 #define TK_OR 91 -#define TK_ORACLE_OUTER_JOIN 92 -#define TK_ORDER 93 -#define TK_PLUS 94 -#define TK_PRAGMA 95 -#define TK_PRIMARY 96 -#define TK_RAISE 97 -#define TK_REFERENCES 98 -#define TK_REM 99 -#define TK_REPLACE 100 -#define TK_RESTRICT 101 -#define TK_ROLLBACK 102 -#define TK_ROW 103 -#define TK_RP 104 -#define TK_RSHIFT 105 -#define TK_SELECT 106 -#define TK_SEMI 107 -#define TK_SET 108 -#define TK_SLASH 109 -#define TK_SPACE 110 -#define TK_STAR 111 -#define TK_STATEMENT 112 -#define TK_STRING 113 -#define TK_TABLE 114 -#define TK_TEMP 115 -#define TK_THEN 116 -#define TK_TRANSACTION 117 -#define TK_TRIGGER 118 -#define TK_UMINUS 119 -#define TK_UNCLOSED_STRING 120 -#define TK_UNION 121 -#define TK_UNIQUE 122 -#define TK_UPDATE 123 -#define TK_UPLUS 124 -#define TK_USING 125 -#define TK_VACUUM 126 -#define TK_VALUES 127 +#define TK_ORDER 92 +#define TK_PLUS 93 +#define TK_PRAGMA 94 +#define TK_PRIMARY 95 +#define TK_RAISE 96 +#define TK_REFERENCES 97 +#define TK_REM 98 +#define TK_REPLACE 99 +#define TK_RESTRICT 100 +#define TK_ROLLBACK 101 +#define TK_ROW 102 +#define TK_RP 103 +#define TK_RSHIFT 104 +#define TK_SELECT 105 +#define TK_SEMI 106 +#define TK_SET 107 +#define TK_SLASH 108 +#define TK_SPACE 109 +#define TK_STAR 110 +#define TK_STATEMENT 111 +#define TK_STRING 112 +#define TK_TABLE 113 +#define TK_TEMP 114 +#define TK_THEN 115 +#define TK_TRANSACTION 116 +#define TK_TRIGGER 117 +#define TK_UMINUS 118 +#define TK_UNCLOSED_STRING 119 +#define TK_UNION 120 +#define TK_UNIQUE 121 +#define TK_UPDATE 122 +#define TK_UPLUS 123 +#define TK_USING 124 +#define TK_VACUUM 125 +#define TK_VALUES 126 +#define TK_VARIABLE 127 #define TK_VIEW 128 #define TK_WHEN 129 #define TK_WHERE 130 diff --git a/ext/sqlite/libsqlite/src/parse.y b/ext/sqlite/libsqlite/src/parse.y index b434fb08a7..3aee9f0c95 100644 --- a/ext/sqlite/libsqlite/src/parse.y +++ b/ext/sqlite/libsqlite/src/parse.y @@ -26,7 +26,7 @@ sqliteSetNString(&pParse->zErrMsg, "near \"", -1, TOKEN.z, TOKEN.n, "\": syntax error", -1, 0); }else{ - sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", 0); + sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", (char*)0); } } pParse->nErr++; @@ -125,10 +125,10 @@ id(A) ::= ID(X). {A = X;} // fallback to ID if they will not parse as their original value. // This obviates the need for the "id" nonterminal. // -%fallback ID +%fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR - IGNORE IMMEDIATE INITIALLY INSTEAD MATCH KEY + GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH KEY OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT TEMP TRIGGER VACUUM VIEW. @@ -153,9 +153,10 @@ type ::= typename(X) LP signed COMMA signed RP(Y). %type typename {Token} typename(A) ::= ids(X). {A = X;} typename(A) ::= typename(X) ids. {A = X;} -signed ::= INTEGER. -signed ::= PLUS INTEGER. -signed ::= MINUS INTEGER. +%type signed {int} +signed(A) ::= INTEGER(X). { A = atoi(X.z); } +signed(A) ::= PLUS INTEGER(X). { A = atoi(X.z); } +signed(A) ::= MINUS INTEGER(X). { A = -atoi(X.z); } carglist ::= carglist carg. carglist ::= . carg ::= CONSTRAINT nm ccons. @@ -176,7 +177,7 @@ carg ::= DEFAULT NULL. ccons ::= NULL onconf. ccons ::= NOT NULL onconf(R). {sqliteAddNotNull(pParse, R);} ccons ::= PRIMARY KEY sortorder onconf(R). {sqliteAddPrimaryKey(pParse,0,R);} -ccons ::= UNIQUE onconf(R). {sqliteCreateIndex(pParse,0,0,0,R,0,0,0);} +ccons ::= UNIQUE onconf(R). {sqliteCreateIndex(pParse,0,0,0,R,0,0);} ccons ::= CHECK LP expr RP onconf. ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R). {sqliteCreateForeignKey(pParse,0,&T,TA,R);} @@ -223,7 +224,7 @@ tcons ::= CONSTRAINT nm. tcons ::= PRIMARY KEY LP idxlist(X) RP onconf(R). {sqliteAddPrimaryKey(pParse,X,R);} tcons ::= UNIQUE LP idxlist(X) RP onconf(R). - {sqliteCreateIndex(pParse,0,0,X,R,0,0,0);} + {sqliteCreateIndex(pParse,0,0,X,R,0,0);} tcons ::= CHECK expr onconf. tcons ::= FOREIGN KEY LP idxlist(FA) RP REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). { @@ -442,12 +443,12 @@ having_opt(A) ::= . {A = 0;} having_opt(A) ::= HAVING expr(X). {A = X;} %type limit_opt {struct LimitVal} -limit_opt(A) ::= . {A.limit = -1; A.offset = 0;} -limit_opt(A) ::= LIMIT INTEGER(X). {A.limit = atoi(X.z); A.offset = 0;} -limit_opt(A) ::= LIMIT INTEGER(X) OFFSET INTEGER(Y). - {A.limit = atoi(X.z); A.offset = atoi(Y.z);} -limit_opt(A) ::= LIMIT INTEGER(X) COMMA INTEGER(Y). - {A.limit = atoi(Y.z); A.offset = atoi(X.z);} +limit_opt(A) ::= . {A.limit = -1; A.offset = 0;} +limit_opt(A) ::= LIMIT signed(X). {A.limit = X; A.offset = 0;} +limit_opt(A) ::= LIMIT signed(X) OFFSET signed(Y). + {A.limit = X; A.offset = Y;} +limit_opt(A) ::= LIMIT signed(X) COMMA signed(Y). + {A.limit = Y; A.offset = X;} /////////////////////////// The DELETE statement ///////////////////////////// // @@ -514,7 +515,6 @@ inscollist(A) ::= nm(Y). {A = sqliteIdListAppend(0,&Y);} %left STAR SLASH REM. %left CONCAT. %right UMINUS UPLUS BITNOT. -%right ORACLE_OUTER_JOIN. %type expr {Expr*} %destructor expr {sqliteExprDelete($$);} @@ -535,11 +535,13 @@ expr(A) ::= nm(X) DOT nm(Y) DOT nm(Z). { Expr *temp4 = sqliteExpr(TK_DOT, temp2, temp3, 0); A = sqliteExpr(TK_DOT, temp1, temp4, 0); } -expr(A) ::= expr(B) ORACLE_OUTER_JOIN. - {A = B; ExprSetProperty(A,EP_Oracle8Join);} expr(A) ::= INTEGER(X). {A = sqliteExpr(TK_INTEGER, 0, 0, &X);} expr(A) ::= FLOAT(X). {A = sqliteExpr(TK_FLOAT, 0, 0, &X);} expr(A) ::= STRING(X). {A = sqliteExpr(TK_STRING, 0, 0, &X);} +expr(A) ::= VARIABLE(X). { + A = sqliteExpr(TK_VARIABLE, 0, 0, &X); + if( A ) A->iTable = ++pParse->nVar; +} expr(A) ::= ID(X) LP exprlist(Y) RP(E). { A = sqliteExprFunction(Y, &X); sqliteExprSpan(A,&X,&E); @@ -699,12 +701,12 @@ expritem(A) ::= . {A = 0;} ///////////////////////////// The CREATE INDEX command /////////////////////// // -cmd ::= CREATE(S) temp(T) uniqueflag(U) INDEX nm(X) +cmd ::= CREATE(S) uniqueflag(U) INDEX nm(X) ON nm(Y) dbnm(D) LP idxlist(Z) RP(E) onconf(R). { SrcList *pSrc = sqliteSrcListAppend(0, &Y, &D); if( U!=OE_None ) U = R; if( U==OE_Default) U = OE_Abort; - sqliteCreateIndex(pParse, &X, pSrc, Z, U, T, &S, &E); + sqliteCreateIndex(pParse, &X, pSrc, Z, U, &S, &E); } %type uniqueflag {int} diff --git a/ext/sqlite/libsqlite/src/pragma.c b/ext/sqlite/libsqlite/src/pragma.c index 252aa502db..064ec6b1f5 100644 --- a/ext/sqlite/libsqlite/src/pragma.c +++ b/ext/sqlite/libsqlite/src/pragma.c @@ -343,6 +343,7 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ { OP_ColumnName, 2, 0, "type"}, { OP_ColumnName, 3, 0, "notnull"}, { OP_ColumnName, 4, 0, "dflt_value"}, + { OP_ColumnName, 5, 0, "pk"}, }; int i; sqliteVdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); @@ -357,7 +358,8 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0); sqliteVdbeAddOp(v, OP_String, 0, 0); sqliteVdbeChangeP3(v, -1, pTab->aCol[i].zDflt, P3_STATIC); - sqliteVdbeAddOp(v, OP_Callback, 5, 0); + sqliteVdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0); + sqliteVdbeAddOp(v, OP_Callback, 6, 0); } } }else @@ -416,6 +418,45 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ } }else + if( sqliteStrICmp(zLeft, "foreign_key_list")==0 ){ + FKey *pFK; + Table *pTab; + pTab = sqliteFindTable(db, zRight, 0); + if( pTab ){ + v = sqliteGetVdbe(pParse); + pFK = pTab->pFKey; + } + if( pTab && pFK ){ + int i = 0; + static VdbeOp indexListPreface[] = { + { OP_ColumnName, 0, 0, "id"}, + { OP_ColumnName, 1, 0, "seq"}, + { OP_ColumnName, 2, 0, "table"}, + { OP_ColumnName, 3, 0, "from"}, + { OP_ColumnName, 4, 0, "to"}, + }; + + sqliteVdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); + while(pFK){ + int j; + for(j=0; j<pFK->nCol; j++){ + sqliteVdbeAddOp(v, OP_Integer, i, 0); + sqliteVdbeAddOp(v, OP_Integer, j, 0); + sqliteVdbeAddOp(v, OP_String, 0, 0); + sqliteVdbeChangeP3(v, -1, pFK->zTo, P3_STATIC); + sqliteVdbeAddOp(v, OP_String, 0, 0); + sqliteVdbeChangeP3(v, -1, pTab->aCol[pFK->aCol[j].iFrom].zName, + P3_STATIC); + sqliteVdbeAddOp(v, OP_String, 0, 0); + sqliteVdbeChangeP3(v, -1, pFK->aCol[j].zCol, P3_STATIC); + sqliteVdbeAddOp(v, OP_Callback, 5, 0); + } + ++i; + pFK = pFK->pNextFrom; + } + } + }else + if( sqliteStrICmp(zLeft, "database_list")==0 ){ int i; static VdbeOp indexListPreface[] = { @@ -437,6 +478,8 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ sqliteVdbeAddOp(v, OP_Callback, 3, 0); } }else + + /* ** PRAGMA temp_store ** PRAGMA temp_store = "default"|"memory"|"file" @@ -509,28 +552,149 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){ #endif if( sqliteStrICmp(zLeft, "integrity_check")==0 ){ + int i, j, addr; + + /* Code that initializes the integrity check program. Set the + ** error count 0 + */ + static VdbeOp initCode[] = { + { OP_Integer, 0, 0, 0}, + { OP_MemStore, 0, 1, 0}, + { OP_ColumnName, 0, 0, "integrity_check"}, + }; + + /* Code to do an BTree integrity check on a single database file. + */ static VdbeOp checkDb[] = { { OP_SetInsert, 0, 0, "2"}, - { OP_Integer, 0, 0, 0}, + { OP_Integer, 0, 0, 0}, /* 1 */ { OP_OpenRead, 0, 2, 0}, - { OP_Rewind, 0, 7, 0}, + { OP_Rewind, 0, 7, 0}, /* 3 */ { OP_Column, 0, 3, 0}, /* 4 */ { OP_SetInsert, 0, 0, 0}, - { OP_Next, 0, 4, 0}, + { OP_Next, 0, 4, 0}, /* 6 */ { OP_IntegrityCk, 0, 0, 0}, /* 7 */ - { OP_ColumnName, 0, 0, "integrity_check"}, + { OP_Dup, 0, 1, 0}, + { OP_String, 0, 0, "ok"}, + { OP_StrEq, 0, 12, 0}, /* 10 */ + { OP_MemIncr, 0, 0, 0}, + { OP_String, 0, 0, "*** in database "}, + { OP_String, 0, 0, 0}, /* 13 */ + { OP_String, 0, 0, " ***\n"}, + { OP_Pull, 3, 0, 0}, + { OP_Concat, 4, 1, 0}, { OP_Callback, 1, 0, 0}, - { OP_SetInsert, 1, 0, "2"}, - { OP_Integer, 1, 0, 0}, - { OP_OpenRead, 1, 2, 0}, - { OP_Rewind, 1, 17, 0}, - { OP_Column, 1, 3, 0}, /* 14 */ - { OP_SetInsert, 1, 0, 0}, - { OP_Next, 1, 14, 0}, - { OP_IntegrityCk, 1, 1, 0}, /* 17 */ + }; + + /* Code that appears at the end of the integrity check. If no error + ** messages have been generated, output OK. Otherwise output the + ** error message + */ + static VdbeOp endCode[] = { + { OP_MemLoad, 0, 0, 0}, + { OP_Integer, 0, 0, 0}, + { OP_Ne, 0, 0, 0}, /* 2 */ + { OP_String, 0, 0, "ok"}, { OP_Callback, 1, 0, 0}, }; - sqliteVdbeAddOpList(v, ArraySize(checkDb), checkDb); + + /* Initialize the VDBE program */ + sqliteVdbeAddOpList(v, ArraySize(initCode), initCode); + + /* Do an integrity check on each database file */ + for(i=0; i<db->nDb; i++){ + HashElem *x; + + /* Do an integrity check of the B-Tree + */ + addr = sqliteVdbeAddOpList(v, ArraySize(checkDb), checkDb); + sqliteVdbeChangeP1(v, addr+1, i); + sqliteVdbeChangeP2(v, addr+3, addr+7); + sqliteVdbeChangeP2(v, addr+6, addr+4); + sqliteVdbeChangeP2(v, addr+7, i); + sqliteVdbeChangeP2(v, addr+10, addr+ArraySize(checkDb)); + sqliteVdbeChangeP3(v, addr+13, db->aDb[i].zName, P3_STATIC); + + /* Make sure all the indices are constructed correctly. + */ + sqliteCodeVerifySchema(pParse, i); + for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){ + Table *pTab = sqliteHashData(x); + Index *pIdx; + int loopTop; + + if( pTab->pIndex==0 ) continue; + sqliteVdbeAddOp(v, OP_Integer, i, 0); + sqliteVdbeAddOp(v, OP_OpenRead, 1, pTab->tnum); + sqliteVdbeChangeP3(v, -1, pTab->zName, P3_STATIC); + for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ + if( pIdx->tnum==0 ) continue; + sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0); + sqliteVdbeAddOp(v, OP_OpenRead, j+2, pIdx->tnum); + sqliteVdbeChangeP3(v, -1, pIdx->zName, P3_STATIC); + } + sqliteVdbeAddOp(v, OP_Integer, 0, 0); + sqliteVdbeAddOp(v, OP_MemStore, 1, 1); + loopTop = sqliteVdbeAddOp(v, OP_Rewind, 1, 0); + sqliteVdbeAddOp(v, OP_MemIncr, 1, 0); + for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ + int k, jmp2; + static VdbeOp idxErr[] = { + { OP_MemIncr, 0, 0, 0}, + { OP_String, 0, 0, "rowid "}, + { OP_Recno, 1, 0, 0}, + { OP_String, 0, 0, " missing from index "}, + { OP_String, 0, 0, 0}, /* 4 */ + { OP_Concat, 4, 0, 0}, + { OP_Callback, 1, 0, 0}, + }; + sqliteVdbeAddOp(v, OP_Recno, 1, 0); + for(k=0; k<pIdx->nColumn; k++){ + int idx = pIdx->aiColumn[k]; + if( idx==pTab->iPKey ){ + sqliteVdbeAddOp(v, OP_Recno, 1, 0); + }else{ + sqliteVdbeAddOp(v, OP_Column, 1, idx); + } + } + sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0); + if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx); + jmp2 = sqliteVdbeAddOp(v, OP_Found, j+2, 0); + addr = sqliteVdbeAddOpList(v, ArraySize(idxErr), idxErr); + sqliteVdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC); + sqliteVdbeChangeP2(v, jmp2, sqliteVdbeCurrentAddr(v)); + } + sqliteVdbeAddOp(v, OP_Next, 1, loopTop+1); + sqliteVdbeChangeP2(v, loopTop, sqliteVdbeCurrentAddr(v)); + for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ + static VdbeOp cntIdx[] = { + { OP_Integer, 0, 0, 0}, + { OP_MemStore, 2, 1, 0}, + { OP_Rewind, 0, 0, 0}, /* 2 */ + { OP_MemIncr, 2, 0, 0}, + { OP_Next, 0, 0, 0}, /* 4 */ + { OP_MemLoad, 1, 0, 0}, + { OP_MemLoad, 2, 0, 0}, + { OP_Eq, 0, 0, 0}, /* 7 */ + { OP_MemIncr, 0, 0, 0}, + { OP_String, 0, 0, "wrong # of entries in index "}, + { OP_String, 0, 0, 0}, /* 10 */ + { OP_Concat, 2, 0, 0}, + { OP_Callback, 1, 0, 0}, + }; + if( pIdx->tnum==0 ) continue; + addr = sqliteVdbeAddOpList(v, ArraySize(cntIdx), cntIdx); + sqliteVdbeChangeP1(v, addr+2, j+2); + sqliteVdbeChangeP2(v, addr+2, addr+5); + sqliteVdbeChangeP1(v, addr+4, j+2); + sqliteVdbeChangeP2(v, addr+4, addr+3); + sqliteVdbeChangeP2(v, addr+7, addr+ArraySize(cntIdx)); + sqliteVdbeChangeP3(v, addr+10, pIdx->zName, P3_STATIC); + } + } + } + addr = sqliteVdbeAddOpList(v, ArraySize(endCode), endCode); + sqliteVdbeChangeP2(v, addr+2, addr+ArraySize(endCode)); }else {} diff --git a/ext/sqlite/libsqlite/src/printf.c b/ext/sqlite/libsqlite/src/printf.c index 8587f80d28..a8af91434e 100644 --- a/ext/sqlite/libsqlite/src/printf.c +++ b/ext/sqlite/libsqlite/src/printf.c @@ -66,6 +66,7 @@ enum et_type { /* The type of the format field */ etGENERIC, /* Floating or exponential, depending on exponent. %g */ etSIZE, /* Return number of characters processed so far. %n */ etSTRING, /* Strings. %s */ + etDYNSTRING, /* Dynamically allocated strings. %z */ etPERCENT, /* Percent symbol. %% */ etCHARX, /* Characters. %c */ etERROR, /* Used to indicate no such conversion type */ @@ -97,6 +98,7 @@ typedef struct et_info { /* Information about each format field */ static et_info fmtinfo[] = { { 'd', 10, "0123456789", 1, 0, etRADIX, }, { 's', 0, 0, 0, 0, etSTRING, }, + { 'z', 0, 0, 0, 0, etDYNSTRING, }, { 'q', 0, 0, 0, 0, etSQLESCAPE, }, { 'Q', 0, 0, 0, 0, etSQLESCAPE2, }, { 'c', 0, 0, 0, 0, etCHARX, }, @@ -137,9 +139,9 @@ static et_info fmtinfo[] = { ** 16 (the number of significant digits in a 64-bit float) '0' is ** always returned. */ -static int et_getdigit(double *val, int *cnt){ +static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ int digit; - double d; + LONGDOUBLE_TYPE d; if( (*cnt)++ >= 16 ) return '0'; digit = (int)*val; d = digit; @@ -200,7 +202,7 @@ static int vxprintf( int flag_long; /* True if "l" flag is present */ int flag_center; /* True if "=" flag is present */ unsigned long longvalue; /* Value for integer types */ - double realvalue; /* Value for real types */ + LONGDOUBLE_TYPE realvalue; /* Value for real types */ et_info *infop; /* Pointer to the appropriate info structure */ char buf[etBUFSIZE]; /* Conversion buffer */ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ @@ -389,7 +391,7 @@ static int vxprintf( longvalue = longvalue/base; }while( longvalue>0 ); } - length = (long)&buf[etBUFSIZE]-(long)bufpt; + length = &buf[etBUFSIZE]-bufpt; for(idx=precision-length; idx>0; idx--){ *(--bufpt) = '0'; /* Zero pad */ } @@ -401,7 +403,7 @@ static int vxprintf( for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x; } } - length = (long)&buf[etBUFSIZE]-(long)bufpt; + length = &buf[etBUFSIZE]-bufpt; break; case etFLOAT: case etEXP: @@ -511,7 +513,7 @@ static int vxprintf( /* The converted number is in buf[] and zero terminated. Output it. ** Note that the number is in the usual order, not reversed as with ** integer conversions. */ - length = (long)bufpt-(long)buf; + length = bufpt-buf; bufpt = buf; /* Special case: Add leading zeros if the flag_zeropad flag is @@ -549,8 +551,13 @@ static int vxprintf( bufpt = buf; break; case etSTRING: + case etDYNSTRING: bufpt = va_arg(ap,char*); - if( bufpt==0 ) bufpt = "(null)"; + if( bufpt==0 ){ + bufpt = ""; + }else if( xtype==etDYNSTRING ){ + zExtra = bufpt; + } length = strlen(bufpt); if( precision>=0 && precision<length ) length = precision; break; @@ -632,7 +639,11 @@ static int vxprintf( } } if( zExtra ){ - sqliteFree(zExtra); + if( xtype==etDYNSTRING ){ + free(zExtra); + }else{ + sqliteFree(zExtra); + } } }/* End for loop over the format string */ return errorflag ? -1 : count; @@ -747,6 +758,47 @@ char *sqlite_vmprintf(const char *zFormat, va_list ap){ return zNew; } +/* +** This function implements the callback from vxprintf. +** +** This routine add nNewChar characters of text in zNewText to +** the sgMprintf structure pointed to by "arg". Unlike mout() above, +** this routine does not allocate new space when the buffer fills. +** It just truncates. +*/ +static void sout(void *arg, char *zNewText, int nNewChar){ + struct sgMprintf *pM = (struct sgMprintf*)arg; + if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ + nNewChar = pM->nAlloc - pM->nChar - 1; + if( nNewChar<=0 ) return; + } + memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); + pM->nChar += nNewChar; + pM->zText[pM->nChar] = 0; +} + +/* +** sqlite_sprintf() works like sprintf() except that it ignores the +** current locale settings. This is important for SQLite because we +** are not able to use a "," as the decimal point in place of "." as +** specified by some locales. +*/ +int sqlite_snprintf(int n, char *zBuf, const char *zFormat, ...){ + va_list ap; + struct sgMprintf sMprintf; + + sMprintf.nChar = 0; + sMprintf.nAlloc = n; + sMprintf.zText = zBuf; + sMprintf.zBase = zBuf; + va_start(ap,zFormat); + vxprintf(sout,&sMprintf,zFormat,ap); + va_end(ap); + return sMprintf.nChar; +} + + + /* ** The following four routines implement the varargs versions of the ** sqlite_exec() and sqlite_get_table() interfaces. See the sqlite.h diff --git a/ext/sqlite/libsqlite/src/select.c b/ext/sqlite/libsqlite/src/select.c index 03153bcd8a..c7525b3b6b 100644 --- a/ext/sqlite/libsqlite/src/select.c +++ b/ext/sqlite/libsqlite/src/select.c @@ -30,7 +30,7 @@ Select *sqliteSelectNew( ExprList *pOrderBy, /* the ORDER BY clause */ int isDistinct, /* true if the DISTINCT keyword is present */ int nLimit, /* LIMIT value. -1 means not used */ - int nOffset /* OFFSET value. -1 means not used */ + int nOffset /* OFFSET value. 0 means no offset */ ){ Select *pNew; pNew = sqliteMalloc( sizeof(*pNew) ); @@ -52,6 +52,8 @@ Select *sqliteSelectNew( pNew->op = TK_SELECT; pNew->nLimit = nLimit; pNew->nOffset = nOffset; + pNew->iLimit = -1; + pNew->iOffset = -1; } return pNew; } @@ -277,62 +279,6 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){ } /* -** This routine implements a minimal Oracle8 join syntax immulation. -** The precise oracle8 syntax is not implemented - it is easy enough -** to get this routine confused. But this routine does make it possible -** to write a single SQL statement that does a left outer join in both -** oracle8 and in SQLite. -** -** This routine looks for TK_COLUMN expression nodes that are marked -** with the EP_Oracle8Join property. Such nodes are generated by a -** column name (either "column" or "table.column") that is followed by -** the special "(+)" operator. If the table of the column marked with -** the (+) operator is the second are subsequent table in a join, then -** that table becomes the left table in a LEFT OUTER JOIN. The expression -** that uses that table becomes part of the ON clause for the join. -** -** It is important to enphasize that this is not exactly how oracle8 -** works. But it is close enough so that one can construct queries that -** will work correctly for both SQLite and Oracle8. -*/ -static int sqliteOracle8JoinFixup( - SrcList *pSrc, /* List of tables being joined */ - Expr *pWhere /* The WHERE clause of the SELECT statement */ -){ - int rc = 0; - if( ExprHasProperty(pWhere, EP_Oracle8Join) && pWhere->op==TK_COLUMN ){ - int idx; - for(idx=0; idx<pSrc->nSrc; idx++){ - if( pSrc->a[idx].iCursor==pWhere->iTable ) break; - } - assert( idx>=0 && idx<pSrc->nSrc ); - if( idx>0 ){ - pSrc->a[idx-1].jointype &= ~JT_INNER; - pSrc->a[idx-1].jointype |= JT_OUTER|JT_LEFT; - return 1; - } - } - if( pWhere->pRight ){ - rc = sqliteOracle8JoinFixup(pSrc, pWhere->pRight); - } - if( pWhere->pLeft ){ - rc |= sqliteOracle8JoinFixup(pSrc, pWhere->pLeft); - } - if( pWhere->pList ){ - int i; - ExprList *pList = pWhere->pList; - for(i=0; i<pList->nExpr && rc==0; i++){ - rc |= sqliteOracle8JoinFixup(pSrc, pList->a[i].pExpr); - } - } - if( rc==1 && (pWhere->op==TK_AND || pWhere->op==TK_EQ) ){ - setJoinExpr(pWhere); - rc = 0; - } - return rc; -} - -/* ** Delete the given Select structure and all of its substructures. */ void sqliteSelectDelete(Select *p){ @@ -450,13 +396,13 @@ static int selectInnerLoop( ** to see if this row should be output. */ if( pOrderBy==0 ){ - if( p->nOffset>0 ){ + if( p->iOffset>=0 ){ int addr = sqliteVdbeCurrentAddr(v); - sqliteVdbeAddOp(v, OP_MemIncr, p->nOffset, addr+2); + sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+2); sqliteVdbeAddOp(v, OP_Goto, 0, iContinue); } - if( p->nLimit>=0 ){ - sqliteVdbeAddOp(v, OP_MemIncr, p->nLimit, iBreak); + if( p->iLimit>=0 ){ + sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak); } } @@ -533,16 +479,19 @@ static int selectInnerLoop( ** item into the set table with bogus data. */ case SRT_Set: { - int lbl = sqliteVdbeMakeLabel(v); + int addr1 = sqliteVdbeCurrentAddr(v); + int addr2; assert( nColumn==1 ); - sqliteVdbeAddOp(v, OP_IsNull, -1, lbl); + sqliteVdbeAddOp(v, OP_NotNull, -1, addr1+3); + sqliteVdbeAddOp(v, OP_Pop, 1, 0); + addr2 = sqliteVdbeAddOp(v, OP_Goto, 0, 0); if( pOrderBy ){ pushOntoSorter(pParse, v, pOrderBy); }else{ sqliteVdbeAddOp(v, OP_String, 0, 0); sqliteVdbeAddOp(v, OP_PutStrKey, iParm, 0); } - sqliteVdbeResolveLabel(v, lbl); + sqliteVdbeChangeP2(v, addr2, sqliteVdbeCurrentAddr(v)); break; } @@ -620,13 +569,13 @@ static void generateSortTail( if( eDest==SRT_Sorter ) return; sqliteVdbeAddOp(v, OP_Sort, 0, 0); addr = sqliteVdbeAddOp(v, OP_SortNext, 0, end); - if( p->nOffset>0 ){ - sqliteVdbeAddOp(v, OP_MemIncr, p->nOffset, addr+4); + if( p->iOffset>=0 ){ + sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+4); sqliteVdbeAddOp(v, OP_Pop, 1, 0); sqliteVdbeAddOp(v, OP_Goto, 0, addr); } - if( p->nLimit>=0 ){ - sqliteVdbeAddOp(v, OP_MemIncr, p->nLimit, end); + if( p->iLimit>=0 ){ + sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, end); } switch( eDest ){ case SRT_Callback: { @@ -642,7 +591,9 @@ static void generateSortTail( } case SRT_Set: { assert( nColumn==1 ); - sqliteVdbeAddOp(v, OP_IsNull, -1, sqliteVdbeCurrentAddr(v)+3); + 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); break; @@ -1245,6 +1196,52 @@ static void multiSelectSortOrder(Select *p, ExprList *pOrderBy){ } /* +** Compute the iLimit and iOffset fields of the SELECT based on the +** nLimit and nOffset fields. nLimit and nOffset hold the integers +** that appear in the original SQL statement after the LIMIT and OFFSET +** keywords. Or that hold -1 and 0 if those keywords are omitted. +** iLimit and iOffset are the integer memory register numbers for +** counters used to compute the limit and offset. If there is no +** limit and/or offset, then iLimit and iOffset are negative. +** +** This routine changes the values if iLimit and iOffset only if +** a limit or offset is defined by nLimit and nOffset. iLimit and +** iOffset should have been preset to appropriate default values +** (usually but not always -1) prior to calling this routine. +** Only if nLimit>=0 or nOffset>0 do the limit registers get +** redefined. The UNION ALL operator uses this property to force +** the reuse of the same limit and offset registers across multiple +** SELECT statements. +*/ +static void computeLimitRegisters(Parse *pParse, Select *p){ + /* + ** If the comparison is p->nLimit>0 then "LIMIT 0" shows + ** all rows. It is the same as no limit. If the comparision is + ** p->nLimit>=0 then "LIMIT 0" show no rows at all. + ** "LIMIT -1" always shows all rows. There is some + ** contraversy about what the correct behavior should be. + ** The current implementation interprets "LIMIT 0" to mean + ** no rows. + */ + if( p->nLimit>=0 ){ + int iMem = pParse->nMem++; + Vdbe *v = sqliteGetVdbe(pParse); + if( v==0 ) return; + sqliteVdbeAddOp(v, OP_Integer, -p->nLimit, 0); + sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); + p->iLimit = iMem; + } + if( p->nOffset>0 ){ + int iMem = pParse->nMem++; + Vdbe *v = sqliteGetVdbe(pParse); + if( v==0 ) return; + sqliteVdbeAddOp(v, OP_Integer, -p->nOffset, 0); + sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); + p->iOffset = iMem; + } +} + +/* ** This routine is called to process a query that is really the union ** or intersection of two or more separate queries. ** @@ -1279,8 +1276,8 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ Select *pPrior; /* Another SELECT immediately to our left */ Vdbe *v; /* Generate code to this VDBE */ - /* Make sure there is no ORDER BY clause on prior SELECTs. Only the - ** last SELECT in the series may have an ORDER BY. + /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only + ** the last SELECT in the series may have an ORDER BY or LIMIT. */ if( p==0 || p->pPrior==0 ) return 1; pPrior = p->pPrior; @@ -1289,6 +1286,11 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ selectOpName(p->op)); return 1; } + if( pPrior->nLimit>=0 || pPrior->nOffset>0 ){ + sqliteErrorMsg(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. */ @@ -1307,9 +1309,15 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ switch( p->op ){ case TK_ALL: { if( p->pOrderBy==0 ){ + pPrior->nLimit = p->nLimit; + pPrior->nOffset = p->nOffset; rc = sqliteSelect(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); p->pPrior = pPrior; if( rc ) return rc; @@ -1322,10 +1330,11 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ int unionTab; /* Cursor number of the temporary table holding result */ int op; /* One of the SRT_ operations to apply to self */ int priorOp; /* The SRT_ operation to apply to prior selects */ + int nLimit, nOffset; /* Saved values of p->nLimit and p->nOffset */ ExprList *pOrderBy; /* The ORDER BY clause for the right SELECT */ priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union; - if( eDest==priorOp && p->pOrderBy==0 ){ + if( eDest==priorOp && p->pOrderBy==0 && p->nLimit<0 && p->nOffset==0 ){ /* We can reuse a temporary table generated by a SELECT to our ** right. */ @@ -1362,9 +1371,15 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ p->pPrior = 0; pOrderBy = p->pOrderBy; p->pOrderBy = 0; + nLimit = p->nLimit; + p->nLimit = -1; + nOffset = p->nOffset; + p->nOffset = 0; rc = sqliteSelect(pParse, p, op, unionTab, 0, 0, 0); p->pPrior = pPrior; p->pOrderBy = pOrderBy; + p->nLimit = nLimit; + p->nOffset = nOffset; if( rc ) return rc; /* Convert the data in the temporary table into whatever form @@ -1380,6 +1395,7 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ iBreak = sqliteVdbeMakeLabel(v); iCont = sqliteVdbeMakeLabel(v); sqliteVdbeAddOp(v, OP_Rewind, unionTab, iBreak); + computeLimitRegisters(pParse, p); iStart = sqliteVdbeCurrentAddr(v); multiSelectSortOrder(p, p->pOrderBy); rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr, @@ -1399,6 +1415,7 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ case TK_INTERSECT: { int tab1, tab2; int iCont, iBreak, iStart; + int nLimit, nOffset; /* INTERSECT is different from the others since it requires ** two temporary tables. Hence it has its own case. Begin @@ -1422,8 +1439,14 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ sqliteVdbeAddOp(v, OP_OpenTemp, tab2, 1); sqliteVdbeAddOp(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); p->pPrior = pPrior; + p->nLimit = nLimit; + p->nOffset = nOffset; if( rc ) return rc; /* Generate code to take the intersection of the two temporary @@ -1437,6 +1460,7 @@ static int multiSelect(Parse *pParse, Select *p, int eDest, int iParm){ iBreak = sqliteVdbeMakeLabel(v); iCont = sqliteVdbeMakeLabel(v); sqliteVdbeAddOp(v, OP_Rewind, tab1, iBreak); + computeLimitRegisters(pParse, p); iStart = sqliteVdbeAddOp(v, OP_FullKey, tab1, 0); sqliteVdbeAddOp(v, OP_NotFound, tab2, iCont); multiSelectSortOrder(p, p->pOrderBy); @@ -1578,6 +1602,9 @@ substExprList(ExprList *pList, int iTable, ExprList *pEList){ ** ** (11) The subquery and the outer query do not both have ORDER BY clauses. ** +** (12) The subquery is not the right term of a LEFT OUTER JOIN or the +** subquery has no WHERE clause. (added by ticket #350) +** ** In this routine, the "p" parameter is a pointer to the outer query. ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. @@ -1637,6 +1664,24 @@ static int flattenSubquery( return 0; } + /* Restriction 12: If the subquery is the right operand of a left outer + ** join, make sure the subquery has no WHERE clause. + ** An examples of why this is not allowed: + ** + ** t1 LEFT OUTER JOIN (SELECT * FROM t2 WHERE t2.x>0) + ** + ** If we flatten the above, we would get + ** + ** (t1 LEFT OUTER JOIN t2) WHERE t2.x>0 + ** + ** But the t2.x>0 test will always fail on a NULL row of t2, which + ** effectively converts the OUTER JOIN into an INNER JOIN. + */ + if( iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 + && pSub->pWhere!=0 ){ + return 0; + } + /* If we reach this point, it means flattening is permitted for the ** iFrom-th entry of the FROM clause in the outer query. */ @@ -1831,13 +1876,13 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ if( pIdx==0 ) return 0; } - /* Identify column names if we will be using the callback. This + /* Identify column types if we will be using the callback. This ** 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); if( v==0 ) return 0; if( eDest==SRT_Callback ){ - generateColumnNames(pParse, p->pSrc, p->pEList); generateColumnTypes(pParse, p->pSrc, p->pEList); } @@ -1848,6 +1893,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ */ sqliteCodeVerifySchema(pParse, pTab->iDb); base = p->pSrc->a[0].iCursor; + computeLimitRegisters(pParse, p); sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0); sqliteVdbeAddOp(v, OP_OpenRead, base, pTab->tnum); sqliteVdbeChangeP3(v, -1, pTab->zName, P3_STATIC); @@ -2028,7 +2074,6 @@ int sqliteSelect( if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ goto select_end; } - sqliteOracle8JoinFixup(pTabList, pWhere); } if( pHaving ){ if( pGroupBy==0 ){ @@ -2099,14 +2144,6 @@ int sqliteSelect( } } - /* Check for the special case of a min() or max() function by itself - ** in the result set. - */ - if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){ - rc = 0; - goto select_end; - } - /* Begin generating code. */ v = sqliteGetVdbe(pParse); @@ -2119,24 +2156,12 @@ int sqliteSelect( generateColumnNames(pParse, pTabList, pEList); } - /* Set the limiter + /* Check for the special case of a min() or max() function by itself + ** in the result set. */ - if( p->nLimit<=0 ){ - p->nLimit = -1; - p->nOffset = 0; - }else{ - int iMem = pParse->nMem++; - sqliteVdbeAddOp(v, OP_Integer, -p->nLimit, 0); - sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); - p->nLimit = iMem; - if( p->nOffset<=0 ){ - p->nOffset = 0; - }else{ - iMem = pParse->nMem++; - sqliteVdbeAddOp(v, OP_Integer, -p->nOffset, 0); - sqliteVdbeAddOp(v, OP_MemStore, iMem, 1); - p->nOffset = iMem; - } + if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){ + rc = 0; + goto select_end; } /* Generate code for all sub-queries in the FROM clause @@ -2177,9 +2202,18 @@ int sqliteSelect( return rc; } + /* Set the limiter. + */ + computeLimitRegisters(pParse, p); + /* Identify column types if we will be using a callback. This ** step is skipped if the output is going to a destination other ** than a callback. + ** + ** We have to do this separately from the creation of column names + ** above because if the pTabList contains views then they will not + ** have been resolved and we will not know the column types until + ** now. */ if( eDest==SRT_Callback ){ generateColumnTypes(pParse, pTabList, pEList); diff --git a/ext/sqlite/libsqlite/src/sqlite.h.in b/ext/sqlite/libsqlite/src/sqlite.h.in index d4e22e34da..228cecfe8d 100644 --- a/ext/sqlite/libsqlite/src/sqlite.h.in +++ b/ext/sqlite/libsqlite/src/sqlite.h.in @@ -166,6 +166,7 @@ int sqlite_exec( #define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ #define SQLITE_AUTH 23 /* Authorization denied */ #define SQLITE_FORMAT 24 /* Auxiliary database format error */ +#define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ #define SQLITE_ROW 100 /* sqlite_step() has another row ready */ #define SQLITE_DONE 101 /* sqlite_step() has finished executing */ @@ -684,6 +685,77 @@ int sqlite_step( */ int sqlite_finalize(sqlite_vm*, char **pzErrMsg); +/* +** This routine deletes the virtual machine, writes any error message to +** *pzErrMsg and returns an SQLite return code in the same way as the +** sqlite_finalize() function. +** +** Additionally, if ppVm is not NULL, *ppVm is left pointing to a new virtual +** machine loaded with the compiled version of the original query ready for +** execution. +** +** If sqlite_reset() returns SQLITE_SCHEMA, then *ppVm is set to NULL. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite_reset(sqlite_vm*, char **pzErrMsg); + +/* +** If the SQL that was handed to sqlite_compile contains variables that +** are represeted in the SQL text by a question mark ('?'). This routine +** is used to assign values to those variables. +** +** The first parameter is a virtual machine obtained from sqlite_compile(). +** The 2nd "idx" parameter determines which variable in the SQL statement +** to bind the value to. The left most '?' is 1. The 3rd parameter is +** the value to assign to that variable. The 4th parameter is the number +** of bytes in the value, including the terminating \000 for strings. +** Finally, the 5th "copy" parameter is TRUE if SQLite should make its +** own private copy of this value, or false if the space that the 3rd +** parameter points to will be unchanging and can be used directly by +** SQLite. +** +** Unbound variables are treated as having a value of NULL. To explicitly +** set a variable to NULL, call this routine with the 3rd parameter as a +** NULL pointer. +** +** If the 4th "len" parameter is -1, then strlen() is used to find the +** length. +** +** This routine can only be called immediately after sqlite_compile() +** or sqlite_reset() and before any calls to sqlite_step(). +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); + +/* +** This routine configures a callback function - the progress callback - that +** is invoked periodically during long running calls to sqlite_exec(), +** sqlite_step() and sqlite_get_table(). An example use for this API is to keep +** a GUI updated during a large query. +** +** The progress callback is invoked once for every N virtual machine opcodes, +** where N is the second argument to this function. The progress callback +** itself is identified by the third argument to this function. The fourth +** argument to this function is a void pointer passed to the progress callback +** function each time it is invoked. +** +** If a call to sqlite_exec(), sqlite_step() or sqlite_get_table() results +** in less than N opcodes being executed, then the progress callback is not +** invoked. +** +** Calling this routine overwrites any previously installed progress callback. +** To remove the progress callback altogether, pass NULL as the third +** argument to this function. +** +** If the progress callback returns a result other than 0, then the current +** query is immediately terminated and any database changes rolled back. If the +** query was part of a larger transaction, then the transaction is not rolled +** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. +*/ +void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); + #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif diff --git a/ext/sqlite/libsqlite/src/sqlite.w32.h b/ext/sqlite/libsqlite/src/sqlite.w32.h index 778ef3d1c1..f2f8e28b0c 100644 --- a/ext/sqlite/libsqlite/src/sqlite.w32.h +++ b/ext/sqlite/libsqlite/src/sqlite.w32.h @@ -28,7 +28,7 @@ extern "C" { /* ** The version of the SQLite library. */ -#define SQLITE_VERSION "2.8.3" +#define SQLITE_VERSION "2.8.9" /* ** The version string is also compiled into the library so that a program @@ -166,6 +166,7 @@ int sqlite_exec( #define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ #define SQLITE_AUTH 23 /* Authorization denied */ #define SQLITE_FORMAT 24 /* Auxiliary database format error */ +#define SQLITE_RANGE 25 /* 2nd parameter to sqlite_bind out of range */ #define SQLITE_ROW 100 /* sqlite_step() has another row ready */ #define SQLITE_DONE 101 /* sqlite_step() has finished executing */ @@ -684,6 +685,77 @@ int sqlite_step( */ int sqlite_finalize(sqlite_vm*, char **pzErrMsg); +/* +** This routine deletes the virtual machine, writes any error message to +** *pzErrMsg and returns an SQLite return code in the same way as the +** sqlite_finalize() function. +** +** Additionally, if ppVm is not NULL, *ppVm is left pointing to a new virtual +** machine loaded with the compiled version of the original query ready for +** execution. +** +** If sqlite_reset() returns SQLITE_SCHEMA, then *ppVm is set to NULL. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite_reset(sqlite_vm*, char **pzErrMsg); + +/* +** If the SQL that was handed to sqlite_compile contains variables that +** are represeted in the SQL text by a question mark ('?'). This routine +** is used to assign values to those variables. +** +** The first parameter is a virtual machine obtained from sqlite_compile(). +** The 2nd "idx" parameter determines which variable in the SQL statement +** to bind the value to. The left most '?' is 1. The 3rd parameter is +** the value to assign to that variable. The 4th parameter is the number +** of bytes in the value, including the terminating \000 for strings. +** Finally, the 5th "copy" parameter is TRUE if SQLite should make its +** own private copy of this value, or false if the space that the 3rd +** parameter points to will be unchanging and can be used directly by +** SQLite. +** +** Unbound variables are treated as having a value of NULL. To explicitly +** set a variable to NULL, call this routine with the 3rd parameter as a +** NULL pointer. +** +** If the 4th "len" parameter is -1, then strlen() is used to find the +** length. +** +** This routine can only be called immediately after sqlite_compile() +** or sqlite_reset() and before any calls to sqlite_step(). +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite_bind(sqlite_vm*, int idx, const char *value, int len, int copy); + +/* +** This routine configures a callback function - the progress callback - that +** is invoked periodically during long running calls to sqlite_exec(), +** sqlite_step() and sqlite_get_table(). An example use for this API is to keep +** a GUI updated during a large query. +** +** The progress callback is invoked once for every N virtual machine opcodes, +** where N is the second argument to this function. The progress callback +** itself is identified by the third argument to this function. The fourth +** argument to this function is a void pointer passed to the progress callback +** function each time it is invoked. +** +** If a call to sqlite_exec(), sqlite_step() or sqlite_get_table() results +** in less than N opcodes being executed, then the progress callback is not +** invoked. +** +** Calling this routine overwrites any previously installed progress callback. +** To remove the progress callback altogether, pass NULL as the third +** argument to this function. +** +** If the progress callback returns a result other than 0, then the current +** query is immediately terminated and any database changes rolled back. If the +** query was part of a larger transaction, then the transaction is not rolled +** back and remains active. The sqlite_exec() call returns SQLITE_ABORT. +*/ +void sqlite_progress_handler(sqlite*, int, int(*)(void*), void*); + #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif diff --git a/ext/sqlite/libsqlite/src/sqliteInt.h b/ext/sqlite/libsqlite/src/sqliteInt.h index 994a4ca247..04a90dccf2 100644 --- a/ext/sqlite/libsqlite/src/sqliteInt.h +++ b/ext/sqlite/libsqlite/src/sqliteInt.h @@ -87,6 +87,8 @@ /* #define SQLITE_OMIT_AUTHORIZATION 1 */ /* #define SQLITE_OMIT_INMEMORYDB 1 */ /* #define SQLITE_OMIT_VACUUM 1 */ +/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */ +/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */ /* ** Integers of known sizes. These typedefs might change for architectures @@ -118,6 +120,15 @@ typedef INTPTR_TYPE ptr; /* Big enough to hold a pointer */ typedef unsigned INTPTR_TYPE uptr; /* Big enough to hold a pointer */ /* +** Most C compilers these days recognize "long double", don't they? +** Just in case we encounter one that does not, we will create a macro +** for long double so that it can be easily changed to just "double". +*/ +#ifndef LONGDOUBLE_TYPE +# define LONGDOUBLE_TYPE long double +#endif + +/* ** This macro casts a pointer to an integer. Useful for doing ** pointer arithmetic. */ @@ -318,15 +329,18 @@ struct sqlite { int magic; /* Magic number for detect library misuse */ int nChange; /* Number of rows changed */ struct Vdbe *pVdbe; /* List of active virtual machines */ -#ifndef SQLITE_OMIT_TRACE void (*xTrace)(void*,const char*); /* Trace function */ void *pTraceArg; /* Argument to the trace function */ -#endif #ifndef SQLITE_OMIT_AUTHORIZATION int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); /* Access authorization function */ void *pAuthArg; /* 1st argument to the access auth function */ #endif +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + int (*xProgress)(void *); /* The progress callback */ + void *pProgressArg; /* Argument to the progress callback */ + int nProgressOps; /* Number of opcodes for progress callback */ +#endif }; /* @@ -385,7 +399,7 @@ struct Column { char *zDflt; /* Default value of this column */ char *zType; /* Data type for this column */ u8 notNull; /* True if there is a NOT NULL constraint */ - u8 isPrimKey; /* True if this column is an INTEGER PRIMARY KEY */ + u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */ u8 sortOrder; /* Some combination of SQLITE_SO_... values */ }; @@ -605,7 +619,9 @@ struct Token { ** it can be accessed after all aggregates are computed. ** ** If the expression is a function, the Expr.iTable is an integer code -** representing which function. +** representing which function. If the expression is an unbound variable +** marker (a question mark character '?' in the original SQL) then the +** Expr.iTable holds the index number for that variable. ** ** The Expr.pSelect field points to a SELECT statement. The SELECT might ** be the right operand of an IN operator. Or, if a scalar SELECT appears @@ -634,7 +650,6 @@ struct Expr { ** The following are the meanings of bits in the Expr.flags field. */ #define EP_FromJoin 0x0001 /* Originated in ON or USING clause of a join */ -#define EP_Oracle8Join 0x0002 /* Carries the Oracle8 "(+)" join operator */ /* ** These macros can be used to test, set, or clear bits in the @@ -655,6 +670,7 @@ struct Expr { */ struct ExprList { int nExpr; /* Number of expressions on the list */ + int nAlloc; /* Number of entries allocated below */ struct ExprList_item { Expr *pExpr; /* The list of expressions */ char *zName; /* Token associated with this expression */ @@ -681,6 +697,7 @@ struct ExprList { */ struct IdList { int nId; /* Number of identifiers on the list */ + int nAlloc; /* Number of entries allocated for a[] below */ struct IdList_item { char *zName; /* Name of the identifier */ int idx; /* Index in some Table.aCol[] of a column named zName */ @@ -699,7 +716,8 @@ struct IdList { ** now be identified by a database name, a dot, then the table name: ID.ID. */ struct SrcList { - int nSrc; /* Number of tables or subqueries in the FROM clause */ + u16 nSrc; /* Number of tables or subqueries in the FROM clause */ + u16 nAlloc; /* Number of entries allocated in a[] below */ struct SrcList_item { char *zDatabase; /* Name of database holding this table */ char *zName; /* Name of the table */ @@ -780,16 +798,17 @@ struct WhereInfo { ** in the VDBE that record the limit and offset counters. */ struct Select { - int isDistinct; /* True if the DISTINCT keyword is present */ ExprList *pEList; /* The fields of the result */ + u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ + u8 isDistinct; /* True if the DISTINCT keyword is present */ SrcList *pSrc; /* The FROM clause */ Expr *pWhere; /* The WHERE clause */ ExprList *pGroupBy; /* The GROUP BY clause */ Expr *pHaving; /* The HAVING clause */ ExprList *pOrderBy; /* The ORDER BY clause */ - int op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ Select *pPrior; /* Prior select in a compound select statement */ int nLimit, nOffset; /* LIMIT and OFFSET values. -1 means not used */ + int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ char *zSelect; /* Complete text of the SELECT command */ }; @@ -863,6 +882,7 @@ struct Parse { int nMem; /* Number of memory cells used so far */ int nSet; /* Number of sets used so far */ int nAgg; /* Number of aggregate expressions */ + int nVar; /* Number of '?' variables seen in the SQL so far */ AggExpr *aAgg; /* An array of aggregate expressions */ const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ @@ -1090,7 +1110,7 @@ void sqliteSrcListAddAlias(SrcList*, Token*); void sqliteSrcListAssignCursors(Parse*, SrcList*); void sqliteIdListDelete(IdList*); void sqliteSrcListDelete(SrcList*); -void sqliteCreateIndex(Parse*,Token*,SrcList*,IdList*,int,int,Token*,Token*); +void sqliteCreateIndex(Parse*,Token*,SrcList*,IdList*,int,Token*,Token*); void sqliteDropIndex(Parse*, SrcList*); void sqliteAddKeyType(Vdbe*, ExprList*); void sqliteAddIdxKeyType(Vdbe*, Index*); @@ -1114,6 +1134,7 @@ Index *sqliteFindIndex(sqlite*,const char*, const char*); void sqliteUnlinkAndDeleteIndex(sqlite*,Index*); void sqliteCopy(Parse*, SrcList*, Token*, Token*, int); void sqliteVacuum(Parse*, Token*); +int sqliteRunVacuum(char**, sqlite*); int sqliteGlobCompare(const unsigned char*,const unsigned char*); int sqliteLikeCompare(const unsigned char*,const unsigned char*); char *sqliteTableNameFromToken(Token*); @@ -1148,6 +1169,7 @@ IdList *sqliteIdListDup(IdList*); Select *sqliteSelectDup(Select*); FuncDef *sqliteFindFunction(sqlite*,const char*,int,int,int); void sqliteRegisterBuiltinFunctions(sqlite*); +void sqliteRegisterDateTimeFunctions(sqlite*); int sqliteSafetyOn(sqlite*); int sqliteSafetyOff(sqlite*); int sqliteSafetyCheck(sqlite*); @@ -1176,9 +1198,9 @@ void sqliteDeferForeignKey(Parse*, int); void sqliteAuthContextPop(AuthContext*); #else # define sqliteAuthRead(a,b,c) -# define sqliteAuthCheck(a,b,c,d) SQLITE_OK +# define sqliteAuthCheck(a,b,c,d,e) SQLITE_OK # define sqliteAuthContextPush(a,b,c) -# define sqliteAuthContextPop(a) +# define sqliteAuthContextPop(a) ((void)(a)) #endif void sqliteAttach(Parse*, Token*, Token*); void sqliteDetach(Parse*, Token*); @@ -1190,3 +1212,6 @@ int sqliteFixSelect(DbFixer*, Select*); int sqliteFixExpr(DbFixer*, Expr*); int sqliteFixExprList(DbFixer*, ExprList*); int sqliteFixTriggerStep(DbFixer*, TriggerStep*); +double sqliteAtoF(const char *z); +int sqlite_snprintf(int,char*,const char*,...); +int sqliteFitsIn32Bits(const char *); diff --git a/ext/sqlite/libsqlite/src/table.c b/ext/sqlite/libsqlite/src/table.c index 71f0b59a3a..dc2d9fa7e5 100644 --- a/ext/sqlite/libsqlite/src/table.c +++ b/ext/sqlite/libsqlite/src/table.c @@ -85,7 +85,8 @@ static int sqlite_get_table_cb(void *pArg, int nCol, char **argv, char **colv){ } }else if( p->nColumn!=nCol ){ sqliteSetString(&p->zErrMsg, - "sqlite_get_table() called with two or more incompatible queries", 0); + "sqlite_get_table() called with two or more incompatible queries", + (char*)0); p->rc = SQLITE_ERROR; return 1; } @@ -195,7 +196,7 @@ void sqlite_free_table( int i, n; azResult--; if( azResult==0 ) return; - n = (int)azResult[0]; + n = (int)(long)azResult[0]; for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); } free(azResult); } diff --git a/ext/sqlite/libsqlite/src/tokenize.c b/ext/sqlite/libsqlite/src/tokenize.c index f053a75934..ddf014f8fe 100644 --- a/ext/sqlite/libsqlite/src/tokenize.c +++ b/ext/sqlite/libsqlite/src/tokenize.c @@ -29,122 +29,122 @@ typedef struct Keyword Keyword; struct Keyword { char *zName; /* The keyword name */ - int len; /* Number of characters in the keyword */ - int tokenType; /* The token value for this keyword */ - Keyword *pNext; /* Next keyword with the same hash */ + u8 tokenType; /* Token value for this keyword */ + u8 len; /* Length of this keyword */ + u8 iNext; /* Index in aKeywordTable[] of next with same hash */ }; /* ** These are the keywords */ static Keyword aKeywordTable[] = { - { "ABORT", 0, TK_ABORT, 0 }, - { "AFTER", 0, TK_AFTER, 0 }, - { "ALL", 0, TK_ALL, 0 }, - { "AND", 0, TK_AND, 0 }, - { "AS", 0, TK_AS, 0 }, - { "ASC", 0, TK_ASC, 0 }, - { "ATTACH", 0, TK_ATTACH, 0 }, - { "BEFORE", 0, TK_BEFORE, 0 }, - { "BEGIN", 0, TK_BEGIN, 0 }, - { "BETWEEN", 0, TK_BETWEEN, 0 }, - { "BY", 0, TK_BY, 0 }, - { "CASCADE", 0, TK_CASCADE, 0 }, - { "CASE", 0, TK_CASE, 0 }, - { "CHECK", 0, TK_CHECK, 0 }, - { "CLUSTER", 0, TK_CLUSTER, 0 }, - { "COLLATE", 0, TK_COLLATE, 0 }, - { "COMMIT", 0, TK_COMMIT, 0 }, - { "CONFLICT", 0, TK_CONFLICT, 0 }, - { "CONSTRAINT", 0, TK_CONSTRAINT, 0 }, - { "COPY", 0, TK_COPY, 0 }, - { "CREATE", 0, TK_CREATE, 0 }, - { "CROSS", 0, TK_JOIN_KW, 0 }, - { "DATABASE", 0, TK_DATABASE, 0 }, - { "DEFAULT", 0, TK_DEFAULT, 0 }, - { "DEFERRED", 0, TK_DEFERRED, 0 }, - { "DEFERRABLE", 0, TK_DEFERRABLE, 0 }, - { "DELETE", 0, TK_DELETE, 0 }, - { "DELIMITERS", 0, TK_DELIMITERS, 0 }, - { "DESC", 0, TK_DESC, 0 }, - { "DETACH", 0, TK_DETACH, 0 }, - { "DISTINCT", 0, TK_DISTINCT, 0 }, - { "DROP", 0, TK_DROP, 0 }, - { "END", 0, TK_END, 0 }, - { "EACH", 0, TK_EACH, 0 }, - { "ELSE", 0, TK_ELSE, 0 }, - { "EXCEPT", 0, TK_EXCEPT, 0 }, - { "EXPLAIN", 0, TK_EXPLAIN, 0 }, - { "FAIL", 0, TK_FAIL, 0 }, - { "FOR", 0, TK_FOR, 0 }, - { "FOREIGN", 0, TK_FOREIGN, 0 }, - { "FROM", 0, TK_FROM, 0 }, - { "FULL", 0, TK_JOIN_KW, 0 }, - { "GLOB", 0, TK_GLOB, 0 }, - { "GROUP", 0, TK_GROUP, 0 }, - { "HAVING", 0, TK_HAVING, 0 }, - { "IGNORE", 0, TK_IGNORE, 0 }, - { "IMMEDIATE", 0, TK_IMMEDIATE, 0 }, - { "IN", 0, TK_IN, 0 }, - { "INDEX", 0, TK_INDEX, 0 }, - { "INITIALLY", 0, TK_INITIALLY, 0 }, - { "INNER", 0, TK_JOIN_KW, 0 }, - { "INSERT", 0, TK_INSERT, 0 }, - { "INSTEAD", 0, TK_INSTEAD, 0 }, - { "INTERSECT", 0, TK_INTERSECT, 0 }, - { "INTO", 0, TK_INTO, 0 }, - { "IS", 0, TK_IS, 0 }, - { "ISNULL", 0, TK_ISNULL, 0 }, - { "JOIN", 0, TK_JOIN, 0 }, - { "KEY", 0, TK_KEY, 0 }, - { "LEFT", 0, TK_JOIN_KW, 0 }, - { "LIKE", 0, TK_LIKE, 0 }, - { "LIMIT", 0, TK_LIMIT, 0 }, - { "MATCH", 0, TK_MATCH, 0 }, - { "NATURAL", 0, TK_JOIN_KW, 0 }, - { "NOT", 0, TK_NOT, 0 }, - { "NOTNULL", 0, TK_NOTNULL, 0 }, - { "NULL", 0, TK_NULL, 0 }, - { "OF", 0, TK_OF, 0 }, - { "OFFSET", 0, TK_OFFSET, 0 }, - { "ON", 0, TK_ON, 0 }, - { "OR", 0, TK_OR, 0 }, - { "ORDER", 0, TK_ORDER, 0 }, - { "OUTER", 0, TK_JOIN_KW, 0 }, - { "PRAGMA", 0, TK_PRAGMA, 0 }, - { "PRIMARY", 0, TK_PRIMARY, 0 }, - { "RAISE", 0, TK_RAISE, 0 }, - { "REFERENCES", 0, TK_REFERENCES, 0 }, - { "REPLACE", 0, TK_REPLACE, 0 }, - { "RESTRICT", 0, TK_RESTRICT, 0 }, - { "RIGHT", 0, TK_JOIN_KW, 0 }, - { "ROLLBACK", 0, TK_ROLLBACK, 0 }, - { "ROW", 0, TK_ROW, 0 }, - { "SELECT", 0, TK_SELECT, 0 }, - { "SET", 0, TK_SET, 0 }, - { "STATEMENT", 0, TK_STATEMENT, 0 }, - { "TABLE", 0, TK_TABLE, 0 }, - { "TEMP", 0, TK_TEMP, 0 }, - { "TEMPORARY", 0, TK_TEMP, 0 }, - { "THEN", 0, TK_THEN, 0 }, - { "TRANSACTION", 0, TK_TRANSACTION, 0 }, - { "TRIGGER", 0, TK_TRIGGER, 0 }, - { "UNION", 0, TK_UNION, 0 }, - { "UNIQUE", 0, TK_UNIQUE, 0 }, - { "UPDATE", 0, TK_UPDATE, 0 }, - { "USING", 0, TK_USING, 0 }, - { "VACUUM", 0, TK_VACUUM, 0 }, - { "VALUES", 0, TK_VALUES, 0 }, - { "VIEW", 0, TK_VIEW, 0 }, - { "WHEN", 0, TK_WHEN, 0 }, - { "WHERE", 0, TK_WHERE, 0 }, + { "ABORT", TK_ABORT, }, + { "AFTER", TK_AFTER, }, + { "ALL", TK_ALL, }, + { "AND", TK_AND, }, + { "AS", TK_AS, }, + { "ASC", TK_ASC, }, + { "ATTACH", TK_ATTACH, }, + { "BEFORE", TK_BEFORE, }, + { "BEGIN", TK_BEGIN, }, + { "BETWEEN", TK_BETWEEN, }, + { "BY", TK_BY, }, + { "CASCADE", TK_CASCADE, }, + { "CASE", TK_CASE, }, + { "CHECK", TK_CHECK, }, + { "CLUSTER", TK_CLUSTER, }, + { "COLLATE", TK_COLLATE, }, + { "COMMIT", TK_COMMIT, }, + { "CONFLICT", TK_CONFLICT, }, + { "CONSTRAINT", TK_CONSTRAINT, }, + { "COPY", TK_COPY, }, + { "CREATE", TK_CREATE, }, + { "CROSS", TK_JOIN_KW, }, + { "DATABASE", TK_DATABASE, }, + { "DEFAULT", TK_DEFAULT, }, + { "DEFERRED", TK_DEFERRED, }, + { "DEFERRABLE", TK_DEFERRABLE, }, + { "DELETE", TK_DELETE, }, + { "DELIMITERS", TK_DELIMITERS, }, + { "DESC", TK_DESC, }, + { "DETACH", TK_DETACH, }, + { "DISTINCT", TK_DISTINCT, }, + { "DROP", TK_DROP, }, + { "END", TK_END, }, + { "EACH", TK_EACH, }, + { "ELSE", TK_ELSE, }, + { "EXCEPT", TK_EXCEPT, }, + { "EXPLAIN", TK_EXPLAIN, }, + { "FAIL", TK_FAIL, }, + { "FOR", TK_FOR, }, + { "FOREIGN", TK_FOREIGN, }, + { "FROM", TK_FROM, }, + { "FULL", TK_JOIN_KW, }, + { "GLOB", TK_GLOB, }, + { "GROUP", TK_GROUP, }, + { "HAVING", TK_HAVING, }, + { "IGNORE", TK_IGNORE, }, + { "IMMEDIATE", TK_IMMEDIATE, }, + { "IN", TK_IN, }, + { "INDEX", TK_INDEX, }, + { "INITIALLY", TK_INITIALLY, }, + { "INNER", TK_JOIN_KW, }, + { "INSERT", TK_INSERT, }, + { "INSTEAD", TK_INSTEAD, }, + { "INTERSECT", TK_INTERSECT, }, + { "INTO", TK_INTO, }, + { "IS", TK_IS, }, + { "ISNULL", TK_ISNULL, }, + { "JOIN", TK_JOIN, }, + { "KEY", TK_KEY, }, + { "LEFT", TK_JOIN_KW, }, + { "LIKE", TK_LIKE, }, + { "LIMIT", TK_LIMIT, }, + { "MATCH", TK_MATCH, }, + { "NATURAL", TK_JOIN_KW, }, + { "NOT", TK_NOT, }, + { "NOTNULL", TK_NOTNULL, }, + { "NULL", TK_NULL, }, + { "OF", TK_OF, }, + { "OFFSET", TK_OFFSET, }, + { "ON", TK_ON, }, + { "OR", TK_OR, }, + { "ORDER", TK_ORDER, }, + { "OUTER", TK_JOIN_KW, }, + { "PRAGMA", TK_PRAGMA, }, + { "PRIMARY", TK_PRIMARY, }, + { "RAISE", TK_RAISE, }, + { "REFERENCES", TK_REFERENCES, }, + { "REPLACE", TK_REPLACE, }, + { "RESTRICT", TK_RESTRICT, }, + { "RIGHT", TK_JOIN_KW, }, + { "ROLLBACK", TK_ROLLBACK, }, + { "ROW", TK_ROW, }, + { "SELECT", TK_SELECT, }, + { "SET", TK_SET, }, + { "STATEMENT", TK_STATEMENT, }, + { "TABLE", TK_TABLE, }, + { "TEMP", TK_TEMP, }, + { "TEMPORARY", TK_TEMP, }, + { "THEN", TK_THEN, }, + { "TRANSACTION", TK_TRANSACTION, }, + { "TRIGGER", TK_TRIGGER, }, + { "UNION", TK_UNION, }, + { "UNIQUE", TK_UNIQUE, }, + { "UPDATE", TK_UPDATE, }, + { "USING", TK_USING, }, + { "VACUUM", TK_VACUUM, }, + { "VALUES", TK_VALUES, }, + { "VIEW", TK_VIEW, }, + { "WHEN", TK_WHEN, }, + { "WHERE", TK_WHERE, }, }; /* ** This is the hash table */ -#define KEY_HASH_SIZE 71 -static Keyword *apHashTable[KEY_HASH_SIZE]; +#define KEY_HASH_SIZE 101 +static u8 aiHashTable[KEY_HASH_SIZE]; /* @@ -153,27 +153,29 @@ static Keyword *apHashTable[KEY_HASH_SIZE]; ** returned. If the input is not a keyword, TK_ID is returned. */ int sqliteKeywordCode(const char *z, int n){ - int h; + int h, i; Keyword *p; - if( aKeywordTable[0].len==0 ){ + static char needInit = 1; + if( needInit ){ /* Initialize the keyword hash table */ sqliteOsEnterMutex(); - if( aKeywordTable[0].len==0 ){ - int i; - int n; - n = sizeof(aKeywordTable)/sizeof(aKeywordTable[0]); - for(i=0; i<n; i++){ + if( needInit ){ + int nk; + nk = sizeof(aKeywordTable)/sizeof(aKeywordTable[0]); + for(i=0; i<nk; i++){ aKeywordTable[i].len = strlen(aKeywordTable[i].zName); h = sqliteHashNoCase(aKeywordTable[i].zName, aKeywordTable[i].len); h %= KEY_HASH_SIZE; - aKeywordTable[i].pNext = apHashTable[h]; - apHashTable[h] = &aKeywordTable[i]; + aKeywordTable[i].iNext = aiHashTable[h]; + aiHashTable[h] = i+1; } + needInit = 0; } sqliteOsLeaveMutex(); } h = sqliteHashNoCase(z, n) % KEY_HASH_SIZE; - for(p=apHashTable[h]; p; p=p->pNext){ + for(i=aiHashTable[h]; i; i=p->iNext){ + p = &aKeywordTable[i-1]; if( p->len==n && sqliteStrNICmp(p->zName, z, n)==0 ){ return p->tokenType; } @@ -183,8 +185,12 @@ int sqliteKeywordCode(const char *z, int n){ /* -** If X is a character that can be used in an identifier then -** isIdChar[X] will be 1. Otherwise isIdChar[X] will be 0. +** If X is a character that can be used in an identifier and +** X&0x80==0 then isIdChar[X] will be 1. If X&0x80==0x80 then +** X is always an identifier character. (Hence all UTF-8 +** characters can be part of an identifier). isIdChar[X] will +** be 0 for every character in the lower 128 ASCII characters +** that cannot be used as part of an identifier. ** ** In this implementation, an identifier can be a string of ** alphabetic characters, digits, and "_" plus any character @@ -202,21 +208,12 @@ static const char isIdChar[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 8x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 9x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Ax */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Bx */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Cx */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Dx */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Ex */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* Fx */ }; /* -** Return the length of the token that begins at z[0]. Return -** -1 if the token is (or might be) incomplete. Store the token -** type in *tokenType before returning. +** Return the length of the token that begins at z[0]. +** Store the token type in *tokenType before returning. */ static int sqliteGetToken(const unsigned char *z, int *tokenType){ int i; @@ -227,7 +224,6 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){ return i; } case '-': { - if( z[1]==0 ) return -1; if( z[1]=='-' ){ for(i=2; z[i] && z[i]!='\n'; i++){} *tokenType = TK_COMMENT; @@ -237,13 +233,8 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){ return 1; } case '(': { - if( z[1]=='+' && z[2]==')' ){ - *tokenType = TK_ORACLE_OUTER_JOIN; - return 3; - }else{ - *tokenType = TK_LP; - return 1; - } + *tokenType = TK_LP; + return 1; } case ')': { *tokenType = TK_RP; @@ -380,11 +371,15 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_ID; return i; } + case '?': { + *tokenType = TK_VARIABLE; + return 1; + } default: { - if( !isIdChar[*z] ){ + if( (*z&0x80)==0 && !isIdChar[*z] ){ break; } - for(i=1; isIdChar[z[i]]; i++){} + for(i=1; (z[i]&0x80)!=0 || isIdChar[z[i]]; i++){} *tokenType = sqliteKeywordCode((char*)z, i); return i; } @@ -416,13 +411,12 @@ int sqliteRunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ i = 0; pEngine = sqliteParserAlloc((void*(*)(int))malloc); if( pEngine==0 ){ - sqliteSetString(pzErrMsg, "out of memory", 0); + sqliteSetString(pzErrMsg, "out of memory", (char*)0); return 1; } pParse->sLastToken.dyn = 0; pParse->zTail = zSql; while( sqlite_malloc_failed==0 && zSql[i]!=0 ){ - assert( i>=0 ); pParse->sLastToken.z = &zSql[i]; assert( pParse->sLastToken.dyn==0 ); @@ -433,7 +427,7 @@ int sqliteRunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ case TK_COMMENT: { if( (db->flags & SQLITE_Interrupt)!=0 ){ pParse->rc = SQLITE_INTERRUPT; - sqliteSetString(pzErrMsg, "interrupt", 0); + sqliteSetString(pzErrMsg, "interrupt", (char*)0); goto abort_parse; } break; @@ -468,7 +462,8 @@ abort_parse: } sqliteParserFree(pEngine, free); if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){ - sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc), 0); + sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc), + (char*)0); } if( pParse->zErrMsg ){ if( pzErrMsg && *pzErrMsg==0 ){ diff --git a/ext/sqlite/libsqlite/src/trigger.c b/ext/sqlite/libsqlite/src/trigger.c index 97891b2cb9..82b679755a 100644 --- a/ext/sqlite/libsqlite/src/trigger.c +++ b/ext/sqlite/libsqlite/src/trigger.c @@ -83,6 +83,7 @@ void sqliteBeginTrigger( } zName = sqliteStrNDup(pName->z, pName->n); + sqliteDequote(zName); if( sqliteHashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){ sqliteErrorMsg(pParse, "trigger %T already exists", pName); goto trigger_cleanup; @@ -450,14 +451,15 @@ void sqliteDropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){ if( pTable!=0 && !nested && (v = sqliteGetVdbe(pParse))!=0 ){ int base; static VdbeOp dropTrigger[] = { - { OP_Rewind, 0, ADDR(8), 0}, + { OP_Rewind, 0, ADDR(9), 0}, { OP_String, 0, 0, 0}, /* 1 */ - { OP_MemStore, 1, 1, 0}, - { OP_MemLoad, 1, 0, 0}, /* 3 */ { OP_Column, 0, 1, 0}, - { OP_Ne, 0, ADDR(7), 0}, + { OP_Ne, 0, ADDR(8), 0}, + { OP_String, 0, 0, "trigger"}, + { OP_Column, 0, 0, 0}, + { OP_Ne, 0, ADDR(8), 0}, { OP_Delete, 0, 0, 0}, - { OP_Next, 0, ADDR(3), 0}, /* 7 */ + { OP_Next, 0, ADDR(1), 0}, /* 8 */ }; sqliteBeginWriteOperation(pParse, 0, 0); diff --git a/ext/sqlite/libsqlite/src/util.c b/ext/sqlite/libsqlite/src/util.c index 129489e046..2e896ee8b6 100644 --- a/ext/sqlite/libsqlite/src/util.c +++ b/ext/sqlite/libsqlite/src/util.c @@ -43,6 +43,10 @@ int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ static int memcnt = 0; #endif +/* +** Number of 32-bit guard words +*/ +#define N_GUARD 1 /* ** Allocate new memory and set it to zero. Return NULL if @@ -51,7 +55,7 @@ static int memcnt = 0; void *sqliteMalloc_(int n, int bZero, char *zFile, int line){ void *p; int *pi; - int k; + int i, k; if( sqlite_iMallocFail>=0 ){ sqlite_iMallocFail--; if( sqlite_iMallocFail==0 ){ @@ -66,16 +70,16 @@ void *sqliteMalloc_(int n, int bZero, char *zFile, int line){ } if( n==0 ) return 0; k = (n+sizeof(int)-1)/sizeof(int); - pi = malloc( (3+k)*sizeof(int)); + pi = malloc( (N_GUARD*2+1+k)*sizeof(int)); if( pi==0 ){ sqlite_malloc_failed++; return 0; } sqlite_nMalloc++; - pi[0] = 0xdead1122; - pi[1] = n; - pi[k+2] = 0xdead3344; - p = &pi[2]; + for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122; + pi[N_GUARD] = n; + for(i=0; i<N_GUARD; i++) pi[k+1+N_GUARD+i] = 0xdead3344; + p = &pi[N_GUARD+1]; memset(p, bZero==0, n); #if MEMORY_DEBUG>1 fprintf(stderr,"%06d malloc %d bytes at 0x%x from %s:%d\n", @@ -93,13 +97,17 @@ void *sqliteMalloc_(int n, int bZero, char *zFile, int line){ */ void sqliteCheckMemory(void *p, int N){ int *pi = p; - int n, k; - pi -= 2; - assert( pi[0]==0xdead1122 ); - n = pi[1]; + int n, i, k; + pi -= N_GUARD+1; + for(i=0; i<N_GUARD; i++){ + assert( pi[i]==0xdead1122 ); + } + n = pi[N_GUARD]; assert( N>=0 && N<n ); k = (n+sizeof(int)-1)/sizeof(int); - assert( pi[k+2]==0xdead3344 ); + for(i=0; i<N_GUARD; i++){ + assert( pi[k+N_GUARD+1+i]==0xdead3344 ); + } } /* @@ -107,21 +115,25 @@ void sqliteCheckMemory(void *p, int N){ */ void sqliteFree_(void *p, char *zFile, int line){ if( p ){ - int *pi, k, n; + int *pi, i, k, n; pi = p; - pi -= 2; + pi -= N_GUARD+1; sqlite_nFree++; - if( pi[0]!=0xdead1122 ){ - fprintf(stderr,"Low-end memory corruption at 0x%x\n", (int)p); - return; + for(i=0; i<N_GUARD; i++){ + if( pi[i]!=0xdead1122 ){ + fprintf(stderr,"Low-end memory corruption at 0x%x\n", (int)p); + return; + } } - n = pi[1]; + n = pi[N_GUARD]; k = (n+sizeof(int)-1)/sizeof(int); - if( pi[k+2]!=0xdead3344 ){ - fprintf(stderr,"High-end memory corruption at 0x%x\n", (int)p); - return; + for(i=0; i<N_GUARD; i++){ + if( pi[k+N_GUARD+1+i]!=0xdead3344 ){ + fprintf(stderr,"High-end memory corruption at 0x%x\n", (int)p); + return; + } } - memset(pi, 0xff, (k+3)*sizeof(int)); + memset(pi, 0xff, (k+N_GUARD*2+1)*sizeof(int)); #if MEMORY_DEBUG>1 fprintf(stderr,"%06d free %d bytes at 0x%x from %s:%d\n", ++memcnt, n, (int)p, zFile,line); @@ -136,7 +148,7 @@ void sqliteFree_(void *p, char *zFile, int line){ ** works just like sqliteFree(). */ void *sqliteRealloc_(void *oldP, int n, char *zFile, int line){ - int *oldPi, *pi, k, oldN, oldK; + int *oldPi, *pi, i, k, oldN, oldK; void *p; if( oldP==0 ){ return sqliteMalloc_(n,1,zFile,line); @@ -146,32 +158,35 @@ void *sqliteRealloc_(void *oldP, int n, char *zFile, int line){ return 0; } oldPi = oldP; - oldPi -= 2; + oldPi -= N_GUARD+1; if( oldPi[0]!=0xdead1122 ){ - fprintf(stderr,"Low-end memory corruption in realloc at 0x%x\n", (int)p); + fprintf(stderr,"Low-end memory corruption in realloc at 0x%x\n", (int)oldP); return 0; } - oldN = oldPi[1]; + oldN = oldPi[N_GUARD]; oldK = (oldN+sizeof(int)-1)/sizeof(int); - if( oldPi[oldK+2]!=0xdead3344 ){ - fprintf(stderr,"High-end memory corruption in realloc at 0x%x\n", (int)p); - return 0; + for(i=0; i<N_GUARD; i++){ + if( oldPi[oldK+N_GUARD+1+i]!=0xdead3344 ){ + fprintf(stderr,"High-end memory corruption in realloc at 0x%x\n", + (int)oldP); + return 0; + } } k = (n + sizeof(int) - 1)/sizeof(int); - pi = malloc( (k+3)*sizeof(int) ); + pi = malloc( (k+N_GUARD*2+1)*sizeof(int) ); if( pi==0 ){ sqlite_malloc_failed++; return 0; } - pi[0] = 0xdead1122; - pi[1] = n; - pi[k+2] = 0xdead3344; - p = &pi[2]; + for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122; + pi[N_GUARD] = n; + for(i=0; i<N_GUARD; i++) pi[k+N_GUARD+1+i] = 0xdead3344; + p = &pi[N_GUARD+1]; memcpy(p, oldP, n>oldN ? oldN : n); if( n>oldN ){ memset(&((char*)p)[oldN], 0, n-oldN); } - memset(oldPi, 0xab, (oldK+3)*sizeof(int)); + memset(oldPi, 0xab, (oldK+N_GUARD+2)*sizeof(int)); free(oldPi); #if MEMORY_DEBUG>1 fprintf(stderr,"%06d realloc %d to %d bytes at 0x%x to 0x%x at %s:%d\n", @@ -236,13 +251,11 @@ char *sqliteStrNDup_(const char *z, int n, char *zFile, int line){ */ void *sqliteMalloc(int n){ void *p; - if( n==0 ) return 0; - p = malloc(n); - if( p==0 ){ - sqlite_malloc_failed++; - return 0; + if( (p = malloc(n))==0 ){ + if( n>0 ) sqlite_malloc_failed++; + }else{ + memset(p, 0, n); } - memset(p, 0, n); return p; } @@ -252,11 +265,8 @@ void *sqliteMalloc(int n){ */ void *sqliteMallocRaw(int n){ void *p; - if( n==0 ) return 0; - p = malloc(n); - if( p==0 ){ - sqlite_malloc_failed++; - return 0; + if( (p = malloc(n))==0 ){ + if( n>0 ) sqlite_malloc_failed++; } return p; } @@ -640,6 +650,87 @@ int sqliteIsNumber(const char *z){ return *z==0; } +/* +** The string z[] is an ascii representation of a real number. +** Convert this string to a double. +** +** This routine assumes that z[] really is a valid number. If it +** is not, the result is undefined. +** +** This routine is used instead of the library atof() function because +** the library atof() might want to use "," as the decimal point instead +** of "." depending on how locale is set. But that would cause problems +** for SQL. So this routine always uses "." regardless of locale. +*/ +double sqliteAtoF(const char *z){ + int sign = 1; + LONGDOUBLE_TYPE v1 = 0.0; + if( *z=='-' ){ + sign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( isdigit(*z) ){ + v1 = v1*10.0 + (*z - '0'); + z++; + } + if( *z=='.' ){ + LONGDOUBLE_TYPE divisor = 1.0; + z++; + while( isdigit(*z) ){ + v1 = v1*10.0 + (*z - '0'); + divisor *= 10.0; + z++; + } + v1 /= divisor; + } + if( *z=='e' || *z=='E' ){ + int esign = 1; + int eval = 0; + LONGDOUBLE_TYPE scale = 1.0; + z++; + if( *z=='-' ){ + esign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( isdigit(*z) ){ + eval = eval*10 + *z - '0'; + z++; + } + while( eval>=64 ){ scale *= 1.0e+64; eval -= 64; } + while( eval>=16 ){ scale *= 1.0e+16; eval -= 16; } + while( eval>=4 ){ scale *= 1.0e+4; eval -= 4; } + while( eval>=1 ){ scale *= 1.0e+1; eval -= 1; } + if( esign<0 ){ + v1 /= scale; + }else{ + v1 *= scale; + } + } + return sign<0 ? -v1 : v1; +} + +/* +** The string zNum represents an integer. There might be some other +** information following the integer too, but that part is ignored. +** If the integer that the prefix of zNum represents will fit in a +** 32-bit signed integer, return TRUE. Otherwise return FALSE. +** +** This routine returns FALSE for the string -2147483648 even that +** that number will, in theory fit in a 32-bit integer. But positive +** 2147483648 will not fit in 32 bits. So it seems safer to return +** false. +*/ +int sqliteFitsIn32Bits(const char *zNum){ + int i, c; + if( *zNum=='-' || *zNum=='+' ) zNum++; + for(i=0; (c=zNum[i])>='0' && c<='9'; i++){} + return i<10 || (i==10 && memcmp(zNum,"2147483647",10)<=0); +} + /* This comparison routine is what we use for comparison operations ** between numeric values in an SQL expression. "Numeric" is a little ** bit misleading here. What we mean is that the strings have a @@ -668,8 +759,8 @@ int sqliteCompare(const char *atext, const char *btext){ result = -1; }else{ double rA, rB; - rA = atof(atext); - rB = atof(btext); + rA = sqliteAtoF(atext); + rB = sqliteAtoF(btext); if( rA<rB ){ result = -1; }else if( rA>rB ){ @@ -761,8 +852,8 @@ int sqliteSortCompare(const char *a, const char *b){ res = -1; break; } - rA = atof(&a[1]); - rB = atof(&b[1]); + rA = sqliteAtoF(&a[1]); + rB = sqliteAtoF(&b[1]); if( rA<rB ){ res = -1; break; diff --git a/ext/sqlite/libsqlite/src/vacuum.c b/ext/sqlite/libsqlite/src/vacuum.c index 145b368508..9cad4008e6 100644 --- a/ext/sqlite/libsqlite/src/vacuum.c +++ b/ext/sqlite/libsqlite/src/vacuum.c @@ -37,7 +37,8 @@ typedef struct vacuumStruct vacuumStruct; struct vacuumStruct { sqlite *dbOld; /* Original database */ sqlite *dbNew; /* New database */ - Parse *pParse; /* The parser context */ + char **pzErrMsg; /* Write errors here */ + int rc; /* Set to non-zero on an error */ const char *zTable; /* Name of a table being copied */ const char *zPragma; /* Pragma to execute with results */ dynStr s1, s2; /* Two dynamic strings */ @@ -85,16 +86,16 @@ static void appendQuoted(dynStr *p, const char *zText){ /* ** Execute statements of SQL. If an error occurs, write the error -** message into pParse->zErrMsg and return non-zero. +** message into *pzErrMsg and return non-zero. */ -static int execsql(Parse *pParse, sqlite *db, const char *zSql){ - int rc; +static int execsql(char **pzErrMsg, sqlite *db, const char *zSql){ char *zErrMsg = 0; + int rc; /* printf("***** executing *****\n%s\n", zSql); */ rc = sqlite_exec(db, zSql, 0, 0, &zErrMsg); - if( rc ){ - sqliteErrorMsg(pParse, "%s", zErrMsg); + if( zErrMsg ){ + sqliteSetString(pzErrMsg, zErrMsg, (char*)0); sqlite_freemem(zErrMsg); } return rc; @@ -111,6 +112,7 @@ static int vacuumCallback2(void *pArg, int argc, char **argv, char **NotUsed){ const char *zSep = "("; int i; + if( argv==0 ) return 0; p->s2.nUsed = 0; appendText(&p->s2, "INSERT INTO ", -1); appendQuoted(&p->s2, p->zTable); @@ -125,7 +127,7 @@ static int vacuumCallback2(void *pArg, int argc, char **argv, char **NotUsed){ } } appendText(&p->s2,")", 1); - rc = execsql(p->pParse, p->dbNew, p->s2.z); + rc = execsql(p->pzErrMsg, p->dbNew, p->s2.z); return rc; } @@ -141,10 +143,11 @@ static int vacuumCallback1(void *pArg, int argc, char **argv, char **NotUsed){ vacuumStruct *p = (vacuumStruct*)pArg; int rc = 0; assert( argc==3 ); + if( argv==0 ) return 0; assert( argv[0]!=0 ); assert( argv[1]!=0 ); assert( argv[2]!=0 ); - rc = execsql(p->pParse, p->dbNew, argv[2]); + rc = execsql(p->pzErrMsg, p->dbNew, argv[2]); if( rc==SQLITE_OK && strcmp(argv[0],"table")==0 ){ char *zErrMsg = 0; p->s1.nUsed = 0; @@ -152,8 +155,9 @@ static int vacuumCallback1(void *pArg, int argc, char **argv, char **NotUsed){ appendQuoted(&p->s1, argv[1]); p->zTable = argv[1]; rc = sqlite_exec(p->dbOld, p->s1.z, vacuumCallback2, p, &zErrMsg); - if( rc && p->pParse->zErrMsg==0 ){ - sqliteErrorMsg(p->pParse, "%s", zErrMsg); + if( zErrMsg ){ + sqliteSetString(p->pzErrMsg, zErrMsg, (char*)0); + sqlite_freemem(zErrMsg); } } return rc; @@ -169,11 +173,12 @@ static int vacuumCallback3(void *pArg, int argc, char **argv, char **NotUsed){ int rc = 0; char zBuf[200]; assert( argc==1 ); + if( argv==0 ) return 0; assert( argv[0]!=0 ); assert( strlen(p->zPragma)<100 ); assert( strlen(argv[0])<30 ); sprintf(zBuf,"PRAGMA %s=%s;", p->zPragma, argv[0]); - rc = execsql(p->pParse, p->dbNew, zBuf); + rc = execsql(p->pzErrMsg, p->dbNew, zBuf); return rc; } @@ -203,16 +208,23 @@ static void randomName(char *zBuf){ ** become a no-op. */ void sqliteVacuum(Parse *pParse, Token *pTableName){ + Vdbe *v = sqliteGetVdbe(pParse); + sqliteVdbeAddOp(v, OP_Vacuum, 0, 0); + return; +} + +/* +** This routine implements the OP_Vacuum opcode of the VDBE. +*/ +int sqliteRunVacuum(char **pzErrMsg, sqlite *db){ #if !defined(SQLITE_OMIT_VACUUM) || SQLITE_OMIT_VACUUM const char *zFilename; /* full pathname of the database file */ int nFilename; /* number of characters in zFilename[] */ char *zTemp = 0; /* a temporary file in same directory as zFilename */ sqlite *dbNew = 0; /* The new vacuumed database */ - sqlite *db; /* The original database */ int rc = SQLITE_OK; /* Return code from service routines */ int i; /* Loop counter */ - char *zErrMsg = 0; /* Error messages stored here */ - int safety = 0; /* TRUE if safety is off */ + char *zErrMsg; /* Error message */ vacuumStruct sVac; /* Information passed to callbacks */ /* These are all of the pragmas that need to be transferred over @@ -223,15 +235,10 @@ void sqliteVacuum(Parse *pParse, Token *pTableName){ /* "default_temp_store", */ }; - /* Initial error checks - */ - if( pParse->explain ){ - return; - } - db = pParse->db; if( db->flags & SQLITE_InTrans ){ - sqliteErrorMsg(pParse, "cannot VACUUM from within a transaction"); - return; + sqliteSetString(pzErrMsg, "cannot VACUUM from within a transaction", + (char*)0); + return SQLITE_ERROR; } memset(&sVac, 0, sizeof(sVac)); @@ -242,11 +249,11 @@ void sqliteVacuum(Parse *pParse, Token *pTableName){ if( zFilename==0 ){ /* This only happens with the in-memory database. VACUUM is a no-op ** there, so just return */ - return; + return SQLITE_OK; } nFilename = strlen(zFilename); zTemp = sqliteMalloc( nFilename+100 ); - if( zTemp==0 ) return; + if( zTemp==0 ) return SQLITE_NOMEM; strcpy(zTemp, zFilename); for(i=0; i<10; i++){ zTemp[nFilename] = '-'; @@ -254,30 +261,26 @@ void sqliteVacuum(Parse *pParse, Token *pTableName){ if( !sqliteOsFileExists(zTemp) ) break; } if( i>=10 ){ - sqliteErrorMsg(pParse, "unable to create a temporary database file " - "in the same directory as the original database"); + sqliteSetString(pzErrMsg, "unable to create a temporary database file " + "in the same directory as the original database", (char*)0); goto end_of_vacuum; } dbNew = sqlite_open(zTemp, 0, &zErrMsg); if( dbNew==0 ){ - sqliteErrorMsg(pParse, "unable to open a temporary database at %s - %s", - zTemp, zErrMsg); - goto end_of_vacuum; - } - if( sqliteSafetyOff(db) ){ - sqliteErrorMsg(pParse, "library routines called out of sequence"); + sqliteSetString(pzErrMsg, "unable to open a temporary database at ", + zTemp, " - ", zErrMsg, (char*)0); goto end_of_vacuum; } - safety = 1; - if( execsql(pParse, db, "BEGIN") ) goto end_of_vacuum; - if( execsql(pParse, dbNew, "PRAGMA synchronous=off; BEGIN") ){ + if( execsql(pzErrMsg, db, "BEGIN") ) goto end_of_vacuum; + if( execsql(pzErrMsg, dbNew, "PRAGMA synchronous=off; BEGIN") ){ goto end_of_vacuum; } + sVac.dbOld = db; sVac.dbNew = dbNew; - sVac.pParse = pParse; + sVac.pzErrMsg = pzErrMsg; for(i=0; rc==SQLITE_OK && i<sizeof(zPragma)/sizeof(zPragma[0]); i++){ char zBuf[200]; assert( strlen(zPragma[i])<100 ); @@ -285,32 +288,34 @@ void sqliteVacuum(Parse *pParse, Token *pTableName){ sVac.zPragma = zPragma[i]; rc = sqlite_exec(db, zBuf, vacuumCallback3, &sVac, &zErrMsg); } - if( !rc ){ - rc = sqlite_exec(db, "SELECT type, name, sql FROM sqlite_master " - "WHERE sql NOT NULL", vacuumCallback1, &sVac, &zErrMsg); + if( rc==SQLITE_OK ){ + rc = sqlite_exec(db, + "SELECT type, name, sql FROM sqlite_master " + "WHERE sql NOT NULL AND type!='view' " + "UNION ALL " + "SELECT type, name, sql FROM sqlite_master " + "WHERE sql NOT NULL AND type=='view'", + vacuumCallback1, &sVac, &zErrMsg); } - if( !rc ){ + if( rc==SQLITE_OK ){ rc = sqliteBtreeCopyFile(db->aDb[0].pBt, dbNew->aDb[0].pBt); sqlite_exec(db, "COMMIT", 0, 0, 0); - sqlite_exec(db, "ROLLBACK", 0, 0, 0); /* In case the COMMIT failed */ sqliteResetInternalSchema(db, 0); } end_of_vacuum: - if( rc && pParse->zErrMsg==0 && zErrMsg!=0 ){ - sqliteErrorMsg(pParse, "unable to vacuum database - %s", zErrMsg); - } - if( safety ) { - sqlite_exec(db, "COMMIT", 0, 0, 0); - sqlite_exec(db, "ROLLBACK", 0, 0, 0); /* In case the COMMIT failed */ - sqliteSafetyOn(db); + if( rc && zErrMsg!=0 ){ + sqliteSetString(pzErrMsg, "unable to vacuum database - ", + zErrMsg, (char*)0); } + sqlite_exec(db, "ROLLBACK", 0, 0, 0); if( dbNew ) sqlite_close(dbNew); sqliteOsDelete(zTemp); sqliteFree(zTemp); sqliteFree(sVac.s1.z); sqliteFree(sVac.s2.z); if( zErrMsg ) sqlite_freemem(zErrMsg); - return; + if( rc==SQLITE_ABORT ) rc = SQLITE_ERROR; + return rc; #endif } diff --git a/ext/sqlite/libsqlite/src/vdbe.c b/ext/sqlite/libsqlite/src/vdbe.c index 28ba8cd22d..b0dd210049 100644 --- a/ext/sqlite/libsqlite/src/vdbe.c +++ b/ext/sqlite/libsqlite/src/vdbe.c @@ -9,7 +9,14 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** The code in this file implements the Virtual Database Engine (VDBE) +** The code in this file implements execution method of the +** Virtual Database Engine (VDBE). A separate file ("vdbeaux.c") +** handles housekeeping details such as creating and deleting +** VDBE instances. This file is solely interested in executing +** the VDBE program. +** +** In the external interface, an "sqlite_vm*" is an opaque pointer +** to a VDBE. ** ** The SQL parser generates a program which is then executed by ** the VDBE to do the work of the SQL statement. VDBE programs are @@ -39,15 +46,9 @@ ** $Id$ */ #include "sqliteInt.h" +#include "os.h" #include <ctype.h> - -/* -** The makefile scans this source file and creates the following -** array of string constants which are the names of all VDBE opcodes. -** This array is defined in a separate source code file named opcode.c -** which is automatically generated by the makefile. -*/ -extern char *sqliteOpcodeNames[]; +#include "vdbeInt.h" /* ** The following global variable is incremented every time a cursor @@ -58,700 +59,6 @@ extern char *sqliteOpcodeNames[]; */ int sqlite_search_count = 0; -/* -** SQL is translated into a sequence of instructions to be -** executed by a virtual machine. Each instruction is an instance -** of the following structure. -*/ -typedef struct VdbeOp Op; - -/* -** Boolean values -*/ -typedef unsigned char Bool; - -/* -** A cursor is a pointer into a single BTree within a database file. -** The cursor can seek to a BTree entry with a particular key, or -** loop over all entries of the Btree. You can also insert new BTree -** entries or retrieve the key or data from the entry that the cursor -** is currently pointing to. -** -** Every cursor that the virtual machine has open is represented by an -** instance of the following structure. -** -** If the Cursor.isTriggerRow flag is set it means that this cursor is -** really a single row that represents the NEW or OLD pseudo-table of -** a row trigger. The data for the row is stored in Cursor.pData and -** the rowid is in Cursor.iKey. -*/ -struct Cursor { - BtCursor *pCursor; /* The cursor structure of the backend */ - int lastRecno; /* Last recno from a Next or NextIdx operation */ - int nextRowid; /* Next rowid returned by OP_NewRowid */ - Bool recnoIsValid; /* True if lastRecno is valid */ - Bool keyAsData; /* The OP_Column command works on key instead of data */ - Bool atFirst; /* True if pointing to first entry */ - Bool useRandomRowid; /* Generate new record numbers semi-randomly */ - Bool nullRow; /* True if pointing to a row with no data */ - Bool nextRowidValid; /* True if the nextRowid field is valid */ - Bool pseudoTable; /* This is a NEW or OLD pseudo-tables of a trigger */ - Btree *pBt; /* Separate file holding temporary table */ - int nData; /* Number of bytes in pData */ - char *pData; /* Data for a NEW or OLD pseudo-table */ - int iKey; /* Key for the NEW or OLD pseudo-table row */ -}; -typedef struct Cursor Cursor; - -/* -** A sorter builds a list of elements to be sorted. Each element of -** the list is an instance of the following structure. -*/ -typedef struct Sorter Sorter; -struct Sorter { - int nKey; /* Number of bytes in the key */ - char *zKey; /* The key by which we will sort */ - int nData; /* Number of bytes in the data */ - char *pData; /* The data associated with this key */ - Sorter *pNext; /* Next in the list */ -}; - -/* -** Number of buckets used for merge-sort. -*/ -#define NSORT 30 - -/* -** Number of bytes of string storage space available to each stack -** layer without having to malloc. NBFS is short for Number of Bytes -** For Strings. -*/ -#define NBFS 32 - -/* -** A single level of the stack is an instance of the following -** structure. Except, string values are stored on a separate -** list of of pointers to character. The reason for storing -** strings separately is so that they can be easily passed -** to the callback function. -*/ -struct Stack { - int i; /* Integer value */ - int n; /* Number of characters in string value, including '\0' */ - int flags; /* Some combination of STK_Null, STK_Str, STK_Dyn, etc. */ - double r; /* Real value */ - char z[NBFS]; /* Space for short strings */ -}; -typedef struct Stack Stack; - -/* -** Memory cells use the same structure as the stack except that space -** for an arbitrary string is added. -*/ -struct Mem { - Stack s; /* All values of the memory cell besides string */ - char *z; /* String value for this memory cell */ -}; -typedef struct Mem Mem; - -/* -** Allowed values for Stack.flags -*/ -#define STK_Null 0x0001 /* Value is NULL */ -#define STK_Str 0x0002 /* Value is a string */ -#define STK_Int 0x0004 /* Value is an integer */ -#define STK_Real 0x0008 /* Value is a real number */ -#define STK_Dyn 0x0010 /* Need to call sqliteFree() on zStack[] */ -#define STK_Static 0x0020 /* zStack[] points to a static string */ -#define STK_Ephem 0x0040 /* zStack[] points to an ephemeral string */ - -/* The following STK_ value appears only in AggElem.aMem.s.flag fields. -** It indicates that the corresponding AggElem.aMem.z points to a -** aggregate function context that needs to be finalized. -*/ -#define STK_AggCtx 0x0040 /* zStack[] points to an agg function context */ - -/* -** The "context" argument for a installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbe.c because it uses substructures -** (Stack) which are only defined there. -*/ -struct sqlite_func { - FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ - Stack s; /* Small strings, ints, and double values go here */ - char *z; /* Space for holding dynamic string results */ - void *pAgg; /* Aggregate context */ - u8 isError; /* Set to true for an error */ - u8 isStep; /* Current in the step function */ - int cnt; /* Number of times that the step function has been called */ -}; - -/* -** An Agg structure describes an Aggregator. Each Agg consists of -** zero or more Aggregator elements (AggElem). Each AggElem contains -** a key and one or more values. The values are used in processing -** aggregate functions in a SELECT. The key is used to implement -** the GROUP BY clause of a select. -*/ -typedef struct Agg Agg; -typedef struct AggElem AggElem; -struct Agg { - int nMem; /* Number of values stored in each AggElem */ - AggElem *pCurrent; /* The AggElem currently in focus */ - HashElem *pSearch; /* The hash element for pCurrent */ - Hash hash; /* Hash table of all aggregate elements */ - FuncDef **apFunc; /* Information about aggregate functions */ -}; -struct AggElem { - char *zKey; /* The key to this AggElem */ - int nKey; /* Number of bytes in the key, including '\0' at end */ - Mem aMem[1]; /* The values for this AggElem */ -}; - -/* -** A Set structure is used for quick testing to see if a value -** is part of a small set. Sets are used to implement code like -** this: -** x.y IN ('hi','hoo','hum') -*/ -typedef struct Set Set; -struct Set { - Hash hash; /* A set is just a hash table */ - HashElem *prev; /* Previously accessed hash elemen */ -}; - -/* -** A Keylist is a bunch of keys into a table. The keylist can -** grow without bound. The keylist stores the ROWIDs of database -** records that need to be deleted or updated. -*/ -typedef struct Keylist Keylist; -struct Keylist { - int nKey; /* Number of slots in aKey[] */ - int nUsed; /* Next unwritten slot in aKey[] */ - int nRead; /* Next unread slot in aKey[] */ - Keylist *pNext; /* Next block of keys */ - int aKey[1]; /* One or more keys. Extra space allocated as needed */ -}; - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite_vm" structure pointer that is returned by sqlite_compile() -** is really a pointer to an instance of this structure. -*/ -struct Vdbe { - sqlite *db; /* The whole database */ - Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ - FILE *trace; /* Write an execution trace here, if not NULL */ - int nOp; /* Number of instructions in the program */ - int nOpAlloc; /* Number of slots allocated for aOp[] */ - Op *aOp; /* Space to hold the virtual machine's program */ - int nLabel; /* Number of labels used */ - int nLabelAlloc; /* Number of slots allocated in aLabel[] */ - int *aLabel; /* Space to hold the labels */ - int tos; /* Index of top of stack */ - Stack *aStack; /* The operand stack, except string values */ - char **zStack; /* Text or binary values of the stack */ - char **azColName; /* Becomes the 4th parameter to callbacks */ - int nCursor; /* Number of slots in aCsr[] */ - Cursor *aCsr; /* One element of this array for each open cursor */ - Sorter *pSort; /* A linked list of objects to be sorted */ - FILE *pFile; /* At most one open file handler */ - int nField; /* Number of file fields */ - char **azField; /* Data for each file field */ - char *zLine; /* A single line from the input file */ - int magic; /* Magic number for sanity checking */ - int nLineAlloc; /* Number of spaces allocated for zLine */ - int nMem; /* Number of memory locations currently allocated */ - Mem *aMem; /* The memory locations */ - Agg agg; /* Aggregate information */ - int nSet; /* Number of sets allocated */ - Set *aSet; /* An array of sets */ - int nCallback; /* Number of callbacks invoked so far */ - Keylist *pList; /* A list of ROWIDs */ - int keylistStackDepth; /* The size of the "keylist" stack */ - Keylist **keylistStack; /* The stack used by opcodes ListPush & ListPop */ - int pc; /* The program counter */ - int rc; /* Value to return */ - unsigned uniqueCnt; /* Used by OP_MakeRecord when P2!=0 */ - int errorAction; /* Recovery action to do in case of an error */ - int undoTransOnError; /* If error, either ROLLBACK or COMMIT */ - int inTempTrans; /* True if temp database is transactioned */ - int returnStack[100]; /* Return address stack for OP_Gosub & OP_Return */ - int returnDepth; /* Next unused element in returnStack[] */ - int nResColumn; /* Number of columns in one row of the result set */ - char **azResColumn; /* Values for one row of result */ - int (*xCallback)(void*,int,char**,char**); /* Callback for SELECT results */ - void *pCbArg; /* First argument to xCallback() */ - int popStack; /* Pop the stack this much on entry to VdbeExec() */ - char *zErrMsg; /* Error message written here */ - u8 explain; /* True if EXPLAIN present on SQL command */ -}; - -/* -** The following are allowed values for Vdbe.magic -*/ -#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */ -#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */ -#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */ -#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */ - -/* -** When debugging the code generator in a symbolic debugger, one can -** set the sqlite_vdbe_addop_trace to 1 and all opcodes will be printed -** as they are added to the instruction stream. -*/ -#ifndef NDEBUG -int sqlite_vdbe_addop_trace = 0; -static void vdbePrintOp(FILE*, int, Op*); -#endif - -/* -** Create a new virtual database engine. -*/ -Vdbe *sqliteVdbeCreate(sqlite *db){ - Vdbe *p; - p = sqliteMalloc( sizeof(Vdbe) ); - if( p==0 ) return 0; - p->db = db; - if( db->pVdbe ){ - db->pVdbe->pPrev = p; - } - p->pNext = db->pVdbe; - p->pPrev = 0; - db->pVdbe = p; - p->magic = VDBE_MAGIC_INIT; - return p; -} - -/* -** Turn tracing on or off -*/ -void sqliteVdbeTrace(Vdbe *p, FILE *trace){ - p->trace = trace; -} - -/* -** Add a new instruction to the list of instructions current in the -** VDBE. Return the address of the new instruction. -** -** Parameters: -** -** p Pointer to the VDBE -** -** op The opcode for this instruction -** -** p1, p2 First two of the three possible operands. -** -** Use the sqliteVdbeResolveLabel() function to fix an address and -** the sqliteVdbeChangeP3() function to change the value of the P3 -** operand. -*/ -int sqliteVdbeAddOp(Vdbe *p, int op, int p1, int p2){ - int i; - - i = p->nOp; - p->nOp++; - assert( p->magic==VDBE_MAGIC_INIT ); - if( i>=p->nOpAlloc ){ - int oldSize = p->nOpAlloc; - Op *aNew; - p->nOpAlloc = p->nOpAlloc*2 + 100; - aNew = sqliteRealloc(p->aOp, p->nOpAlloc*sizeof(Op)); - if( aNew==0 ){ - p->nOpAlloc = oldSize; - return 0; - } - p->aOp = aNew; - memset(&p->aOp[oldSize], 0, (p->nOpAlloc-oldSize)*sizeof(Op)); - } - p->aOp[i].opcode = op; - p->aOp[i].p1 = p1; - if( p2<0 && (-1-p2)<p->nLabel && p->aLabel[-1-p2]>=0 ){ - p2 = p->aLabel[-1-p2]; - } - p->aOp[i].p2 = p2; - p->aOp[i].p3 = 0; - p->aOp[i].p3type = P3_NOTUSED; -#ifndef NDEBUG - if( sqlite_vdbe_addop_trace ) vdbePrintOp(0, i, &p->aOp[i]); -#endif - return i; -} - -/* -** Create a new symbolic label for an instruction that has yet to be -** coded. The symbolic label is really just a negative number. The -** label can be used as the P2 value of an operation. Later, when -** the label is resolved to a specific address, the VDBE will scan -** through its operation list and change all values of P2 which match -** the label into the resolved address. -** -** The VDBE knows that a P2 value is a label because labels are -** always negative and P2 values are suppose to be non-negative. -** Hence, a negative P2 value is a label that has yet to be resolved. -*/ -int sqliteVdbeMakeLabel(Vdbe *p){ - int i; - i = p->nLabel++; - assert( p->magic==VDBE_MAGIC_INIT ); - if( i>=p->nLabelAlloc ){ - int *aNew; - p->nLabelAlloc = p->nLabelAlloc*2 + 10; - aNew = sqliteRealloc( p->aLabel, p->nLabelAlloc*sizeof(p->aLabel[0])); - if( aNew==0 ){ - sqliteFree(p->aLabel); - } - p->aLabel = aNew; - } - if( p->aLabel==0 ){ - p->nLabel = 0; - p->nLabelAlloc = 0; - return 0; - } - p->aLabel[i] = -1; - return -1-i; -} - -/* -** Resolve label "x" to be the address of the next instruction to -** be inserted. The parameter "x" must have been obtained from -** a prior call to sqliteVdbeMakeLabel(). -*/ -void sqliteVdbeResolveLabel(Vdbe *p, int x){ - int j; - assert( p->magic==VDBE_MAGIC_INIT ); - if( x<0 && (-x)<=p->nLabel && p->aOp ){ - if( p->aLabel[-1-x]==p->nOp ) return; - assert( p->aLabel[-1-x]<0 ); - p->aLabel[-1-x] = p->nOp; - for(j=0; j<p->nOp; j++){ - if( p->aOp[j].p2==x ) p->aOp[j].p2 = p->nOp; - } - } -} - -/* -** Return the address of the next instruction to be inserted. -*/ -int sqliteVdbeCurrentAddr(Vdbe *p){ - assert( p->magic==VDBE_MAGIC_INIT ); - return p->nOp; -} - -/* -** Add a whole list of operations to the operation stack. Return the -** address of the first operation added. -*/ -int sqliteVdbeAddOpList(Vdbe *p, int nOp, VdbeOp const *aOp){ - int addr; - assert( p->magic==VDBE_MAGIC_INIT ); - if( p->nOp + nOp >= p->nOpAlloc ){ - int oldSize = p->nOpAlloc; - Op *aNew; - p->nOpAlloc = p->nOpAlloc*2 + nOp + 10; - aNew = sqliteRealloc(p->aOp, p->nOpAlloc*sizeof(Op)); - if( aNew==0 ){ - p->nOpAlloc = oldSize; - return 0; - } - p->aOp = aNew; - memset(&p->aOp[oldSize], 0, (p->nOpAlloc-oldSize)*sizeof(Op)); - } - addr = p->nOp; - if( nOp>0 ){ - int i; - for(i=0; i<nOp; i++){ - int p2 = aOp[i].p2; - p->aOp[i+addr] = aOp[i]; - if( p2<0 ) p->aOp[i+addr].p2 = addr + ADDR(p2); - p->aOp[i+addr].p3type = aOp[i].p3 ? P3_STATIC : P3_NOTUSED; -#ifndef NDEBUG - if( sqlite_vdbe_addop_trace ) vdbePrintOp(0, i+addr, &p->aOp[i+addr]); -#endif - } - p->nOp += nOp; - } - return addr; -} - -#if 0 /* NOT USED */ -/* -** Change the value of the P1 operand for a specific instruction. -** This routine is useful when a large program is loaded from a -** static array using sqliteVdbeAddOpList but we want to make a -** few minor changes to the program. -*/ -void sqliteVdbeChangeP1(Vdbe *p, int addr, int val){ - assert( p->magic==VDBE_MAGIC_INIT ); - if( p && addr>=0 && p->nOp>addr && p->aOp ){ - p->aOp[addr].p1 = val; - } -} -#endif /* NOT USED */ - -/* -** Change the value of the P2 operand for a specific instruction. -** This routine is useful for setting a jump destination. -*/ -void sqliteVdbeChangeP2(Vdbe *p, int addr, int val){ - assert( val>=0 ); - assert( p->magic==VDBE_MAGIC_INIT ); - if( p && addr>=0 && p->nOp>addr && p->aOp ){ - p->aOp[addr].p2 = val; - } -} - -/* -** Change the value of the P3 operand for a specific instruction. -** This routine is useful when a large program is loaded from a -** static array using sqliteVdbeAddOpList but we want to make a -** few minor changes to the program. -** -** If n>=0 then the P3 operand is dynamic, meaning that a copy of -** the string is made into memory obtained from sqliteMalloc(). -** A value of n==0 means copy bytes of zP3 up to and including the -** first null byte. If n>0 then copy n+1 bytes of zP3. -** -** If n==P3_STATIC it means that zP3 is a pointer to a constant static -** string and we can just copy the pointer. n==P3_POINTER means zP3 is -** a pointer to some object other than a string. -** -** If addr<0 then change P3 on the most recently inserted instruction. -*/ -void sqliteVdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){ - Op *pOp; - assert( p->magic==VDBE_MAGIC_INIT ); - if( p==0 || p->aOp==0 ) return; - if( addr<0 || addr>=p->nOp ){ - addr = p->nOp - 1; - if( addr<0 ) return; - } - pOp = &p->aOp[addr]; - if( pOp->p3 && pOp->p3type==P3_DYNAMIC ){ - sqliteFree(pOp->p3); - pOp->p3 = 0; - } - if( zP3==0 ){ - pOp->p3 = 0; - pOp->p3type = P3_NOTUSED; - }else if( n<0 ){ - pOp->p3 = (char*)zP3; - pOp->p3type = n; - }else{ - sqliteSetNString(&pOp->p3, zP3, n, 0); - pOp->p3type = P3_DYNAMIC; - } -} - -/* -** If the P3 operand to the specified instruction appears -** to be a quoted string token, then this procedure removes -** the quotes. -** -** The quoting operator can be either a grave ascent (ASCII 0x27) -** or a double quote character (ASCII 0x22). Two quotes in a row -** resolve to be a single actual quote character within the string. -*/ -void sqliteVdbeDequoteP3(Vdbe *p, int addr){ - Op *pOp; - assert( p->magic==VDBE_MAGIC_INIT ); - if( p->aOp==0 || addr<0 || addr>=p->nOp ) return; - pOp = &p->aOp[addr]; - if( pOp->p3==0 || pOp->p3[0]==0 ) return; - if( pOp->p3type==P3_POINTER ) return; - if( pOp->p3type!=P3_DYNAMIC ){ - pOp->p3 = sqliteStrDup(pOp->p3); - pOp->p3type = P3_DYNAMIC; - } - sqliteDequote(pOp->p3); -} - -/* -** On the P3 argument of the given instruction, change all -** strings of whitespace characters into a single space and -** delete leading and trailing whitespace. -*/ -void sqliteVdbeCompressSpace(Vdbe *p, int addr){ - char *z; - int i, j; - Op *pOp; - assert( p->magic==VDBE_MAGIC_INIT ); - if( p->aOp==0 || addr<0 || addr>=p->nOp ) return; - pOp = &p->aOp[addr]; - if( pOp->p3type==P3_POINTER ){ - return; - } - if( pOp->p3type!=P3_DYNAMIC ){ - pOp->p3 = sqliteStrDup(pOp->p3); - pOp->p3type = P3_DYNAMIC; - } - z = pOp->p3; - if( z==0 ) return; - i = j = 0; - while( isspace(z[i]) ){ i++; } - while( z[i] ){ - if( isspace(z[i]) ){ - z[j++] = ' '; - while( isspace(z[++i]) ){} - }else{ - z[j++] = z[i++]; - } - } - while( j>0 && isspace(z[j-1]) ){ j--; } - z[j] = 0; -} - -/* -** Search for the current program for the given opcode and P2 -** value. Return the address plus 1 if found and 0 if not found. -*/ -int sqliteVdbeFindOp(Vdbe *p, int op, int p2){ - int i; - assert( p->magic==VDBE_MAGIC_INIT ); - for(i=0; i<p->nOp; i++){ - if( p->aOp[i].opcode==op && p->aOp[i].p2==p2 ) return i+1; - } - return 0; -} - -/* -** Return the opcode for a given address. -*/ -VdbeOp *sqliteVdbeGetOp(Vdbe *p, int addr){ - assert( p->magic==VDBE_MAGIC_INIT ); - assert( addr>=0 && addr<p->nOp ); - return &p->aOp[addr]; -} - -/* -** The following group or routines are employed by installable functions -** to return their results. -** -** The sqlite_set_result_string() routine can be used to return a string -** value or to return a NULL. To return a NULL, pass in NULL for zResult. -** A copy is made of the string before this routine returns so it is safe -** to pass in an ephemeral string. -** -** sqlite_set_result_error() works like sqlite_set_result_string() except -** that it signals a fatal error. The string argument, if any, is the -** error message. If the argument is NULL a generic substitute error message -** is used. -** -** The sqlite_set_result_int() and sqlite_set_result_double() set the return -** value of the user function to an integer or a double. -** -** These routines are defined here in vdbe.c because they depend on knowing -** the internals of the sqlite_func structure which is only defined in -** this source file. -*/ -char *sqlite_set_result_string(sqlite_func *p, const char *zResult, int n){ - assert( !p->isStep ); - if( p->s.flags & STK_Dyn ){ - sqliteFree(p->z); - } - if( zResult==0 ){ - p->s.flags = STK_Null; - n = 0; - p->z = 0; - p->s.n = 0; - }else{ - if( n<0 ) n = strlen(zResult); - if( n<NBFS-1 ){ - memcpy(p->s.z, zResult, n); - p->s.z[n] = 0; - p->s.flags = STK_Str; - p->z = p->s.z; - }else{ - p->z = sqliteMallocRaw( n+1 ); - if( p->z ){ - memcpy(p->z, zResult, n); - p->z[n] = 0; - } - p->s.flags = STK_Str | STK_Dyn; - } - p->s.n = n+1; - } - return p->z; -} -void sqlite_set_result_int(sqlite_func *p, int iResult){ - assert( !p->isStep ); - if( p->s.flags & STK_Dyn ){ - sqliteFree(p->z); - } - p->s.i = iResult; - p->s.flags = STK_Int; -} -void sqlite_set_result_double(sqlite_func *p, double rResult){ - assert( !p->isStep ); - if( p->s.flags & STK_Dyn ){ - sqliteFree(p->z); - } - p->s.r = rResult; - p->s.flags = STK_Real; -} -void sqlite_set_result_error(sqlite_func *p, const char *zMsg, int n){ - assert( !p->isStep ); - sqlite_set_result_string(p, zMsg, n); - p->isError = 1; -} - -/* -** Extract the user data from a sqlite_func structure and return a -** pointer to it. -** -** This routine is defined here in vdbe.c because it depends on knowing -** the internals of the sqlite_func structure which is only defined in -** this source file. -*/ -void *sqlite_user_data(sqlite_func *p){ - assert( p && p->pFunc ); - return p->pFunc->pUserData; -} - -/* -** Allocate or return the aggregate context for a user function. A new -** context is allocated on the first call. Subsequent calls return the -** same context that was returned on prior calls. -** -** This routine is defined here in vdbe.c because it depends on knowing -** the internals of the sqlite_func structure which is only defined in -** this source file. -*/ -void *sqlite_aggregate_context(sqlite_func *p, int nByte){ - assert( p && p->pFunc && p->pFunc->xStep ); - if( p->pAgg==0 ){ - if( nByte<=NBFS ){ - p->pAgg = (void*)p->z; - }else{ - p->pAgg = sqliteMalloc( nByte ); - } - } - return p->pAgg; -} - -/* -** Return the number of times the Step function of a aggregate has been -** called. -** -** This routine is defined here in vdbe.c because it depends on knowing -** the internals of the sqlite_func structure which is only defined in -** this source file. -*/ -int sqlite_aggregate_count(sqlite_func *p){ - assert( p && p->pFunc && p->pFunc->xStep ); - return p->cnt; -} /* ** Advance the virtual machine to the next output row. @@ -811,16 +118,18 @@ int sqlite_step( rc = sqliteVdbeExec(p); } if( rc==SQLITE_DONE || rc==SQLITE_ROW ){ - *pazColName = (const char**)p->azColName; - *pN = p->nResColumn; + if( pazColName ) *pazColName = (const char**)p->azColName; + if( pN ) *pN = p->nResColumn; }else{ - *pN = 0; - *pazColName = 0; + if( pazColName) *pazColName = 0; + if( pN ) *pN = 0; } - if( rc==SQLITE_ROW ){ - *pazValue = (const char**)p->azResColumn; - }else{ - *pazValue = 0; + if( pazValue ){ + if( rc==SQLITE_ROW ){ + *pazValue = (const char**)p->azResColumn; + }else{ + *pazValue = 0; + } } if( sqliteSafetyOff(db) ){ return SQLITE_MISUSE; @@ -829,50 +138,6 @@ int sqlite_step( } /* -** Reset an Agg structure. Delete all its contents. -** -** For installable aggregate functions, if the step function has been -** called, make sure the finalizer function has also been called. The -** finalizer might need to free memory that was allocated as part of its -** private context. If the finalizer has not been called yet, call it -** now. -*/ -static void AggReset(Agg *pAgg){ - int i; - HashElem *p; - for(p = sqliteHashFirst(&pAgg->hash); p; p = sqliteHashNext(p)){ - AggElem *pElem = sqliteHashData(p); - assert( pAgg->apFunc!=0 ); - for(i=0; i<pAgg->nMem; i++){ - Mem *pMem = &pElem->aMem[i]; - if( pAgg->apFunc[i] && (pMem->s.flags & STK_AggCtx)!=0 ){ - sqlite_func ctx; - ctx.pFunc = pAgg->apFunc[i]; - ctx.s.flags = STK_Null; - ctx.z = 0; - ctx.pAgg = pMem->z; - ctx.cnt = pMem->s.i; - ctx.isStep = 0; - ctx.isError = 0; - (*pAgg->apFunc[i]->xFinalize)(&ctx); - if( pMem->z!=0 && pMem->z!=pMem->s.z ){ - sqliteFree(pMem->z); - } - }else if( pMem->s.flags & STK_Dyn ){ - sqliteFree(pMem->z); - } - } - sqliteFree(pElem); - } - sqliteHashClear(&pAgg->hash); - sqliteFree(pAgg->apFunc); - pAgg->apFunc = 0; - pAgg->pCurrent = 0; - pAgg->pSearch = 0; - pAgg->nMem = 0; -} - -/* ** Insert a new aggregate element and make it the element that ** has focus. ** @@ -922,9 +187,9 @@ static int hardStringify(Vdbe *p, int i){ Stack *pStack = &p->aStack[i]; int fg = pStack->flags; if( fg & STK_Real ){ - sprintf(pStack->z,"%.15g",pStack->r); + sqlite_snprintf(sizeof(pStack->z),pStack->z,"%.15g",pStack->r); }else if( fg & STK_Int ){ - sprintf(pStack->z,"%d",pStack->i); + sqlite_snprintf(sizeof(pStack->z),pStack->z,"%d",pStack->i); }else{ pStack->z[0] = 0; } @@ -980,6 +245,8 @@ static int hardDeephem(Vdbe *p, int i){ if( z==0 ) return 1; memcpy(z, *pzStack, pStack->n); *pzStack = z; + pStack->flags &= ~STK_Ephem; + pStack->flags |= STK_Dyn; return 0; } @@ -994,8 +261,10 @@ static void hardRelease(Vdbe *p, int i){ } /* -** Return TRUE if zNum is an integer and write -** the value of the integer into *pNum. +** Return TRUE if zNum is a 32-bit signed integer and write +** the value of the integer into *pNum. If zNum is not an integer +** or is an integer that is too large to be expressed with just 32 +** bits, then return false. ** ** Under Linux (RedHat 7.2) this routine is much faster than atoi() ** for converting strings into integers. @@ -1003,6 +272,7 @@ static void hardRelease(Vdbe *p, int i){ static int toInt(const char *zNum, int *pNum){ int v = 0; int neg; + int i, c; if( *zNum=='-' ){ neg = 1; zNum++; @@ -1012,13 +282,11 @@ static int toInt(const char *zNum, int *pNum){ }else{ neg = 0; } - if( *zNum==0 ) return 0; - while( isdigit(*zNum) ){ - v = v*10 + *zNum - '0'; - zNum++; + for(i=0; (c=zNum[i])>='0' && c<='9'; i++){ + v = v*10 + c - '0'; } *pNum = neg ? -v : v; - return *zNum==0; + return c==0 && i>0 && (i<10 || (i==10 && memcmp(zNum,"2147483647",10)<=0)); } /* @@ -1053,7 +321,7 @@ static void hardIntegerify(Vdbe *p, int i){ if(((P)->aStack[(I)].flags&STK_Real)==0){ hardRealify(P,I); } static void hardRealify(Vdbe *p, int i){ if( p->aStack[i].flags & STK_Str ){ - p->aStack[i].r = atof(p->zStack[i]); + p->aStack[i].r = sqliteAtoF(p->zStack[i]); }else if( p->aStack[i].flags & STK_Int ){ p->aStack[i].r = p->aStack[i].i; }else{ @@ -1063,246 +331,6 @@ static void hardRealify(Vdbe *p, int i){ } /* -** Pop the stack N times. Free any memory associated with the -** popped stack elements. -*/ -static void PopStack(Vdbe *p, int N){ - assert( N>=0 ); - if( p->zStack==0 ) return; - assert( p->aStack || sqlite_malloc_failed ); - if( p->aStack==0 ) return; - while( N-- > 0 ){ - if( p->aStack[p->tos].flags & STK_Dyn ){ - sqliteFree(p->zStack[p->tos]); - } - p->aStack[p->tos].flags = 0; - p->zStack[p->tos] = 0; - p->tos--; - } -} - -/* -** Here is a macro to handle the common case of popping the stack -** once. This macro only works from within the sqliteVdbeExec() -** function. -*/ -#define POPSTACK \ - assert(p->tos>=0); \ - if( aStack[p->tos].flags & STK_Dyn ) sqliteFree(zStack[p->tos]); \ - p->tos--; - -/* -** Delete a keylist -*/ -static void KeylistFree(Keylist *p){ - while( p ){ - Keylist *pNext = p->pNext; - sqliteFree(p); - p = pNext; - } -} - -/* -** Close a cursor and release all the resources that cursor happens -** to hold. -*/ -static void cleanupCursor(Cursor *pCx){ - if( pCx->pCursor ){ - sqliteBtreeCloseCursor(pCx->pCursor); - } - if( pCx->pBt ){ - sqliteBtreeClose(pCx->pBt); - } - sqliteFree(pCx->pData); - memset(pCx, 0, sizeof(Cursor)); -} - -/* -** Close all cursors -*/ -static void closeAllCursors(Vdbe *p){ - int i; - for(i=0; i<p->nCursor; i++){ - cleanupCursor(&p->aCsr[i]); - } - sqliteFree(p->aCsr); - p->aCsr = 0; - p->nCursor = 0; -} - -/* -** Remove any elements that remain on the sorter for the VDBE given. -*/ -static void SorterReset(Vdbe *p){ - while( p->pSort ){ - Sorter *pSorter = p->pSort; - p->pSort = pSorter->pNext; - sqliteFree(pSorter->zKey); - sqliteFree(pSorter->pData); - sqliteFree(pSorter); - } -} - -/* -** Clean up the VM after execution. -** -** This routine will automatically close any cursors, lists, and/or -** sorters that were left open. -*/ -static void Cleanup(Vdbe *p){ - int i; - PopStack(p, p->tos+1); - closeAllCursors(p); - if( p->aMem ){ - for(i=0; i<p->nMem; i++){ - if( p->aMem[i].s.flags & STK_Dyn ){ - sqliteFree(p->aMem[i].z); - } - } - } - sqliteFree(p->aMem); - p->aMem = 0; - p->nMem = 0; - if( p->pList ){ - KeylistFree(p->pList); - p->pList = 0; - } - SorterReset(p); - if( p->pFile ){ - if( p->pFile!=stdin ) fclose(p->pFile); - p->pFile = 0; - } - if( p->azField ){ - sqliteFree(p->azField); - p->azField = 0; - } - p->nField = 0; - if( p->zLine ){ - sqliteFree(p->zLine); - p->zLine = 0; - } - p->nLineAlloc = 0; - AggReset(&p->agg); - if( p->aSet ){ - for(i=0; i<p->nSet; i++){ - sqliteHashClear(&p->aSet[i].hash); - } - } - sqliteFree(p->aSet); - p->aSet = 0; - p->nSet = 0; - if( p->keylistStack ){ - int ii; - for(ii = 0; ii < p->keylistStackDepth; ii++){ - KeylistFree(p->keylistStack[ii]); - } - sqliteFree(p->keylistStack); - p->keylistStackDepth = 0; - p->keylistStack = 0; - } - sqliteFree(p->zErrMsg); - p->zErrMsg = 0; - p->magic = VDBE_MAGIC_DEAD; -} - -/* -** Delete an entire VDBE. -*/ -void sqliteVdbeDelete(Vdbe *p){ - int i; - if( p==0 ) return; - Cleanup(p); - if( p->pPrev ){ - p->pPrev->pNext = p->pNext; - }else{ - assert( p->db->pVdbe==p ); - p->db->pVdbe = p->pNext; - } - if( p->pNext ){ - p->pNext->pPrev = p->pPrev; - } - p->pPrev = p->pNext = 0; - if( p->nOpAlloc==0 ){ - p->aOp = 0; - p->nOp = 0; - } - for(i=0; i<p->nOp; i++){ - if( p->aOp[i].p3type==P3_DYNAMIC ){ - sqliteFree(p->aOp[i].p3); - } - } - sqliteFree(p->aOp); - sqliteFree(p->aLabel); - sqliteFree(p->aStack); - sqliteFree(p); -} - -/* -** Give a listing of the program in the virtual machine. -** -** The interface is the same as sqliteVdbeExec(). But instead of -** running the code, it invokes the callback once for each instruction. -** This feature is used to implement "EXPLAIN". -*/ -int sqliteVdbeList( - Vdbe *p /* The VDBE */ -){ - sqlite *db = p->db; - int i; - static char *azColumnNames[] = { - "addr", "opcode", "p1", "p2", "p3", - "int", "text", "int", "int", "text", - 0 - }; - - assert( p->popStack==0 ); - assert( p->explain ); - p->azColName = azColumnNames; - p->azResColumn = p->zStack; - for(i=0; i<5; i++) p->zStack[i] = p->aStack[i].z; - p->rc = SQLITE_OK; - for(i=p->pc; p->rc==SQLITE_OK && i<p->nOp; i++){ - if( db->flags & SQLITE_Interrupt ){ - db->flags &= ~SQLITE_Interrupt; - if( db->magic!=SQLITE_MAGIC_BUSY ){ - p->rc = SQLITE_MISUSE; - }else{ - p->rc = SQLITE_INTERRUPT; - } - sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), 0); - break; - } - sprintf(p->zStack[0],"%d",i); - sprintf(p->zStack[2],"%d", p->aOp[i].p1); - sprintf(p->zStack[3],"%d", p->aOp[i].p2); - if( p->aOp[i].p3type==P3_POINTER ){ - sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3); - p->zStack[4] = p->aStack[4].z; - }else{ - p->zStack[4] = p->aOp[i].p3; - } - p->zStack[1] = sqliteOpcodeNames[p->aOp[i].opcode]; - if( p->xCallback==0 ){ - p->pc = i+1; - p->azResColumn = p->zStack; - p->nResColumn = 5; - return SQLITE_ROW; - } - if( sqliteSafetyOff(db) ){ - p->rc = SQLITE_MISUSE; - break; - } - if( p->xCallback(p->pCbArg, 5, p->zStack, p->azColName) ){ - p->rc = SQLITE_ABORT; - } - if( sqliteSafetyOn(db) ){ - p->rc = SQLITE_MISUSE; - } - } - return p->rc==SQLITE_OK ? SQLITE_DONE : SQLITE_ERROR; -} - -/* ** The parameters are pointers to the head of two sorted lists ** of Sorter structures. Merge these two lists together and return ** a single sorted list. This routine forms the core of the merge-sort @@ -1335,42 +363,6 @@ static Sorter *Merge(Sorter *pLeft, Sorter *pRight){ } /* -** Convert an integer in between the native integer format and -** the bigEndian format used as the record number for tables. -** -** The bigEndian format (most significant byte first) is used for -** record numbers so that records will sort into the correct order -** even though memcmp() is used to compare the keys. On machines -** whose native integer format is little endian (ex: i486) the -** order of bytes is reversed. On native big-endian machines -** (ex: Alpha, Sparc, Motorola) the byte order is the same. -** -** This function is its own inverse. In other words -** -** X == byteSwap(byteSwap(X)) -*/ -static int byteSwap(int x){ - union { - char zBuf[sizeof(int)]; - int i; - } ux; - ux.zBuf[3] = x&0xff; - ux.zBuf[2] = (x>>8)&0xff; - ux.zBuf[1] = (x>>16)&0xff; - ux.zBuf[0] = (x>>24)&0xff; - return ux.i; -} - -/* -** When converting from the native format to the key format and back -** again, in addition to changing the byte order we invert the high-order -** bit of the most significant byte. This causes negative numbers to -** sort before positive numbers in the memcmp() function. -*/ -#define keyToInt(X) (byteSwap(X) ^ 0x80000000) -#define intToKey(X) (byteSwap((X) ^ 0x80000000)) - -/* ** Code contained within the VERIFY() macro is not needed for correct ** execution. It is there only to catch errors. So when we compile ** with NDEBUG=1, the VERIFY() code is omitted. @@ -1407,26 +399,6 @@ static char *vdbe_fgets(char *zBuf, int nBuf, FILE *in){ return i>0 ? zBuf : 0; } -#if !defined(NDEBUG) || defined(VDBE_PROFILE) -/* -** Print a single opcode. This routine is used for debugging only. -*/ -static void vdbePrintOp(FILE *pOut, int pc, Op *pOp){ - char *zP3; - char zPtr[40]; - if( pOp->p3type==P3_POINTER ){ - sprintf(zPtr, "ptr(%#x)", (int)pOp->p3); - zP3 = zPtr; - }else{ - zP3 = pOp->p3; - } - if( pOut==0 ) pOut = stdout; - fprintf(pOut,"%4d %-12s %4d %4d %s\n", - pc, sqliteOpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3 ? zP3 : ""); - fflush(pOut); -} -#endif - /* ** Make sure there is space in the Vdbe structure to hold at least ** mxCursor cursors. If there is not currently enough space, then @@ -1477,78 +449,6 @@ __inline__ unsigned long long int hwtime(void){ /* -** Prepare a virtual machine for execution. This involves things such -** as allocating stack space and initializing the program counter. -** After the VDBE has be prepped, it can be executed by one or more -** calls to sqliteVdbeExec(). -** -** The behavior of sqliteVdbeExec() is influenced by the parameters to -** this routine. If xCallback is NULL, then sqliteVdbeExec() will return -** with SQLITE_ROW whenever there is a row of the result set ready -** to be delivered. p->azResColumn will point to the row and -** p->nResColumn gives the number of columns in the row. If xCallback -** is not NULL, then the xCallback() routine is invoked to process each -** row in the result set. -*/ -void sqliteVdbeMakeReady( - Vdbe *p, /* The VDBE */ - sqlite_callback xCallback, /* Result callback */ - void *pCallbackArg, /* 1st argument to xCallback() */ - int isExplain /* True if the EXPLAIN keywords is present */ -){ - int n; -#ifdef MEMORY_DEBUG - extern int access(const char*,int); -#endif - - assert( p!=0 ); - assert( p->aStack==0 ); - assert( p->magic==VDBE_MAGIC_INIT ); - - /* Add a HALT instruction to the very end of the program. - */ - sqliteVdbeAddOp(p, OP_Halt, 0, 0); - - /* No instruction ever pushes more than a single element onto the - ** stack. And the stack never grows on successive executions of the - ** same loop. So the total number of instructions is an upper bound - ** on the maximum stack depth required. - ** - ** Allocation all the stack space we will ever need. - */ - n = isExplain ? 10 : p->nOp; - p->aStack = sqliteMalloc( n*(sizeof(p->aStack[0]) + 2*sizeof(char*)) ); - p->zStack = (char**)&p->aStack[n]; - p->azColName = (char**)&p->zStack[n]; - - sqliteHashInit(&p->agg.hash, SQLITE_HASH_BINARY, 0); - p->agg.pSearch = 0; -#ifdef MEMORY_DEBUG - if( access("vdbe_trace",0)==0 ){ - p->trace = stdout; - } -#endif - p->tos = -1; - p->pc = 0; - p->rc = SQLITE_OK; - p->uniqueCnt = 0; - p->returnDepth = 0; - p->errorAction = OE_Abort; - p->undoTransOnError = 0; - p->xCallback = xCallback; - p->pCbArg = pCallbackArg; - p->popStack = 0; - p->explain = isExplain; - p->magic = VDBE_MAGIC_RUN; -#ifdef VDBE_PROFILE - for(i=0; i<p->nOp; i++){ - p->aOp[i].cnt = 0; - p->aOp[i].cycles = 0; - } -#endif -} - -/* ** Execute as much of a VDBE program as we can then return. ** ** sqliteVdbeMakeReady() must be called before this routine in order to @@ -1593,6 +493,9 @@ int sqliteVdbeExec( unsigned long long start; /* CPU clock count at start of opcode */ int origPc; /* Program counter at start of opcode */ #endif +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + int nProgressOps = 0; /* Opcodes executed since progress callback. */ +#endif if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE; assert( db->magic==SQLITE_MAGIC_BUSY ); @@ -1601,11 +504,12 @@ int sqliteVdbeExec( assert( p->explain==0 ); if( sqlite_malloc_failed ) goto no_mem; if( p->popStack ){ - PopStack(p, p->popStack); + sqliteVdbePopStack(p, p->popStack); p->popStack = 0; } for(pc=p->pc; rc==SQLITE_OK; pc++){ assert( pc>=0 && pc<p->nOp ); + assert( p->tos<=pc ); #ifdef VDBE_PROFILE origPc = pc; start = hwtime(); @@ -1616,10 +520,27 @@ int sqliteVdbeExec( */ #ifndef NDEBUG if( p->trace ){ - vdbePrintOp(p->trace, pc, pOp); + sqliteVdbePrintOp(p->trace, pc, pOp); } #endif +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + /* Call the progress callback if it is configured and the required number + ** of VDBE ops have been executed (either since this invocation of + ** sqliteVdbeExec() or since last time the progress callback was called). + ** If the progress callback returns non-zero, exit the virtual machine with + ** a return code SQLITE_ABORT. + */ + if( db->xProgress && (db->nProgressOps==nProgressOps) ){ + if( db->xProgress(db->pProgressArg)!=0 ){ + rc = SQLITE_ABORT; + continue; /* skip to the next iteration of the for loop */ + } + nProgressOps = 0; + } + nProgressOps++; +#endif + switch( pOp->opcode ){ /***************************************************************************** @@ -1675,7 +596,7 @@ case OP_Goto: { */ case OP_Gosub: { if( p->returnDepth>=sizeof(p->returnStack)/sizeof(p->returnStack[0]) ){ - sqliteSetString(&p->zErrMsg, "return address stack overflow", 0); + sqliteSetString(&p->zErrMsg, "return address stack overflow", (char*)0); p->rc = SQLITE_INTERNAL; return SQLITE_ERROR; } @@ -1692,7 +613,7 @@ case OP_Gosub: { */ case OP_Return: { if( p->returnDepth<=0 ){ - sqliteSetString(&p->zErrMsg, "return address stack underflow", 0); + sqliteSetString(&p->zErrMsg, "return address stack underflow", (char*)0); p->rc = SQLITE_INTERNAL; return SQLITE_ERROR; } @@ -1724,7 +645,7 @@ case OP_Halt: { p->rc = pOp->p1; p->errorAction = pOp->p2; if( pOp->p3 ){ - sqliteSetString(&p->zErrMsg, pOp->p3, 0); + sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0); } return SQLITE_ERROR; }else{ @@ -1771,13 +692,37 @@ case OP_String: { break; } +/* Opcode: Variable P1 * * +** +** Push the value of variable P1 onto the stack. A variable is +** an unknown in the original SQL string as handed to sqlite_compile(). +** Any occurance of the '?' character in the original SQL is considered +** a variable. Variables in the SQL string are number from left to +** right beginning with 1. The values of variables are set using the +** sqlite_bind() API. +*/ +case OP_Variable: { + int i = ++p->tos; + int j = pOp->p1 - 1; + if( j>=0 && j<p->nVar && p->azVar[j]!=0 ){ + zStack[i] = p->azVar[j]; + aStack[i].n = p->anVar[j]; + aStack[i].flags = STK_Str | STK_Static; + }else{ + zStack[i] = 0; + aStack[i].n = 0; + aStack[i].flags = STK_Null; + } + break; +} + /* Opcode: Pop P1 * * ** ** P1 elements are popped off of the top of stack and discarded. */ case OP_Pop: { assert( p->tos+1>=pOp->p1 ); - PopStack(p, pOp->p1); + sqliteVdbePopStack(p, pOp->p1); break; } @@ -1839,11 +784,12 @@ case OP_Pull: { Stack ts; char *tz; VERIFY( if( from<0 ) goto not_enough_stack; ) + Deephemeralize(p, from); ts = aStack[from]; tz = zStack[from]; Deephemeralize(p, to); for(i=from; i<to; i++){ - Deephemeralize(p, i); + Deephemeralize(p, i+1); aStack[i] = aStack[i+1]; assert( (aStack[i].flags & STK_Ephem)==0 ); if( aStack[i].flags & (STK_Dyn|STK_Static) ){ @@ -1931,7 +877,7 @@ case OP_Callback: { } if( sqliteSafetyOn(db) ) goto abort_due_to_misuse; p->nCallback++; - PopStack(p, pOp->p1); + sqliteVdbePopStack(p, pOp->p1); if( sqlite_malloc_failed ) goto no_mem; break; } @@ -2002,7 +948,7 @@ case OP_Concat: { } } if( nByte<0 ){ - if( pOp->p2==0 ) PopStack(p, nField); + if( pOp->p2==0 ) sqliteVdbePopStack(p, nField); p->tos++; aStack[p->tos].flags = STK_Null; zStack[p->tos] = 0; @@ -2022,7 +968,7 @@ case OP_Concat: { } } zNew[j] = 0; - if( pOp->p2==0 ) PopStack(p, nField); + if( pOp->p2==0 ) sqliteVdbePopStack(p, nField); p->tos++; aStack[p->tos].n = nByte; aStack[p->tos].flags = STK_Str|STK_Dyn; @@ -2142,7 +1088,7 @@ case OP_Remainder: { break; divide_by_zero: - PopStack(p, 2); + sqliteVdbePopStack(p, 2); p->tos = nos; aStack[nos].flags = STK_Null; break; @@ -2175,8 +1121,10 @@ case OP_Function: { ctx.z = 0; ctx.isError = 0; ctx.isStep = 0; + if( sqliteSafetyOff(db) ) goto abort_due_to_misuse; (*ctx.pFunc->xFunc)(&ctx, n, (const char**)&zStack[p->tos-n+1]); - PopStack(p, n); + if( sqliteSafetyOn(db) ) goto abort_due_to_misuse; + sqliteVdbePopStack(p, n); p->tos++; aStack[p->tos] = ctx.s; if( ctx.s.flags & STK_Dyn ){ @@ -2188,7 +1136,7 @@ case OP_Function: { } if( ctx.isError ){ sqliteSetString(&p->zErrMsg, - zStack[p->tos] ? zStack[p->tos] : "user function error", 0); + zStack[p->tos] ? zStack[p->tos] : "user function error", (char*)0); rc = SQLITE_ERROR; } break; @@ -2269,6 +1217,30 @@ case OP_AddImm: { break; } +/* Opcode: IsNumeric P1 P2 * +** +** Check the top of the stack to see if it is a numeric value. A numeric +** value is an integer, a real number, or a string that looks like an +** integer or a real number. When P1==0, pop the stack and jump to P2 +** if the value is numeric. Otherwise fall through and leave the stack +** unchanged. The sense of the test is inverted when P1==1. +*/ +case OP_IsNumeric: { + int tos = p->tos; + int r; + VERIFY( if( tos<0 ) goto not_enough_stack; ) + r = (aStack[tos].flags & (STK_Int|STK_Real))!=0 + || (zStack[tos] && sqliteIsNumber(zStack[tos])); + if( pOp->p1 ){ + r = !r; + } + if( r ){ + POPSTACK; + pc = pOp->p2 - 1; + } + break; +} + /* Opcode: MustBeInt P1 P2 * ** ** Force the top of the stack to be an integer. If the top of the @@ -2295,14 +1267,24 @@ case OP_MustBeInt: { }else if( aStack[tos].flags & STK_Str ){ int v; if( !toInt(zStack[tos], &v) ){ - goto mismatch; + double r; + if( !sqliteIsNumber(zStack[tos]) ){ + goto mismatch; + } + Realify(p, tos); + assert( (aStack[tos].flags & STK_Real)!=0 ); + v = aStack[tos].r; + r = (double)v; + if( r!=aStack[tos].r ){ + goto mismatch; + } } - p->aStack[tos].i = v; + aStack[tos].i = v; }else{ goto mismatch; } Release(p, tos); - p->aStack[tos].flags = STK_Int; + aStack[tos].flags = STK_Int; break; mismatch: @@ -2815,8 +1797,8 @@ case OP_IfNot: { /* Opcode: IsNull P1 P2 * ** ** If any of the top abs(P1) values on the stack are NULL, then jump -** to P2. The stack is popped P1 times if P1>0. If P1<0 then all values -** are left unchanged on the stack. +** to P2. Pop the stack P1 times if P1>0. If P1<0 leave the stack +** unchanged. */ case OP_IsNull: { int i, cnt; @@ -2829,20 +1811,24 @@ case OP_IsNull: { break; } } - if( pOp->p1>0 ) PopStack(p, cnt); + if( pOp->p1>0 ) sqliteVdbePopStack(p, cnt); break; } /* Opcode: NotNull P1 P2 * ** -** Jump to P2 if the top value on the stack is not NULL. Pop the -** stack if P1 is greater than zero. If P1 is less than or equal to -** zero then leave the value on the stack. +** Jump to P2 if the top P1 values on the stack are all not NULL. Pop the +** stack if P1 times if P1 is greater than zero. If P1 is less than +** zero then leave the stack unchanged. */ case OP_NotNull: { - VERIFY( if( p->tos<0 ) goto not_enough_stack; ) - if( (aStack[p->tos].flags & STK_Null)==0 ) pc = pOp->p2-1; - if( pOp->p1>0 ){ POPSTACK; } + int i, cnt; + cnt = pOp->p1; + if( cnt<0 ) cnt = -cnt; + VERIFY( if( p->tos+1-cnt<0 ) goto not_enough_stack; ) + for(i=0; i<cnt && (aStack[p->tos-i].flags & STK_Null)==0; i++){} + if( i>=cnt ) pc = pOp->p2-1; + if( pOp->p1>0 ) sqliteVdbePopStack(p, cnt); break; } @@ -2958,7 +1944,7 @@ case OP_MakeRecord: { j += aStack[i].n; } } - PopStack(p, nField); + sqliteVdbePopStack(p, nField); p->tos++; aStack[p->tos].n = nByte; if( nByte<=NBFS ){ @@ -2989,9 +1975,17 @@ case OP_MakeRecord: { ** back in its place. ** ** P3 is a string that is P1 characters long. Each character is either -** an 'n' or a 't' to indicates if the argument should be numeric or -** text. The first character corresponds to the lowest element on the -** stack. If P3 is NULL then all arguments are assumed to be numeric. +** an 'n' or a 't' to indicates if the argument should be intepreted as +** numeric or text type. The first character of P3 corresponds to the +** lowest element on the stack. If P3 is NULL then all arguments are +** assumed to be of the numeric type. +** +** The type makes a difference in that text-type fields may not be +** introduced by 'b' (as described in the next paragraph). The +** first character of a text-type field must be either 'a' (if it is NULL) +** or 'c'. Numeric fields will be introduced by 'b' if their content +** looks like a well-formed number. Otherwise the 'a' or 'c' will be +** used. ** ** The key is a concatenation of fields. Each field is terminated by ** a single 0x00 character. A NULL field is introduced by an 'a' and @@ -3003,7 +1997,7 @@ case OP_MakeRecord: { ** sqliteRealToSortable() function. A text field is introduced by a ** 'c' character and is followed by the exact text of the field. The ** use of an 'a', 'b', or 'c' character at the beginning of each field -** guarantees that NULL sort before numbers and that numbers sort +** guarantees that NULLs sort before numbers and that numbers sort ** before text. 0x00 characters do not occur except as separators ** between fields. ** @@ -3067,7 +2061,7 @@ case OP_MakeKey: { if( (flags & (STK_Real|STK_Int))==STK_Int ){ aStack[i].r = aStack[i].i; }else if( (flags & (STK_Real|STK_Int))==0 ){ - aStack[i].r = atof(zStack[i]); + aStack[i].r = sqliteAtoF(zStack[i]); } Release(p, i); z = aStack[i].z; @@ -3112,10 +2106,10 @@ case OP_MakeKey: { Integerify(p, p->tos-nField); iKey = intToKey(aStack[p->tos-nField].i); memcpy(&zNewKey[j], &iKey, sizeof(u32)); - PopStack(p, nField+1); + sqliteVdbePopStack(p, nField+1); if( pOp->p2 && containsNull ) pc = pOp->p2 - 1; }else{ - if( pOp->p2==0 ) PopStack(p, nField+addRowid); + if( pOp->p2==0 ) sqliteVdbePopStack(p, nField+addRowid); } p->tos++; aStack[p->tos].n = nByte; @@ -3206,7 +2200,7 @@ case OP_Transaction: { p->rc = SQLITE_BUSY; return SQLITE_BUSY; }else if( (*db->xBusyCallback)(db->pBusyArg, "", busy++)==0 ){ - sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0); busy = 0; } break; @@ -3344,7 +2338,7 @@ case OP_VerifyCookie: { assert( pOp->p1>=0 && pOp->p1<db->nDb ); rc = sqliteBtreeGetMeta(db->aDb[pOp->p1].pBt, aMeta); if( rc==SQLITE_OK && aMeta[1]!=pOp->p2 ){ - sqliteSetString(&p->zErrMsg, "database schema has changed", 0); + sqliteSetString(&p->zErrMsg, "database schema has changed", (char*)0); rc = SQLITE_SCHEMA; } break; @@ -3418,14 +2412,14 @@ case OP_OpenWrite: { p2 = p->aStack[tos].i; POPSTACK; if( p2<2 ){ - sqliteSetString(&p->zErrMsg, "root page number less than 2", 0); + sqliteSetString(&p->zErrMsg, "root page number less than 2", (char*)0); rc = SQLITE_INTERNAL; break; } } VERIFY( if( i<0 ) goto bad_instruction; ) if( expandCursorArraySize(p, i) ) goto no_mem; - cleanupCursor(&p->aCsr[i]); + sqliteVdbeCleanupCursor(&p->aCsr[i]); memset(&p->aCsr[i], 0, sizeof(Cursor)); p->aCsr[i].nullRow = 1; if( pX==0 ) break; @@ -3438,7 +2432,7 @@ case OP_OpenWrite: { p->rc = SQLITE_BUSY; return SQLITE_BUSY; }else if( (*db->xBusyCallback)(db->pBusyArg, pOp->p3, ++busy)==0 ){ - sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0); busy = 0; } break; @@ -3483,7 +2477,7 @@ case OP_OpenTemp: { VERIFY( if( i<0 ) goto bad_instruction; ) if( expandCursorArraySize(p, i) ) goto no_mem; pCx = &p->aCsr[i]; - cleanupCursor(pCx); + sqliteVdbeCleanupCursor(pCx); memset(pCx, 0, sizeof(*pCx)); pCx->nullRow = 1; rc = sqliteBtreeFactory(db, 0, 1, TEMP_PAGES, &pCx->pBt); @@ -3521,7 +2515,7 @@ case OP_OpenPseudo: { VERIFY( if( i<0 ) goto bad_instruction; ) if( expandCursorArraySize(p, i) ) goto no_mem; pCx = &p->aCsr[i]; - cleanupCursor(pCx); + sqliteVdbeCleanupCursor(pCx); memset(pCx, 0, sizeof(*pCx)); pCx->nullRow = 1; pCx->pseudoTable = 1; @@ -3536,7 +2530,7 @@ case OP_OpenPseudo: { case OP_Close: { int i = pOp->p1; if( i>=0 && i<p->nCursor ){ - cleanupCursor(&p->aCsr[i]); + sqliteVdbeCleanupCursor(&p->aCsr[i]); } break; } @@ -3573,8 +2567,15 @@ case OP_MoveTo: { pC = &p->aCsr[i]; if( pC->pCursor!=0 ){ int res, oc; + pC->nullRow = 0; if( aStack[tos].flags & STK_Int ){ int iKey = intToKey(aStack[tos].i); + if( pOp->p2==0 && pOp->opcode==OP_MoveTo ){ + pC->movetoTarget = iKey; + pC->deferredMoveto = 1; + POPSTACK; + break; + } sqliteBtreeMoveto(pC->pCursor, (char*)&iKey, sizeof(int), &res); pC->lastRecno = aStack[tos].i; pC->recnoIsValid = res==0; @@ -3583,7 +2584,7 @@ case OP_MoveTo: { sqliteBtreeMoveto(pC->pCursor, zStack[tos], aStack[tos].n, &res); pC->recnoIsValid = 0; } - pC->nullRow = 0; + pC->deferredMoveto = 0; sqlite_search_count++; oc = pOp->opcode; if( oc==OP_MoveTo && res<0 ){ @@ -3658,6 +2659,7 @@ case OP_Found: { Stringify(p, tos); rx = sqliteBtreeMoveto(pC->pCursor, zStack[tos], aStack[tos].n, &res); alreadyExists = rx==SQLITE_OK && res==0; + pC->deferredMoveto = 0; } if( pOp->opcode==OP_Found ){ if( alreadyExists ) pc = pOp->p2 - 1; @@ -3719,6 +2721,7 @@ case OP_IsUnique: { /* Search for an entry in P1 where all but the last four bytes match K. ** If there is no such entry, jump immediately to P2. */ + assert( p->aCsr[i].deferredMoveto==0 ); rc = sqliteBtreeMoveto(pCrsr, zKey, nKey-4, &res); if( rc!=SQLITE_OK ) goto abort_due_to_error; if( res<0 ){ @@ -3887,6 +2890,7 @@ case OP_NewRecno: { } } pC->recnoIsValid = 0; + pC->deferredMoveto = 0; } p->tos++; aStack[p->tos].i = v; @@ -3969,6 +2973,7 @@ case OP_PutStrKey: { zStack[tos], aStack[tos].n); } pC->recnoIsValid = 0; + pC->deferredMoveto = 0; } POPSTACK; POPSTACK; @@ -3995,6 +3000,7 @@ case OP_Delete: { assert( i>=0 && i<p->nCursor ); pC = &p->aCsr[i]; if( pC->pCursor!=0 ){ + sqliteVdbeCursorMoveto(pC); rc = sqliteBtreeDelete(pC->pCursor); pC->nextRowidValid = 0; } @@ -4025,6 +3031,16 @@ case OP_KeyAsData: { ** If the cursor is not pointing to a valid row, a NULL is pushed ** onto the stack. */ +/* Opcode: RowKey P1 * * +** +** Push onto the stack the complete row key for cursor P1. +** There is no interpretation of the key. It is just copied +** onto the stack exactly as it is found in the database file. +** +** If the cursor is not pointing to a valid row, a NULL is pushed +** onto the stack. +*/ +case OP_RowKey: case OP_RowData: { int i = pOp->p1; int tos = ++p->tos; @@ -4037,10 +3053,11 @@ case OP_RowData: { aStack[tos].flags = STK_Null; }else if( pC->pCursor!=0 ){ BtCursor *pCrsr = pC->pCursor; + sqliteVdbeCursorMoveto(pC); if( pC->nullRow ){ aStack[tos].flags = STK_Null; break; - }else if( pC->keyAsData ){ + }else if( pC->keyAsData || pOp->opcode==OP_RowKey ){ sqliteBtreeKeySize(pCrsr, &n); }else{ sqliteBtreeDataSize(pCrsr, &n); @@ -4055,7 +3072,7 @@ case OP_RowData: { aStack[tos].flags = STK_Str | STK_Dyn; zStack[tos] = z; } - if( pC->keyAsData ){ + if( pC->keyAsData || pOp->opcode==OP_RowKey ){ sqliteBtreeKey(pCrsr, 0, n, zStack[tos]); }else{ sqliteBtreeData(pCrsr, 0, n, zStack[tos]); @@ -4107,6 +3124,7 @@ case OP_Column: { zRec = zStack[tos+i]; payloadSize = aStack[tos+i].n; }else if( (pC = &p->aCsr[i])->pCursor!=0 ){ + sqliteVdbeCursorMoveto(pC); zRec = 0; pCrsr = pC->pCursor; if( pC->nullRow ){ @@ -4213,13 +3231,15 @@ case OP_Recno: { int v; assert( i>=0 && i<p->nCursor ); - if( (pC = &p->aCsr[i])->recnoIsValid ){ + pC = &p->aCsr[i]; + sqliteVdbeCursorMoveto(pC); + if( pC->recnoIsValid ){ v = pC->lastRecno; - }else if( pC->nullRow ){ - aStack[tos].flags = STK_Null; - break; }else if( pC->pseudoTable ){ v = keyToInt(pC->iKey); + }else if( pC->nullRow || pC->pCursor==0 ){ + aStack[tos].flags = STK_Null; + break; }else{ assert( pC->pCursor!=0 ); sqliteBtreeKey(pC->pCursor, 0, sizeof(u32), (char*)&v); @@ -4252,6 +3272,7 @@ case OP_FullKey: { int amt; char *z; + sqliteVdbeCursorMoveto(&p->aCsr[i]); sqliteBtreeKeySize(pCrsr, &amt); if( amt<=0 ){ rc = SQLITE_CORRUPT; @@ -4305,7 +3326,8 @@ case OP_Last: { if( (pCrsr = pC->pCursor)!=0 ){ int res; rc = sqliteBtreeLast(pCrsr, &res); - p->aCsr[i].nullRow = res; + pC->nullRow = res; + pC->deferredMoveto = 0; if( res && pOp->p2>0 ){ pc = pOp->p2 - 1; } @@ -4335,6 +3357,7 @@ case OP_Rewind: { rc = sqliteBtreeFirst(pCrsr, &res); pC->atFirst = res==0; pC->nullRow = res; + pC->deferredMoveto = 0; if( res && pOp->p2>0 ){ pc = pOp->p2 - 1; } @@ -4373,6 +3396,7 @@ case OP_Next: { if( pC->nullRow ){ res = 1; }else{ + assert( pC->deferredMoveto==0 ); rc = pOp->opcode==OP_Next ? sqliteBtreeNext(pCrsr, &res) : sqliteBtreePrevious(pCrsr, &res); pC->nullRow = res; @@ -4421,7 +3445,7 @@ case OP_IdxPut: { ){ rc = SQLITE_CONSTRAINT; if( pOp->p3 && pOp->p3[0] ){ - sqliteSetString(&p->zErrMsg, pOp->p3, 0); + sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0); } goto abort_due_to_error; } @@ -4434,6 +3458,7 @@ case OP_IdxPut: { } } rc = sqliteBtreeInsert(pCrsr, zKey, nKey, "", 0); + assert( p->aCsr[i].deferredMoveto==0 ); } POPSTACK; break; @@ -4455,6 +3480,7 @@ case OP_IdxDelete: { if( rx==SQLITE_OK && res==0 ){ rc = sqliteBtreeDelete(pCrsr); } + assert( p->aCsr[i].deferredMoveto==0 ); } POPSTACK; break; @@ -4477,6 +3503,7 @@ case OP_IdxRecno: { if( VERIFY( i>=0 && i<p->nCursor && ) (pCrsr = p->aCsr[i].pCursor)!=0 ){ int v; int sz; + assert( p->aCsr[i].deferredMoveto==0 ); sqliteBtreeKeySize(pCrsr, &sz); if( sz<sizeof(u32) ){ aStack[tos].flags = STK_Null; @@ -4526,6 +3553,7 @@ case OP_IdxGE: { int res, rc; Stringify(p, tos); + assert( p->aCsr[i].deferredMoveto==0 ); rc = sqliteBtreeKeyCompare(pCrsr, zStack[tos], aStack[tos].n, 4, &res); if( rc!=SQLITE_OK ){ break; @@ -4543,6 +3571,37 @@ case OP_IdxGE: { break; } +/* Opcode: IdxIsNull P1 P2 * +** +** The top of the stack contains an index entry such as might be generated +** by the MakeIdxKey opcode. This routine looks at the first P1 fields of +** that key. If any of the first P1 fields are NULL, then a jump is made +** to address P2. Otherwise we fall straight through. +** +** The index entry is always popped from the stack. +*/ +case OP_IdxIsNull: { + int i = pOp->p1; + int tos = p->tos; + int k, n; + const char *z; + + assert( tos>=0 ); + assert( aStack[tos].flags & STK_Str ); + z = zStack[tos]; + n = aStack[tos].n; + for(k=0; k<n && i>0; i--){ + if( z[k]=='a' ){ + pc = pOp->p2-1; + break; + } + while( k<n && z[k] ){ k++; } + k++; + } + POPSTACK; + break; +} + /* Opcode: Destroy P1 P2 * ** ** Delete an entire database table or index whose root page in the database @@ -4629,7 +3688,9 @@ case OP_CreateTable: { ** If there are no errors, push a "ok" onto the stack. ** ** P1 is the index of a set that contains the root page numbers -** for all tables and indices in the main database file. +** for all tables and indices in the main database file. The set +** is cleared by this opcode. In other words, after this opcode +** has executed, the set will be empty. ** ** If P2 is not zero, the check is done on the auxiliary database ** file, not the main database file. @@ -4655,6 +3716,8 @@ case OP_IntegrityCk: { toInt((char*)sqliteHashKey(i), &aRoot[j]); } aRoot[j] = 0; + sqliteHashClear(&pSet->hash); + pSet->prev = 0; z = sqliteBtreeIntegrityCheck(db->aDb[pOp->p2].pBt, aRoot, nRoot); if( z==0 || z[0]==0 ){ if( z ) sqliteFree(z); @@ -4740,7 +3803,7 @@ case OP_ListRead: { */ case OP_ListReset: { if( p->pList ){ - KeylistFree(p->pList); + sqliteVdbeKeylistFree(p->pList); p->pList = 0; } break; @@ -4770,7 +3833,7 @@ case OP_ListPush: { case OP_ListPop: { assert(p->keylistStackDepth > 0); p->keylistStackDepth--; - KeylistFree(p->pList); + sqliteVdbeKeylistFree(p->pList); p->pList = p->keylistStack[p->keylistStackDepth]; p->keylistStack[p->keylistStackDepth] = 0; if( p->keylistStackDepth == 0 ){ @@ -4848,7 +3911,7 @@ case OP_SortMakeRec: { z += aStack[i].n; } } - PopStack(p, nField); + sqliteVdbePopStack(p, nField); p->tos++; aStack[p->tos].n = nByte; zStack[p->tos] = (char*)azArg; @@ -4906,7 +3969,7 @@ case OP_SortMakeKey: { } zNewKey[j] = 0; assert( j<nByte ); - PopStack(p, nField); + sqliteVdbePopStack(p, nField); p->tos++; aStack[p->tos].n = nByte; aStack[p->tos].flags = STK_Str|STK_Dyn; @@ -5009,7 +4072,7 @@ case OP_SortCallback: { ** Remove any elements that remain on the sorter. */ case OP_SortReset: { - SorterReset(p); + sqliteVdbeSorterReset(p); break; } @@ -5030,7 +4093,7 @@ case OP_FileOpen: { p->pFile = fopen(pOp->p3, "r"); } if( p->pFile==0 ){ - sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, 0); + sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, (char*)0); rc = SQLITE_ERROR; } break; @@ -5118,7 +4181,17 @@ case OP_FileRead: { } while( z[from] ){ if( z[from]=='\\' && z[from+1]!=0 ){ - z[to++] = z[from+1]; + int tx = z[from+1]; + switch( tx ){ + case 'b': tx = '\b'; break; + case 'f': tx = '\f'; break; + case 'n': tx = '\n'; break; + case 'r': tx = '\r'; break; + case 't': tx = '\t'; break; + case 'v': tx = '\v'; break; + default: break; + } + z[to++] = tx; from += 2; continue; } @@ -5289,7 +4362,7 @@ case OP_MemIncr: { ** Future aggregator elements will contain P2 values each. */ case OP_AggReset: { - AggReset(&p->agg); + sqliteVdbeAggReset(&p->agg); p->agg.nMem = pOp->p2; p->agg.apFunc = sqliteMalloc( p->agg.nMem*sizeof(p->agg.apFunc[0]) ); if( p->agg.apFunc==0 ) goto no_mem; @@ -5348,7 +4421,7 @@ case OP_AggFunc: { (ctx.pFunc->xStep)(&ctx, n, (const char**)&zStack[p->tos-n]); pMem->z = ctx.pAgg; pMem->s.flags = STK_AggCtx; - PopStack(p, n+1); + sqliteVdbePopStack(p, n+1); if( ctx.isError ){ rc = SQLITE_ERROR; } @@ -5614,11 +4687,24 @@ case OP_SetNext: { break; } +/* Opcode: Vacuum * * * +** +** Vacuum the entire database. This opcode will cause other virtual +** machines to be created and run. It may not be called from within +** a transaction. +*/ +case OP_Vacuum: { + if( sqliteSafetyOff(db) ) goto abort_due_to_misuse; + rc = sqliteRunVacuum(&p->zErrMsg, db); + if( sqliteSafetyOn(db) ) goto abort_due_to_misuse; + break; +} + /* An other opcode is illegal... */ default: { - sprintf(zBuf,"%d",pOp->opcode); - sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, 0); + sqlite_snprintf(sizeof(zBuf),zBuf,"%d",pOp->opcode); + sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, (char*)0); rc = SQLITE_INTERNAL; break; } @@ -5638,7 +4724,7 @@ default: { pOp->cnt++; #if 0 fprintf(stdout, "%10lld ", elapse); - vdbePrintOp(stdout, origPc, &p->aOp[origPc]); + sqliteVdbePrintOp(stdout, origPc, &p->aOp[origPc]); #endif } #endif @@ -5650,7 +4736,7 @@ default: { */ #ifndef NDEBUG if( pc<-1 || pc>=p->nOp ){ - sqliteSetString(&p->zErrMsg, "jump destination out of range", 0); + sqliteSetString(&p->zErrMsg, "jump destination out of range", (char*)0); rc = SQLITE_INTERNAL; } if( p->trace && p->tos>=0 ){ @@ -5721,7 +4807,7 @@ vdbe_halt: ** to fail on a modern VM computer, so this code is untested. */ no_mem: - sqliteSetString(&p->zErrMsg, "out of memory", 0); + sqliteSetString(&p->zErrMsg, "out of memory", (char*)0); rc = SQLITE_NOMEM; goto vdbe_halt; @@ -5736,7 +4822,7 @@ abort_due_to_misuse: */ abort_due_to_error: if( p->zErrMsg==0 ){ - sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0); } goto vdbe_halt; @@ -5751,15 +4837,15 @@ abort_due_to_interrupt: }else{ rc = SQLITE_INTERRUPT; } - sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0); + sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0); goto vdbe_halt; /* Jump to here if a operator is encountered that requires more stack ** operands than are currently available on the stack. */ not_enough_stack: - sprintf(zBuf,"%d",pc); - sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, 0); + sqlite_snprintf(sizeof(zBuf),zBuf,"%d",pc); + sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, (char*)0); rc = SQLITE_INTERNAL; goto vdbe_halt; @@ -5767,98 +4853,9 @@ not_enough_stack: */ VERIFY( bad_instruction: - sprintf(zBuf,"%d",pc); - sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, 0); + sqlite_snprintf(sizeof(zBuf),zBuf,"%d",pc); + sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, (char*)0); rc = SQLITE_INTERNAL; goto vdbe_halt; ) } - - -/* -** Clean up the VDBE after execution. Return an integer which is the -** result code. -*/ -int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){ - sqlite *db = p->db; - int i, rc; - - if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){ - sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0); - return SQLITE_MISUSE; - } - if( p->zErrMsg ){ - if( pzErrMsg && *pzErrMsg==0 ){ - *pzErrMsg = p->zErrMsg; - }else{ - sqliteFree(p->zErrMsg); - } - p->zErrMsg = 0; - } - Cleanup(p); - if( p->rc!=SQLITE_OK ){ - switch( p->errorAction ){ - case OE_Abort: { - if( !p->undoTransOnError ){ - for(i=0; i<db->nDb; i++){ - if( db->aDb[i].pBt ){ - sqliteBtreeRollbackCkpt(db->aDb[i].pBt); - } - } - break; - } - /* Fall through to ROLLBACK */ - } - case OE_Rollback: { - sqliteRollbackAll(db); - db->flags &= ~SQLITE_InTrans; - db->onError = OE_Default; - break; - } - default: { - if( p->undoTransOnError ){ - sqliteRollbackAll(db); - db->flags &= ~SQLITE_InTrans; - db->onError = OE_Default; - } - break; - } - } - sqliteRollbackInternalChanges(db); - } - for(i=0; i<db->nDb; i++){ - if( db->aDb[i].pBt && db->aDb[i].inTrans==2 ){ - sqliteBtreeCommitCkpt(db->aDb[i].pBt); - db->aDb[i].inTrans = 1; - } - } - assert( p->tos<p->pc || sqlite_malloc_failed==1 ); -#ifdef VDBE_PROFILE - { - FILE *out = fopen("vdbe_profile.out", "a"); - if( out ){ - int i; - fprintf(out, "---- "); - for(i=0; i<p->nOp; i++){ - fprintf(out, "%02x", p->aOp[i].opcode); - } - fprintf(out, "\n"); - for(i=0; i<p->nOp; i++){ - fprintf(out, "%6d %10lld %8lld ", - p->aOp[i].cnt, - p->aOp[i].cycles, - p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0 - ); - vdbePrintOp(out, i, &p->aOp[i]); - } - fclose(out); - } - } -#endif - rc = p->rc; - sqliteVdbeDelete(p); - if( db->want_to_close && db->pVdbe==0 ){ - sqlite_close(db); - } - return rc; -} diff --git a/ext/sqlite/libsqlite/src/vdbe.h b/ext/sqlite/libsqlite/src/vdbe.h index fa8ad54d4a..d56fe49014 100644 --- a/ext/sqlite/libsqlite/src/vdbe.h +++ b/ext/sqlite/libsqlite/src/vdbe.h @@ -84,7 +84,7 @@ int sqliteVdbeFindOp(Vdbe*, int, int); VdbeOp *sqliteVdbeGetOp(Vdbe*, int); int sqliteVdbeMakeLabel(Vdbe*); void sqliteVdbeDelete(Vdbe*); -void sqliteVdbeMakeReady(Vdbe*,sqlite_callback,void*,int); +void sqliteVdbeMakeReady(Vdbe*,int,sqlite_callback,void*,int); int sqliteVdbeExec(Vdbe*); int sqliteVdbeList(Vdbe*); int sqliteVdbeFinalize(Vdbe*,char**); @@ -92,5 +92,7 @@ void sqliteVdbeResolveLabel(Vdbe*, int); int sqliteVdbeCurrentAddr(Vdbe*); void sqliteVdbeTrace(Vdbe*,FILE*); void sqliteVdbeCompressSpace(Vdbe*,int); +int sqliteVdbeReset(Vdbe*,char **); +int sqliteVdbeSetVariables(Vdbe*,int,const char**); #endif diff --git a/ext/sqlite/libsqlite/src/where.c b/ext/sqlite/libsqlite/src/where.c index 7f95dc78c3..11358e413c 100644 --- a/ext/sqlite/libsqlite/src/where.c +++ b/ext/sqlite/libsqlite/src/where.c @@ -25,8 +25,6 @@ typedef struct ExprInfo ExprInfo; struct ExprInfo { Expr *p; /* Pointer to the subexpression */ u8 indexable; /* True if this subexprssion is usable by an index */ - u8 oracle8join; /* -1 if left side contains "(+)". +1 if right side - ** contains "(+)". 0 if neither contains "(+)" */ short int idxLeft; /* p->pLeft is a column in this table number. -1 if ** p->pLeft is not the column of any table */ short int idxRight; /* p->pRight is a column in this table number. -1 if @@ -358,7 +356,7 @@ WhereInfo *sqliteWhereBegin( int i; /* Loop counter */ WhereInfo *pWInfo; /* Will become the return value of this function */ Vdbe *v = pParse->pVdbe; /* The virtual database engine */ - int brk, cont; /* Addresses used during code generation */ + int brk, cont = 0; /* Addresses used during code generation */ int nExpr; /* Number of subexpressions in the WHERE clause */ int loopMask; /* One bit set for each outer loop */ int haveKey; /* True if KEY is on the stack */ @@ -385,7 +383,7 @@ WhereInfo *sqliteWhereBegin( char zBuf[50]; sprintf(zBuf, "%d", (int)ARRAYSIZE(aExpr)-1); sqliteSetString(&pParse->zErrMsg, "WHERE clause too complex - no more " - "than ", zBuf, " terms allowed", 0); + "than ", zBuf, " terms allowed", (char*)0); pParse->nErr++; return 0; } @@ -800,6 +798,9 @@ WhereInfo *sqliteWhereBegin( } pLevel->iMem = pParse->nMem++; cont = pLevel->cont = sqliteVdbeMakeLabel(v); + sqliteVdbeAddOp(v, OP_NotNull, -nColumn, sqliteVdbeCurrentAddr(v)+3); + sqliteVdbeAddOp(v, OP_Pop, nColumn, 0); + sqliteVdbeAddOp(v, OP_Goto, 0, brk); sqliteVdbeAddOp(v, OP_MakeKey, nColumn, 0); sqliteAddIdxKeyType(v, pIdx); if( nColumn==pIdx->nColumn || pLevel->bRev ){ @@ -817,16 +818,17 @@ WhereInfo *sqliteWhereBegin( sqliteVdbeAddOp(v, OP_MoveLt, pLevel->iCur, brk); start = sqliteVdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); sqliteVdbeAddOp(v, OP_IdxLT, pLevel->iCur, brk); - sqliteVdbeAddOp(v, OP_IdxRecno, pLevel->iCur, 0); pLevel->op = OP_Prev; }else{ /* Scan in the forward order */ sqliteVdbeAddOp(v, OP_MoveTo, pLevel->iCur, brk); start = sqliteVdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); sqliteVdbeAddOp(v, testOp, pLevel->iCur, brk); - sqliteVdbeAddOp(v, OP_IdxRecno, pLevel->iCur, 0); pLevel->op = OP_Next; } + sqliteVdbeAddOp(v, OP_RowKey, pLevel->iCur, 0); + sqliteVdbeAddOp(v, OP_IdxIsNull, nColumn, cont); + sqliteVdbeAddOp(v, OP_IdxRecno, pLevel->iCur, 0); if( i==pTabList->nSrc-1 && pushKey ){ haveKey = 1; }else{ @@ -853,7 +855,7 @@ WhereInfo *sqliteWhereBegin( }else{ sqliteExprCode(pParse, aExpr[k].p->pLeft); } - sqliteVdbeAddOp(v, OP_MustBeInt, 1, brk); + sqliteVdbeAddOp(v, OP_IsNumeric, 1, brk); if( aExpr[k].p->op==TK_LT || aExpr[k].p->op==TK_GT ){ sqliteVdbeAddOp(v, OP_AddImm, 1, 0); } @@ -872,9 +874,9 @@ WhereInfo *sqliteWhereBegin( }else{ sqliteExprCode(pParse, aExpr[k].p->pLeft); } - sqliteVdbeAddOp(v, OP_MustBeInt, 1, sqliteVdbeCurrentAddr(v)+1); + /* sqliteVdbeAddOp(v, OP_MustBeInt, 0, sqliteVdbeCurrentAddr(v)+1); */ pLevel->iMem = pParse->nMem++; - sqliteVdbeAddOp(v, OP_MemStore, pLevel->iMem, 0); + sqliteVdbeAddOp(v, OP_MemStore, pLevel->iMem, 1); if( aExpr[k].p->op==TK_LT || aExpr[k].p->op==TK_GT ){ testOp = OP_Ge; }else{ @@ -1001,8 +1003,12 @@ WhereInfo *sqliteWhereBegin( leFlag = 1; } if( testOp!=OP_Noop ){ + int nCol = nEqColumn + (score & 1); pLevel->iMem = pParse->nMem++; - sqliteVdbeAddOp(v, OP_MakeKey, nEqColumn + (score & 1), 0); + sqliteVdbeAddOp(v, OP_NotNull, -nCol, sqliteVdbeCurrentAddr(v)+3); + sqliteVdbeAddOp(v, OP_Pop, nCol, 0); + sqliteVdbeAddOp(v, OP_Goto, 0, brk); + sqliteVdbeAddOp(v, OP_MakeKey, nCol, 0); sqliteAddIdxKeyType(v, pIdx); if( leFlag ){ sqliteVdbeAddOp(v, OP_IncrKey, 0, 0); @@ -1054,7 +1060,11 @@ WhereInfo *sqliteWhereBegin( geFlag = 1; } if( nEqColumn>0 || (score&2)!=0 ){ - sqliteVdbeAddOp(v, OP_MakeKey, nEqColumn + ((score&2)!=0), 0); + int nCol = nEqColumn + ((score&2)!=0); + sqliteVdbeAddOp(v, OP_NotNull, -nCol, sqliteVdbeCurrentAddr(v)+3); + sqliteVdbeAddOp(v, OP_Pop, nCol, 0); + sqliteVdbeAddOp(v, OP_Goto, 0, brk); + sqliteVdbeAddOp(v, OP_MakeKey, nCol, 0); sqliteAddIdxKeyType(v, pIdx); if( !geFlag ){ sqliteVdbeAddOp(v, OP_IncrKey, 0, 0); @@ -1081,6 +1091,8 @@ WhereInfo *sqliteWhereBegin( sqliteVdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0); sqliteVdbeAddOp(v, testOp, pLevel->iCur, brk); } + sqliteVdbeAddOp(v, OP_RowKey, pLevel->iCur, 0); + sqliteVdbeAddOp(v, OP_IdxIsNull, nEqColumn + (score & 1), cont); sqliteVdbeAddOp(v, OP_IdxRecno, pLevel->iCur, 0); if( i==pTabList->nSrc-1 && pushKey ){ haveKey = 1; |