|
|
|
@ -3121,7 +3121,7 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*);
|
|
|
|
|
/************** Begin file parse.h *******************************************/
|
|
|
|
|
#define TK_SEMI 1
|
|
|
|
|
#define TK_EXPLAIN 2
|
|
|
|
|
#define TK_TQUERY 3
|
|
|
|
|
#define TK_QUERY 3
|
|
|
|
|
#define TK_PLAN 4
|
|
|
|
|
#define TK_BEGIN 5
|
|
|
|
|
#define TK_TRANSACTION 6
|
|
|
|
@ -3212,7 +3212,7 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*);
|
|
|
|
|
#define TK_DEFAULT 91
|
|
|
|
|
#define TK_NULL 92
|
|
|
|
|
#define TK_PRIMARY 93
|
|
|
|
|
#define TK_UNITQUE 94
|
|
|
|
|
#define TK_UNIQUE 94
|
|
|
|
|
#define TK_CHECK 95
|
|
|
|
|
#define TK_REFERENCES 96
|
|
|
|
|
#define TK_AUTOINCR 97
|
|
|
|
@ -3314,16 +3314,16 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*);
|
|
|
|
|
/*
|
|
|
|
|
** If the following macro is set to 1, then NULL values are considered
|
|
|
|
|
** distinct when determining whether or not two entries are the same
|
|
|
|
|
** in a UNITQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL,
|
|
|
|
|
** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL,
|
|
|
|
|
** OCELOT, and Firebird all work. The SQL92 spec explicitly says this
|
|
|
|
|
** is the way things are suppose to work.
|
|
|
|
|
**
|
|
|
|
|
** If the following macro is set to 0, the NULLs are indistinct for
|
|
|
|
|
** a UNITQUE index. In this mode, you can only have a single NULL entry
|
|
|
|
|
** for a column declared UNITQUE. This is the way Informix and SQL Server
|
|
|
|
|
** a UNIQUE index. In this mode, you can only have a single NULL entry
|
|
|
|
|
** for a column declared UNIQUE. This is the way Informix and SQL Server
|
|
|
|
|
** work.
|
|
|
|
|
*/
|
|
|
|
|
#define NULL_DISTINCT_FOR_UNITQUE 1
|
|
|
|
|
#define NULL_DISTINCT_FOR_UNIQUE 1
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** The "file format" number is an integer that is incremented whenever
|
|
|
|
@ -3952,7 +3952,7 @@ typedef struct PgHdr DbPage;
|
|
|
|
|
/*
|
|
|
|
|
** Valid values for the second argument to sqlite3PagerLockingMode().
|
|
|
|
|
*/
|
|
|
|
|
#define PAGER_LOCKINGMODE_TQUERY -1
|
|
|
|
|
#define PAGER_LOCKINGMODE_QUERY -1
|
|
|
|
|
#define PAGER_LOCKINGMODE_NORMAL 0
|
|
|
|
|
#define PAGER_LOCKINGMODE_EXCLUSIVE 1
|
|
|
|
|
|
|
|
|
@ -5176,7 +5176,7 @@ struct FKey {
|
|
|
|
|
** occurs. IGNORE means that the particular row that caused the constraint
|
|
|
|
|
** error is not inserted or updated. Processing continues and no error
|
|
|
|
|
** is returned. REPLACE means that preexisting database rows that caused
|
|
|
|
|
** a UNITQUE constraint violation are removed so that the new insert or
|
|
|
|
|
** a UNIQUE constraint violation are removed so that the new insert or
|
|
|
|
|
** update can proceed. Processing continues and no error is reported.
|
|
|
|
|
**
|
|
|
|
|
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
|
|
|
|
@ -5255,7 +5255,7 @@ struct Index {
|
|
|
|
|
Table *pTable; /* The SQL table being indexed */
|
|
|
|
|
int tnum; /* Page containing root of this index in database file */
|
|
|
|
|
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
|
|
|
|
|
u8 autoIndex; /* True if is automatically created (ex: by UNITQUE) */
|
|
|
|
|
u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */
|
|
|
|
|
char *zColAff; /* String defining the affinity of each column */
|
|
|
|
|
Index *pNext; /* The next index associated with the same table */
|
|
|
|
|
Schema *pSchema; /* Schema containing this index */
|
|
|
|
@ -22280,8 +22280,8 @@ SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** Get/set the locking-mode for this pager. Parameter eMode must be one
|
|
|
|
|
** of PAGER_LOCKINGMODE_TQUERY, PAGER_LOCKINGMODE_NORMAL or
|
|
|
|
|
** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _TQUERY, then
|
|
|
|
|
** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or
|
|
|
|
|
** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then
|
|
|
|
|
** the locking-mode is set to the value specified.
|
|
|
|
|
**
|
|
|
|
|
** The returned value is either PAGER_LOCKINGMODE_NORMAL or
|
|
|
|
@ -22289,10 +22289,10 @@ SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){
|
|
|
|
|
** locking-mode.
|
|
|
|
|
*/
|
|
|
|
|
SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){
|
|
|
|
|
assert( eMode==PAGER_LOCKINGMODE_TQUERY
|
|
|
|
|
assert( eMode==PAGER_LOCKINGMODE_QUERY
|
|
|
|
|
|| eMode==PAGER_LOCKINGMODE_NORMAL
|
|
|
|
|
|| eMode==PAGER_LOCKINGMODE_EXCLUSIVE );
|
|
|
|
|
assert( PAGER_LOCKINGMODE_TQUERY<0 );
|
|
|
|
|
assert( PAGER_LOCKINGMODE_QUERY<0 );
|
|
|
|
|
assert( PAGER_LOCKINGMODE_NORMAL>=0 && PAGER_LOCKINGMODE_EXCLUSIVE>=0 );
|
|
|
|
|
if( eMode>=0 && !pPager->tempFile ){
|
|
|
|
|
pPager->exclusiveMode = eMode;
|
|
|
|
@ -22753,7 +22753,7 @@ struct BtCursor {
|
|
|
|
|
** because the table is empty or because BtreeCursorFirst() has not been
|
|
|
|
|
** called.
|
|
|
|
|
**
|
|
|
|
|
** CURSOR_RETQUIRESEEK:
|
|
|
|
|
** CURSOR_REQUIRESEEK:
|
|
|
|
|
** The table that this cursor was opened on still exists, but has been
|
|
|
|
|
** modified since the cursor was last used. The cursor position is saved
|
|
|
|
|
** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in
|
|
|
|
@ -22762,7 +22762,7 @@ struct BtCursor {
|
|
|
|
|
*/
|
|
|
|
|
#define CURSOR_INVALID 0
|
|
|
|
|
#define CURSOR_VALID 1
|
|
|
|
|
#define CURSOR_RETQUIRESEEK 2
|
|
|
|
|
#define CURSOR_REQUIRESEEK 2
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** The TRACE macro will print high-level status information about the
|
|
|
|
@ -23136,7 +23136,7 @@ static void invalidateAllOverflowCache(BtShared *pBt){
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** Save the current cursor position in the variables BtCursor.nKey
|
|
|
|
|
** and BtCursor.pKey. The cursor's state is set to CURSOR_RETQUIRESEEK.
|
|
|
|
|
** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK.
|
|
|
|
|
*/
|
|
|
|
|
static int saveCursorPosition(BtCursor *pCur){
|
|
|
|
|
int rc;
|
|
|
|
@ -23170,7 +23170,7 @@ static int saveCursorPosition(BtCursor *pCur){
|
|
|
|
|
if( rc==SQLITE_OK ){
|
|
|
|
|
releasePage(pCur->pPage);
|
|
|
|
|
pCur->pPage = 0;
|
|
|
|
|
pCur->eState = CURSOR_RETQUIRESEEK;
|
|
|
|
|
pCur->eState = CURSOR_REQUIRESEEK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
invalidateOverflowCache(pCur);
|
|
|
|
@ -23218,7 +23218,7 @@ static void clearCursorPosition(BtCursor *pCur){
|
|
|
|
|
*/
|
|
|
|
|
SQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur){
|
|
|
|
|
int rc;
|
|
|
|
|
assert( pCur->eState==CURSOR_RETQUIRESEEK );
|
|
|
|
|
assert( pCur->eState==CURSOR_REQUIRESEEK );
|
|
|
|
|
#ifndef SQLITE_OMIT_INCRBLOB
|
|
|
|
|
if( pCur->isIncrblobHandle ){
|
|
|
|
|
return SQLITE_ABORT;
|
|
|
|
@ -23235,7 +23235,7 @@ SQLITE_PRIVATE int sqlite3BtreeRestoreOrClearCursorPosition(BtCursor *pCur){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define restoreOrClearCursorPosition(p) \
|
|
|
|
|
(p->eState==CURSOR_RETQUIRESEEK ? \
|
|
|
|
|
(p->eState==CURSOR_REQUIRESEEK ? \
|
|
|
|
|
sqlite3BtreeRestoreOrClearCursorPosition(p) : \
|
|
|
|
|
SQLITE_OK)
|
|
|
|
|
|
|
|
|
@ -25952,7 +25952,7 @@ static int moveToRoot(BtCursor *pCur){
|
|
|
|
|
int rc = SQLITE_OK;
|
|
|
|
|
BtShared *pBt = pCur->pBtree->pBt;
|
|
|
|
|
|
|
|
|
|
if( pCur->eState==CURSOR_RETQUIRESEEK ){
|
|
|
|
|
if( pCur->eState==CURSOR_REQUIRESEEK ){
|
|
|
|
|
clearCursorPosition(pCur);
|
|
|
|
|
}
|
|
|
|
|
pRoot = pCur->pPage;
|
|
|
|
@ -26214,7 +26214,7 @@ SQLITE_PRIVATE int sqlite3BtreeMoveto(
|
|
|
|
|
** the first entry. TRUE is also returned if the table is empty.
|
|
|
|
|
*/
|
|
|
|
|
SQLITE_PRIVATE int sqlite3BtreeEof(BtCursor *pCur){
|
|
|
|
|
/* TODO: What if the cursor is in CURSOR_RETQUIRESEEK but all table entries
|
|
|
|
|
/* TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries
|
|
|
|
|
** have been deleted? This API will need to change to return an error code
|
|
|
|
|
** as well as the boolean result value.
|
|
|
|
|
*/
|
|
|
|
@ -27107,7 +27107,7 @@ static void assemblePage(
|
|
|
|
|
/* Forward reference */
|
|
|
|
|
static int balance(MemPage*, int);
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_TQUICKBALANCE
|
|
|
|
|
#ifndef SQLITE_OMIT_QUICKBALANCE
|
|
|
|
|
/*
|
|
|
|
|
** This version of balance() handles the common special case where
|
|
|
|
|
** a new entry is being inserted on the extreme right-end of the
|
|
|
|
@ -27196,7 +27196,7 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
|
|
|
|
|
releasePage(pNew);
|
|
|
|
|
return balance(pParent, 0);
|
|
|
|
|
}
|
|
|
|
|
#endif /* SQLITE_OMIT_TQUICKBALANCE */
|
|
|
|
|
#endif /* SQLITE_OMIT_QUICKBALANCE */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** This routine redistributes Cells on pPage and up to NN*2 siblings
|
|
|
|
@ -27274,7 +27274,7 @@ static int balance_nonroot(MemPage *pPage){
|
|
|
|
|
}
|
|
|
|
|
TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno));
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_TQUICKBALANCE
|
|
|
|
|
#ifndef SQLITE_OMIT_QUICKBALANCE
|
|
|
|
|
/*
|
|
|
|
|
** A special case: If a new entry has just been inserted into a
|
|
|
|
|
** table (that is, a btree with integer keys and all data at the leaves)
|
|
|
|
@ -28133,7 +28133,7 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Restore the current cursor position (a no-op if the cursor is not in
|
|
|
|
|
** CURSOR_RETQUIRESEEK state) and save the positions of any other cursors
|
|
|
|
|
** CURSOR_REQUIRESEEK state) and save the positions of any other cursors
|
|
|
|
|
** open on the same table. Then call sqlite3PagerWrite() on the page
|
|
|
|
|
** that the entry will be deleted from.
|
|
|
|
|
*/
|
|
|
|
@ -28626,7 +28626,7 @@ SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
|
|
|
|
|
** is currently pointing to.
|
|
|
|
|
*/
|
|
|
|
|
SQLITE_PRIVATE int sqlite3BtreeFlags(BtCursor *pCur){
|
|
|
|
|
/* TODO: What about CURSOR_RETQUIRESEEK state? Probably need to call
|
|
|
|
|
/* TODO: What about CURSOR_REQUIRESEEK state? Probably need to call
|
|
|
|
|
** restoreOrClearCursorPosition() here.
|
|
|
|
|
*/
|
|
|
|
|
MemPage *pPage = pCur->pPage;
|
|
|
|
@ -29246,7 +29246,7 @@ SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
|
|
|
|
|
SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
|
|
|
|
|
|
|
|
|
|
assert(pCsr->isIncrblobHandle);
|
|
|
|
|
if( pCsr->eState==CURSOR_RETQUIRESEEK ){
|
|
|
|
|
if( pCsr->eState==CURSOR_REQUIRESEEK ){
|
|
|
|
|
return SQLITE_ABORT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -35357,7 +35357,7 @@ case OP_BitNot: { /* same as TK_BITNOT, no-push */
|
|
|
|
|
*/
|
|
|
|
|
/*
|
|
|
|
|
** The magic Explain opcode are only inserted when explain==2 (which
|
|
|
|
|
** is to say when the EXPLAIN TQUERY PLAN syntax is used.)
|
|
|
|
|
** is to say when the EXPLAIN QUERY PLAN syntax is used.)
|
|
|
|
|
** This opcode records information from the optimizer. It is the
|
|
|
|
|
** the same as a no-op. This opcodesnever appears in a real VM program.
|
|
|
|
|
*/
|
|
|
|
@ -36698,7 +36698,7 @@ case OP_IsUnique: { /* no-push */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The final varint of the key is different from R. Push it onto
|
|
|
|
|
** the stack. (The record number of an entry that violates a UNITQUE
|
|
|
|
|
** the stack. (The record number of an entry that violates a UNIQUE
|
|
|
|
|
** constraint.)
|
|
|
|
|
*/
|
|
|
|
|
pTos++;
|
|
|
|
@ -39594,7 +39594,7 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(ExprList *p){
|
|
|
|
|
** called with a NULL argument.
|
|
|
|
|
*/
|
|
|
|
|
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) \
|
|
|
|
|
|| !defined(SQLITE_OMIT_SUBTQUERY)
|
|
|
|
|
|| !defined(SQLITE_OMIT_SUBQUERY)
|
|
|
|
|
SQLITE_PRIVATE SrcList *sqlite3SrcListDup(SrcList *p){
|
|
|
|
|
SrcList *pNew;
|
|
|
|
|
int i;
|
|
|
|
@ -39909,7 +39909,7 @@ static int exprNodeIsConstant(void *pArg, Expr *pExpr){
|
|
|
|
|
case TK_DOT:
|
|
|
|
|
case TK_AGG_FUNCTION:
|
|
|
|
|
case TK_AGG_COLUMN:
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
case TK_SELECT:
|
|
|
|
|
case TK_EXISTS:
|
|
|
|
|
#endif
|
|
|
|
@ -40446,7 +40446,7 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
|
|
|
|
|
*/
|
|
|
|
|
return is_agg;
|
|
|
|
|
}
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
case TK_SELECT:
|
|
|
|
|
case TK_EXISTS:
|
|
|
|
|
#endif
|
|
|
|
@ -40555,7 +40555,7 @@ struct QueryCoder {
|
|
|
|
|
** The pExpr parameter describes the expression that contains the IN
|
|
|
|
|
** operator or subquery.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
|
|
|
|
int testAddr = 0; /* One-time test address */
|
|
|
|
|
Vdbe *v = sqlite3GetVdbe(pParse);
|
|
|
|
@ -40702,7 +40702,7 @@ SQLITE_PRIVATE void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#endif /* SQLITE_OMIT_SUBTQUERY */
|
|
|
|
|
#endif /* SQLITE_OMIT_SUBQUERY */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** Generate an instruction that will put the integer describe by
|
|
|
|
@ -40997,7 +40997,7 @@ SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
|
|
|
|
|
stackChng = 1-nExpr;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
case TK_EXISTS:
|
|
|
|
|
case TK_SELECT: {
|
|
|
|
|
if( pExpr->iColumn==0 ){
|
|
|
|
@ -41888,7 +41888,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_TRIGGER
|
|
|
|
|
/* Now, if the table is not stored in the temp database, reload any temp
|
|
|
|
|
** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBTQUERY is defined.
|
|
|
|
|
** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined.
|
|
|
|
|
*/
|
|
|
|
|
if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){
|
|
|
|
|
sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC);
|
|
|
|
@ -42099,7 +42099,7 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
|
|
|
|
pDflt = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check that the new column is not specified as PRIMARY KEY or UNITQUE.
|
|
|
|
|
/* Check that the new column is not specified as PRIMARY KEY or UNIQUE.
|
|
|
|
|
** If there is a NOT NULL constraint, then the default value for the
|
|
|
|
|
** column must not be NULL.
|
|
|
|
|
*/
|
|
|
|
@ -42108,7 +42108,7 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( pNew->pIndex ){
|
|
|
|
|
sqlite3ErrorMsg(pParse, "Cannot add a UNITQUE column");
|
|
|
|
|
sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( pCol->notNull && !pDflt ){
|
|
|
|
@ -44233,7 +44233,7 @@ SQLITE_PRIVATE void sqlite3StartTable(
|
|
|
|
|
/* Begin generating the code that will insert the table record into
|
|
|
|
|
** the SQLITE_MASTER table. Note in particular that we must go ahead
|
|
|
|
|
** and allocate the record number for the table entry now. Before any
|
|
|
|
|
** PRIMARY KEY or UNITQUE keywords are parsed. Those keywords will cause
|
|
|
|
|
** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause
|
|
|
|
|
** indices to be created and the table record must come before the
|
|
|
|
|
** indices. Hence, the record number for the table must be allocated
|
|
|
|
|
** now.
|
|
|
|
@ -45636,7 +45636,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
|
|
|
|
** Create a new index for an SQL table. pName1.pName2 is the name of the index
|
|
|
|
|
** and pTblList is the name of the table that is to be indexed. Both will
|
|
|
|
|
** be NULL for a primary key or an index that is created to satisfy a
|
|
|
|
|
** UNITQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
|
|
|
|
|
** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
|
|
|
|
|
** as the table to be indexed. pParse->pNewTable is a table that is
|
|
|
|
|
** currently being constructed by a CREATE TABLE statement.
|
|
|
|
|
**
|
|
|
|
@ -45747,7 +45747,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
|
|
|
|
|
** index, then we will continue to process this index.
|
|
|
|
|
**
|
|
|
|
|
** If pName==0 it means that we are
|
|
|
|
|
** dealing with a primary key or UNITQUE constraint. We have to invent our
|
|
|
|
|
** dealing with a primary key or UNIQUE constraint. We have to invent our
|
|
|
|
|
** own name.
|
|
|
|
|
*/
|
|
|
|
|
if( pName ){
|
|
|
|
@ -45902,12 +45902,12 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
|
|
|
|
|
|
|
|
|
|
if( pTab==pParse->pNewTable ){
|
|
|
|
|
/* This routine has been called to create an automatic index as a
|
|
|
|
|
** result of a PRIMARY KEY or UNITQUE clause on a column definition, or
|
|
|
|
|
** a PRIMARY KEY or UNITQUE clause following the column definitions.
|
|
|
|
|
** result of a PRIMARY KEY or UNIQUE clause on a column definition, or
|
|
|
|
|
** a PRIMARY KEY or UNIQUE clause following the column definitions.
|
|
|
|
|
** i.e. one of:
|
|
|
|
|
**
|
|
|
|
|
** CREATE TABLE t(x PRIMARY KEY, y);
|
|
|
|
|
** CREATE TABLE t(x, y, UNITQUE(x, y));
|
|
|
|
|
** CREATE TABLE t(x, y, UNIQUE(x, y));
|
|
|
|
|
**
|
|
|
|
|
** Either way, check to see if the table already has such an index. If
|
|
|
|
|
** so, don't bother creating this one. This only applies to
|
|
|
|
@ -45979,7 +45979,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
|
|
|
|
|
** we don't want to recreate it.
|
|
|
|
|
**
|
|
|
|
|
** If pTblName==0 it means this index is generated as a primary key
|
|
|
|
|
** or UNITQUE constraint of a CREATE TABLE statement. Since the table
|
|
|
|
|
** or UNIQUE constraint of a CREATE TABLE statement. Since the table
|
|
|
|
|
** has just been created, it contains no data and the index initialization
|
|
|
|
|
** step can be skipped.
|
|
|
|
|
*/
|
|
|
|
@ -46004,11 +46004,11 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
|
|
|
|
|
if( pStart && pEnd ){
|
|
|
|
|
/* A named index with an explicit CREATE INDEX statement */
|
|
|
|
|
zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
|
|
|
|
|
onError==OE_None ? "" : " UNITQUE",
|
|
|
|
|
onError==OE_None ? "" : " UNIQUE",
|
|
|
|
|
pEnd->z - pName->z + 1,
|
|
|
|
|
pName->z);
|
|
|
|
|
}else{
|
|
|
|
|
/* An automatic index created by a PRIMARY KEY or UNITQUE constraint */
|
|
|
|
|
/* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
|
|
|
|
|
/* zStmt = sqlite3MPrintf(""); */
|
|
|
|
|
zStmt = 0;
|
|
|
|
|
}
|
|
|
|
@ -46146,7 +46146,7 @@ SQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists
|
|
|
|
|
goto exit_drop_index;
|
|
|
|
|
}
|
|
|
|
|
if( pIndex->autoIndex ){
|
|
|
|
|
sqlite3ErrorMsg(pParse, "index associated with UNITQUE "
|
|
|
|
|
sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
|
|
|
|
|
"or PRIMARY KEY constraint cannot be dropped", 0);
|
|
|
|
|
goto exit_drop_index;
|
|
|
|
|
}
|
|
|
|
@ -48522,7 +48522,7 @@ static const char hexdigits[] = {
|
|
|
|
|
** change. This function may disappear. Do not write code that depends
|
|
|
|
|
** on this function.
|
|
|
|
|
**
|
|
|
|
|
** Implementation of the TQUOTE() function. This function takes a single
|
|
|
|
|
** 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
|
|
|
|
@ -50269,7 +50269,7 @@ insert_cleanup:
|
|
|
|
|
** aIdxUsed!=0 and aIdxUsed[i]!=0.
|
|
|
|
|
**
|
|
|
|
|
** This routine also generates code to check constraints. NOT NULL,
|
|
|
|
|
** CHECK, and UNITQUE constraints are all checked. If a constraint fails,
|
|
|
|
|
** CHECK, and UNIQUE constraints are all checked. If a constraint fails,
|
|
|
|
|
** then the appropriate action is performed. There are five possible
|
|
|
|
|
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
|
|
|
|
|
**
|
|
|
|
@ -50297,7 +50297,7 @@ insert_cleanup:
|
|
|
|
|
** value for that column. If the default value
|
|
|
|
|
** is NULL, the action is the same as ABORT.
|
|
|
|
|
**
|
|
|
|
|
** UNITQUE REPLACE The other row that conflicts with the row
|
|
|
|
|
** UNIQUE REPLACE The other row that conflicts with the row
|
|
|
|
|
** being inserted is removed.
|
|
|
|
|
**
|
|
|
|
|
** CHECK REPLACE Illegal. The results in an exception.
|
|
|
|
@ -50467,7 +50467,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Test all UNITQUE constraints by creating entries for each UNITQUE
|
|
|
|
|
/* Test all UNIQUE constraints by creating entries for each UNIQUE
|
|
|
|
|
** index and making sure that duplicate entries do not already exist.
|
|
|
|
|
** Add the new records to the indices as we go.
|
|
|
|
|
*/
|
|
|
|
@ -50491,7 +50491,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
|
|
|
|
|
|
|
|
|
|
/* Find out what action to take in case there is an indexing conflict */
|
|
|
|
|
onError = pIdx->onError;
|
|
|
|
|
if( onError==OE_None ) continue; /* pIdx is not a UNITQUE index */
|
|
|
|
|
if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */
|
|
|
|
|
if( overrideError!=OE_Default ){
|
|
|
|
|
onError = overrideError;
|
|
|
|
|
}else if( onError==OE_Default ){
|
|
|
|
@ -50556,7 +50556,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#if NULL_DISTINCT_FOR_UNITQUE
|
|
|
|
|
#if NULL_DISTINCT_FOR_UNIQUE
|
|
|
|
|
sqlite3VdbeJumpHere(v, jumpInst1);
|
|
|
|
|
#endif
|
|
|
|
|
sqlite3VdbeJumpHere(v, jumpInst2);
|
|
|
|
@ -50772,7 +50772,7 @@ static int xferOptimization(
|
|
|
|
|
Vdbe *v; /* The VDBE we are building */
|
|
|
|
|
KeyInfo *pKey; /* Key information for an index */
|
|
|
|
|
int counterMem; /* Memory register used by AUTOINC */
|
|
|
|
|
int destHasUniqueIdx = 0; /* True if pDest has a UNITQUE index */
|
|
|
|
|
int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
|
|
|
|
|
|
|
|
|
|
if( pSelect==0 ){
|
|
|
|
|
return 0; /* Must be of the form INSERT INTO ... SELECT ... */
|
|
|
|
@ -50908,7 +50908,7 @@ static int xferOptimization(
|
|
|
|
|
** we have to disallow the transfer optimization because the
|
|
|
|
|
** the rowids might change which will mess up indexing.
|
|
|
|
|
**
|
|
|
|
|
** Or if the destination has a UNITQUE index and is not empty,
|
|
|
|
|
** Or if the destination has a UNIQUE index and is not empty,
|
|
|
|
|
** we also disallow the transfer optimization because we cannot
|
|
|
|
|
** insure that all entries in the union of DEST and SRC will be
|
|
|
|
|
** unique.
|
|
|
|
@ -51919,7 +51919,7 @@ static int getLockingMode(const char *z){
|
|
|
|
|
if( 0==sqlite3StrICmp(z, "exclusive") ) return PAGER_LOCKINGMODE_EXCLUSIVE;
|
|
|
|
|
if( 0==sqlite3StrICmp(z, "normal") ) return PAGER_LOCKINGMODE_NORMAL;
|
|
|
|
|
}
|
|
|
|
|
return PAGER_LOCKINGMODE_TQUERY;
|
|
|
|
|
return PAGER_LOCKINGMODE_QUERY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_AUTOVACUUM
|
|
|
|
@ -52224,7 +52224,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
|
|
|
|
|
const char *zRet = "normal";
|
|
|
|
|
int eMode = getLockingMode(zRight);
|
|
|
|
|
|
|
|
|
|
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_TQUERY ){
|
|
|
|
|
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){
|
|
|
|
|
/* Simple "PRAGMA locking_mode;" statement. This is a query for
|
|
|
|
|
** the current default locking mode (which may be different to
|
|
|
|
|
** the locking-mode of the main database).
|
|
|
|
@ -53117,7 +53117,7 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
/* If the SQL column is blank it means this is an index that
|
|
|
|
|
** was created to be the PRIMARY KEY or to fulfill a UNITQUE
|
|
|
|
|
** was created to be the PRIMARY KEY or to fulfill a UNIQUE
|
|
|
|
|
** constraint for a CREATE TABLE. The index should have already
|
|
|
|
|
** been created when we processed the CREATE TABLE. All we have
|
|
|
|
|
** to do here is record the root page number for that index.
|
|
|
|
@ -54301,7 +54301,7 @@ static int selectInnerLoop(
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
/* If we are creating a set for an "expr IN (SELECT ...)" construct,
|
|
|
|
|
** then there should be a single item on the stack. Write this
|
|
|
|
|
** item into the set table with bogus data.
|
|
|
|
@ -54352,7 +54352,7 @@ static int selectInnerLoop(
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endif /* #ifndef SQLITE_OMIT_SUBTQUERY */
|
|
|
|
|
#endif /* #ifndef SQLITE_OMIT_SUBQUERY */
|
|
|
|
|
|
|
|
|
|
/* Send the data to the callback function or to a subroutine. In the
|
|
|
|
|
** case of a subroutine, the subroutine itself is responsible for
|
|
|
|
@ -54477,7 +54477,7 @@ static void generateSortTail(
|
|
|
|
|
sqlite3VdbeAddOp(v, OP_Insert, iParm, OPFLAG_APPEND);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
case SRT_Set: {
|
|
|
|
|
assert( nColumn==1 );
|
|
|
|
|
sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
|
|
|
|
@ -54638,7 +54638,7 @@ static const char *columnType(
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
case TK_SELECT: {
|
|
|
|
|
/* The expression is a sub-select. Return the declaration type and
|
|
|
|
|
** origin info for the single column in the result set of the SELECT
|
|
|
|
@ -54943,7 +54943,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if( pFrom->zName==0 ){
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
/* A sub-query in the FROM clause of a SELECT */
|
|
|
|
|
assert( pFrom->pSelect!=0 );
|
|
|
|
|
if( pFrom->zAlias==0 ){
|
|
|
|
@ -56680,7 +56680,7 @@ SQLITE_PRIVATE int sqlite3Select(
|
|
|
|
|
/* If writing to memory or generating a set
|
|
|
|
|
** only a single column may be output.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
if( checkForMultiColumnSelectError(pParse, eDest, pEList->nExpr) ){
|
|
|
|
|
goto select_end;
|
|
|
|
|
}
|
|
|
|
@ -56699,7 +56699,7 @@ SQLITE_PRIVATE int sqlite3Select(
|
|
|
|
|
|
|
|
|
|
/* Generate code for all sub-queries in the FROM clause
|
|
|
|
|
*/
|
|
|
|
|
#if !defined(SQLITE_OMIT_SUBTQUERY) || !defined(SQLITE_OMIT_VIEW)
|
|
|
|
|
#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
|
|
|
|
|
for(i=0; i<pTabList->nSrc; i++){
|
|
|
|
|
const char *zSavedAuthContext = 0;
|
|
|
|
|
int needRestoreContext;
|
|
|
|
@ -57097,7 +57097,7 @@ SQLITE_PRIVATE int sqlite3Select(
|
|
|
|
|
generateSortTail(pParse, p, v, pEList->nExpr, eDest, iParm);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
/* If this was a subquery, we have now converted the subquery into a
|
|
|
|
|
** temporary table. So set the SrcList_item.isPopulated flag to prevent
|
|
|
|
|
** this subquery from being evaluated again and to force the use of
|
|
|
|
@ -59035,8 +59035,8 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
|
|
|
|
|
" FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ");
|
|
|
|
|
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
|
|
|
|
rc = execExecSql(db,
|
|
|
|
|
"SELECT 'CREATE UNITQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
|
|
|
|
|
" FROM sqlite_master WHERE sql LIKE 'CREATE UNITQUE INDEX %'");
|
|
|
|
|
"SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
|
|
|
|
|
" FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
|
|
|
|
|
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
|
|
|
|
|
|
|
|
|
/* Loop through the tables in the main database. For each, do
|
|
|
|
@ -60114,7 +60114,7 @@ struct ExprMaskSet {
|
|
|
|
|
#define WHERE_IDX_ONLY 0x080000 /* Use index only - omit table */
|
|
|
|
|
#define WHERE_ORDERBY 0x100000 /* Output will appear in correct order */
|
|
|
|
|
#define WHERE_REVERSE 0x200000 /* Scan in reverse order */
|
|
|
|
|
#define WHERE_UNITQUE 0x400000 /* Selects no more than one row */
|
|
|
|
|
#define WHERE_UNIQUE 0x400000 /* Selects no more than one row */
|
|
|
|
|
#define WHERE_VIRTUALTABLE 0x800000 /* Use virtual-table processing */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -60529,7 +60529,7 @@ static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
|
|
|
|
|
pDerived->iRightJoinTable = pBase->iRightJoinTable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBTQUERY)
|
|
|
|
|
#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY)
|
|
|
|
|
/*
|
|
|
|
|
** Return TRUE if the given term of an OR clause can be converted
|
|
|
|
|
** into an IN clause. The iCursor and iColumn define the left-hand
|
|
|
|
@ -60614,7 +60614,7 @@ static int orTermHasOkDuplicate(WhereClause *pOr, WhereTerm *pOrTerm){
|
|
|
|
|
** which the original did not qualify. Either way we are done for. */
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif /* !SQLITE_OMIT_OR_OPTIMIZATION && !SQLITE_OMIT_SUBTQUERY */
|
|
|
|
|
#endif /* !SQLITE_OMIT_OR_OPTIMIZATION && !SQLITE_OMIT_SUBQUERY */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** The input to this routine is an WhereTerm structure with only the
|
|
|
|
@ -60725,7 +60725,7 @@ static void exprAnalyze(
|
|
|
|
|
}
|
|
|
|
|
#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */
|
|
|
|
|
|
|
|
|
|
#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBTQUERY)
|
|
|
|
|
#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY)
|
|
|
|
|
/* Attempt to convert OR-connected terms into an IN operator so that
|
|
|
|
|
** they can make use of indices. Example:
|
|
|
|
|
**
|
|
|
|
@ -60735,7 +60735,7 @@ static void exprAnalyze(
|
|
|
|
|
**
|
|
|
|
|
** x IN (expr1,expr2,expr3)
|
|
|
|
|
**
|
|
|
|
|
** This optimization must be omitted if OMIT_SUBTQUERY is defined because
|
|
|
|
|
** This optimization must be omitted if OMIT_SUBQUERY is defined because
|
|
|
|
|
** the compiler for the the IN operator is part of sub-queries.
|
|
|
|
|
*/
|
|
|
|
|
else if( pExpr->op==TK_OR ){
|
|
|
|
@ -60908,7 +60908,7 @@ static int referencesOtherTables(
|
|
|
|
|
** clause and the match can still be a success.
|
|
|
|
|
**
|
|
|
|
|
** All terms of the ORDER BY that match against the index must be either
|
|
|
|
|
** ASC or DESC. (Terms of the ORDER BY clause past the end of a UNITQUE
|
|
|
|
|
** ASC or DESC. (Terms of the ORDER BY clause past the end of a UNIQUE
|
|
|
|
|
** index do not need to satisfy this constraint.) The *pbRev value is
|
|
|
|
|
** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
|
|
|
|
|
** the ORDER BY clause is all ASC.
|
|
|
|
@ -61019,7 +61019,7 @@ static int isSortingIndex(
|
|
|
|
|
if( pIdx->onError!=OE_None && i==pIdx->nColumn
|
|
|
|
|
&& !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){
|
|
|
|
|
/* All terms of this index match some prefix of the ORDER BY clause
|
|
|
|
|
** and the index is UNITQUE and no terms on the tail of the ORDER BY
|
|
|
|
|
** and the index is UNIQUE and no terms on the tail of the ORDER BY
|
|
|
|
|
** clause reference other tables in a join. If this is all true then
|
|
|
|
|
** the order by clause is superfluous. */
|
|
|
|
|
return 1;
|
|
|
|
@ -61385,7 +61385,7 @@ static double bestIndex(
|
|
|
|
|
if( pTerm->eOperator & WO_EQ ){
|
|
|
|
|
/* Rowid== is always the best pick. Look no further. Because only
|
|
|
|
|
** a single row is generated, output is always in sorted order */
|
|
|
|
|
*pFlags = WHERE_ROWID_EQ | WHERE_UNITQUE;
|
|
|
|
|
*pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE;
|
|
|
|
|
*pnEq = 1;
|
|
|
|
|
WHERETRACE(("... best is rowid\n"));
|
|
|
|
|
return 0.0;
|
|
|
|
@ -61487,7 +61487,7 @@ static double bestIndex(
|
|
|
|
|
nEq = i;
|
|
|
|
|
if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
|
|
|
|
|
&& nEq==pProbe->nColumn ){
|
|
|
|
|
flags |= WHERE_UNITQUE;
|
|
|
|
|
flags |= WHERE_UNIQUE;
|
|
|
|
|
}
|
|
|
|
|
WHERETRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
|
|
|
|
|
|
|
|
|
@ -61648,7 +61648,7 @@ static void codeEqualityTerm(
|
|
|
|
|
sqlite3ExprCode(pParse, pX->pRight);
|
|
|
|
|
}else if( pX->op==TK_ISNULL ){
|
|
|
|
|
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBTQUERY
|
|
|
|
|
#ifndef SQLITE_OMIT_SUBQUERY
|
|
|
|
|
}else{
|
|
|
|
|
int iTab;
|
|
|
|
|
struct InLoop *pIn;
|
|
|
|
@ -62054,7 +62054,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
|
|
|
|
/* If the total query only selects a single row, then the ORDER BY
|
|
|
|
|
** clause is irrelevant.
|
|
|
|
|
*/
|
|
|
|
|
if( (andFlags & WHERE_UNITQUE)!=0 && ppOrderBy ){
|
|
|
|
|
if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){
|
|
|
|
|
*ppOrderBy = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -63299,7 +63299,7 @@ static const YYCODETYPE yyFallback[] = {
|
|
|
|
|
0, /* $ => nothing */
|
|
|
|
|
0, /* SEMI => nothing */
|
|
|
|
|
23, /* EXPLAIN => ID */
|
|
|
|
|
23, /* TQUERY => ID */
|
|
|
|
|
23, /* QUERY => ID */
|
|
|
|
|
23, /* PLAN => ID */
|
|
|
|
|
23, /* BEGIN => ID */
|
|
|
|
|
0, /* TRANSACTION => nothing */
|
|
|
|
@ -63390,7 +63390,7 @@ static const YYCODETYPE yyFallback[] = {
|
|
|
|
|
0, /* DEFAULT => nothing */
|
|
|
|
|
0, /* NULL => nothing */
|
|
|
|
|
0, /* PRIMARY => nothing */
|
|
|
|
|
0, /* UNITQUE => nothing */
|
|
|
|
|
0, /* UNIQUE => nothing */
|
|
|
|
|
0, /* CHECK => nothing */
|
|
|
|
|
0, /* REFERENCES => nothing */
|
|
|
|
|
0, /* AUTOINCR => nothing */
|
|
|
|
@ -63531,7 +63531,7 @@ static const char *const yyTokenName[] = {
|
|
|
|
|
"STAR", "SLASH", "REM", "CONCAT",
|
|
|
|
|
"COLLATE", "UMINUS", "UPLUS", "BITNOT",
|
|
|
|
|
"STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT",
|
|
|
|
|
"NULL", "PRIMARY", "UNITQUE", "CHECK",
|
|
|
|
|
"NULL", "PRIMARY", "UNIQUE", "CHECK",
|
|
|
|
|
"REFERENCES", "AUTOINCR", "ON", "DELETE",
|
|
|
|
|
"UPDATE", "INSERT", "SET", "DEFERRABLE",
|
|
|
|
|
"FOREIGN", "DROP", "UNION", "ALL",
|
|
|
|
@ -63585,7 +63585,7 @@ static const char *const yyRuleName[] = {
|
|
|
|
|
/* 5 */ "ecmd ::= explain cmdx SEMI",
|
|
|
|
|
/* 6 */ "explain ::=",
|
|
|
|
|
/* 7 */ "explain ::= EXPLAIN",
|
|
|
|
|
/* 8 */ "explain ::= EXPLAIN TQUERY PLAN",
|
|
|
|
|
/* 8 */ "explain ::= EXPLAIN QUERY PLAN",
|
|
|
|
|
/* 9 */ "cmd ::= BEGIN transtype trans_opt",
|
|
|
|
|
/* 10 */ "trans_opt ::=",
|
|
|
|
|
/* 11 */ "trans_opt ::= TRANSACTION",
|
|
|
|
@ -63635,7 +63635,7 @@ static const char *const yyRuleName[] = {
|
|
|
|
|
/* 55 */ "ccons ::= NULL onconf",
|
|
|
|
|
/* 56 */ "ccons ::= NOT NULL onconf",
|
|
|
|
|
/* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
|
|
|
|
|
/* 58 */ "ccons ::= UNITQUE onconf",
|
|
|
|
|
/* 58 */ "ccons ::= UNIQUE onconf",
|
|
|
|
|
/* 59 */ "ccons ::= CHECK LP expr RP",
|
|
|
|
|
/* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
|
|
|
|
|
/* 61 */ "ccons ::= defer_subclause",
|
|
|
|
@ -63664,7 +63664,7 @@ static const char *const yyRuleName[] = {
|
|
|
|
|
/* 84 */ "conslist ::= tcons",
|
|
|
|
|
/* 85 */ "tcons ::= CONSTRAINT nm",
|
|
|
|
|
/* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
|
|
|
|
|
/* 87 */ "tcons ::= UNITQUE LP idxlist RP onconf",
|
|
|
|
|
/* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf",
|
|
|
|
|
/* 88 */ "tcons ::= CHECK LP expr RP onconf",
|
|
|
|
|
/* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
|
|
|
|
|
/* 90 */ "defer_subclause_opt ::=",
|
|
|
|
@ -63811,7 +63811,7 @@ static const char *const yyRuleName[] = {
|
|
|
|
|
/* 231 */ "nexprlist ::= nexprlist COMMA expr",
|
|
|
|
|
/* 232 */ "nexprlist ::= expr",
|
|
|
|
|
/* 233 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
|
|
|
|
|
/* 234 */ "uniqueflag ::= UNITQUE",
|
|
|
|
|
/* 234 */ "uniqueflag ::= UNIQUE",
|
|
|
|
|
/* 235 */ "uniqueflag ::=",
|
|
|
|
|
/* 236 */ "idxlist_opt ::=",
|
|
|
|
|
/* 237 */ "idxlist_opt ::= LP idxlist RP",
|
|
|
|
@ -65887,7 +65887,7 @@ static int keywordCode(const char *z, int n){
|
|
|
|
|
static const char zText[526] =
|
|
|
|
|
"BEFOREIGNOREGEXPLAINSTEADDESCAPEACHECKEYCONSTRAINTERSECTABLEFT"
|
|
|
|
|
"HENDATABASELECTRANSACTIONATURALTERAISELSEXCEPTRIGGEREFERENCES"
|
|
|
|
|
"UNITQUERYATTACHAVINGROUPDATEMPORARYBEGINNEREINDEXCLUSIVEXISTSBETWEEN"
|
|
|
|
|
"UNIQUERYATTACHAVINGROUPDATEMPORARYBEGINNEREINDEXCLUSIVEXISTSBETWEEN"
|
|
|
|
|
"OTNULLIKECASCADEFERRABLECASECOLLATECREATECURRENT_DATEDELETEDETACH"
|
|
|
|
|
"IMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHEN"
|
|
|
|
|
"WHERENAMEAFTEREPLACEANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICT"
|
|
|
|
@ -65946,7 +65946,7 @@ static int keywordCode(const char *z, int n){
|
|
|
|
|
TK_TABLE, TK_JOIN_KW, TK_THEN, TK_END, TK_DATABASE,
|
|
|
|
|
TK_AS, TK_SELECT, TK_TRANSACTION,TK_ON, TK_JOIN_KW,
|
|
|
|
|
TK_ALTER, TK_RAISE, TK_ELSE, TK_EXCEPT, TK_TRIGGER,
|
|
|
|
|
TK_REFERENCES, TK_UNITQUE, TK_TQUERY, TK_ATTACH, TK_HAVING,
|
|
|
|
|
TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_ATTACH, TK_HAVING,
|
|
|
|
|
TK_GROUP, TK_UPDATE, TK_TEMP, TK_TEMP, TK_OR,
|
|
|
|
|
TK_BEGIN, TK_JOIN_KW, TK_REINDEX, TK_INDEX, TK_EXCLUSIVE,
|
|
|
|
|
TK_EXISTS, TK_BETWEEN, TK_NOTNULL, TK_NOT, TK_NULL,
|
|
|
|
|