aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-10-22 18:01:40 +0000
committerdrh <drh@noemail.net>2013-10-22 18:01:40 +0000
commitbbbdc83b52cc704f1dcc8f1456ad9f1445e3b384 (patch)
treee0d925d89395420a1982cb5d3e6297484ae43cbe /src/sqliteInt.h
parent77e57dfbc8f40ecfdab70be2514165d5c74e914c (diff)
downloadsqlite-bbbdc83b52cc704f1dcc8f1456ad9f1445e3b384.tar.gz
sqlite-bbbdc83b52cc704f1dcc8f1456ad9f1445e3b384.zip
The Index object now has nKeyCol and nColumn. nColumn is the total number
of columns and nKeyCol is the number of key columns. Currently these always differ by one. Refactor aiColumn[] to be of type i16 instead of int. FossilOrigin-Name: a106ce86cd4afd1f81603826de77df1fb25e9ab5
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 11053b9af..4565e92a8 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1577,7 +1577,7 @@ struct UnpackedRecord {
*/
struct Index {
char *zName; /* Name of this index */
- int *aiColumn; /* Which columns are used by this index. 1st is 0 */
+ i16 *aiColumn; /* Which columns are used by this index. 1st is 0 */
tRowcnt *aiRowEst; /* From ANALYZE: Est. rows selected by each column */
Table *pTable; /* The SQL table being indexed */
char *zColAff; /* String defining the affinity of each column */
@@ -1588,7 +1588,8 @@ struct Index {
Expr *pPartIdxWhere; /* WHERE clause for partial indices */
int tnum; /* DB Page containing root of this index */
LogEst szIdxRow; /* Estimated average row size in bytes */
- u16 nColumn; /* Number of columns in table used by this index */
+ u16 nKeyCol; /* Number of columns forming the key */
+ u16 nColumn; /* Number of columns stored in the index */
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
unsigned autoIndex:2; /* 1==UNIQUE, 2==PRIMARY KEY, 0==CREATE INDEX */
unsigned bUnordered:1; /* Use this index for == or IN queries only */
@@ -2826,7 +2827,7 @@ void sqlite3SrcListShiftJoinType(SrcList*);
void sqlite3SrcListAssignCursors(Parse*, SrcList*);
void sqlite3IdListDelete(sqlite3*, IdList*);
void sqlite3SrcListDelete(sqlite3*, SrcList*);
-Index *sqlite3AllocateIndexObject(sqlite3*,int,int,char**);
+Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**);
Index *sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
Expr*, int, int);
void sqlite3DropIndex(Parse*, SrcList*, int);