diff options
author | drh <> | 2025-02-21 20:35:37 +0000 |
---|---|---|
committer | drh <> | 2025-02-21 20:35:37 +0000 |
commit | cc803b209f2ffa9dcaad43c37eb8ccafaed199bd (patch) | |
tree | d58455eecf8e403f2ecf00a75fb28a22f8d23a2d /src/sqliteInt.h | |
parent | d9959bf48b13bffda4c073de17eb13752b9cb5c9 (diff) | |
download | sqlite-cc803b209f2ffa9dcaad43c37eb8ccafaed199bd.tar.gz sqlite-cc803b209f2ffa9dcaad43c37eb8ccafaed199bd.zip |
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
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d4b998309..de3ce7aa2 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -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); |