mirror of
https://github.com/sqlite/sqlite.git
synced 2026-10-31 14:14:28 +03:00
The number of declared columns in an index is limited to SQLITE_LIMIT_COLUMN.
But the actual number of columns in the implementation might need to be twice as much to account for the primary key at the end. Ensure that the code is able to deal with this. This is a correction to check-in [d7729dbbf231d57c]. FossilOrigin-Name: 5822feec43be9352fd87bf9968c39c0218e01ab5fe3ba50431ae21cba79e6c89
This commit is contained in:
@@ -2759,7 +2759,7 @@ struct Index {
|
||||
Pgno tnum; /* DB Page containing root of this index */
|
||||
LogEst szIdxRow; /* Estimated average row size in bytes */
|
||||
u16 nKeyCol; /* Number of columns forming the key */
|
||||
u16 nColumn; /* Number of columns stored in the index */
|
||||
u16 nColumn; /* Nr columns in btree. Can be 2*Table.nCol */
|
||||
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
|
||||
unsigned idxType:2; /* 0:Normal 1:UNIQUE, 2:PRIMARY KEY, 3:IPK */
|
||||
unsigned bUnordered:1; /* Use this index for == or IN queries only */
|
||||
@@ -4908,7 +4908,7 @@ void sqlite3SubqueryColumnTypes(Parse*,Table*,Select*,char);
|
||||
Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
|
||||
void sqlite3OpenSchemaTable(Parse *, int);
|
||||
Index *sqlite3PrimaryKeyIndex(Table*);
|
||||
i16 sqlite3TableColumnToIndex(Index*, int);
|
||||
int sqlite3TableColumnToIndex(Index*, int);
|
||||
#ifdef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
# define sqlite3TableColumnToStorage(T,X) (X) /* No-op pass-through */
|
||||
# define sqlite3StorageColumnToTable(T,X) (X) /* No-op pass-through */
|
||||
@@ -5006,7 +5006,7 @@ void sqlite3SrcListAssignCursors(Parse*, SrcList*);
|
||||
void sqlite3IdListDelete(sqlite3*, IdList*);
|
||||
void sqlite3ClearOnOrUsing(sqlite3*, OnOrUsing*);
|
||||
void sqlite3SrcListDelete(sqlite3*, SrcList*);
|
||||
Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
|
||||
Index *sqlite3AllocateIndexObject(sqlite3*,int,int,char**);
|
||||
void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
|
||||
Expr*, int, int, u8);
|
||||
void sqlite3DropIndex(Parse*, SrcList*, int);
|
||||
|
||||
Reference in New Issue
Block a user