diff options
author | dan <dan@noemail.net> | 2019-08-12 16:36:38 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-08-12 16:36:38 +0000 |
commit | 6e11892db8919592352b20228b9c9c36f31bf1a8 (patch) | |
tree | eed56d9bffb5dfb218a6e061063bf93b680d9bdd /src/sqliteInt.h | |
parent | 41428a97b86b89395e9bdf0f38cf7d83ab2b451b (diff) | |
download | sqlite-6e11892db8919592352b20228b9c9c36f31bf1a8.tar.gz sqlite-6e11892db8919592352b20228b9c9c36f31bf1a8.zip |
Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index.
FossilOrigin-Name: 07babb0f897fc8c9cb5b30481899c32fdd743f3f3ca508d8d957826252107dd5
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 1104b771f..f036092ba 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2134,10 +2134,13 @@ struct KeyInfo { u16 nKeyField; /* Number of key columns in the index */ u16 nAllField; /* Total columns, including key plus others */ sqlite3 *db; /* The database connection */ - u8 *aSortOrder; /* Sort order for each column. */ + u8 *aSortFlags; /* Sort order for each column. */ CollSeq *aColl[1]; /* Collating sequence for each term of the key */ }; +#define KEYINFO_ORDER_DESC 0x01 +#define KEYINFO_ORDER_BIGNULL 0x02 + /* ** This object holds a record which has been parsed out into individual ** fields, for the purposes of doing a comparison. @@ -2597,7 +2600,7 @@ struct ExprList { Expr *pExpr; /* The parse tree for this expression */ char *zName; /* Token associated with this expression */ char *zSpan; /* Original text of the expression */ - u8 sortOrder; /* 1 for DESC or 0 for ASC */ + u8 sortFlags; /* 1 for DESC or 0 for ASC */ unsigned done :1; /* A flag to indicate when processing is finished */ unsigned bSpanIsTab :1; /* zSpan holds DB.TABLE.COLUMN */ unsigned reusable :1; /* Constant expression is reusable */ @@ -3881,7 +3884,7 @@ void sqlite3ExprDelete(sqlite3*, Expr*); void sqlite3ExprUnmapAndDelete(Parse*, Expr*); ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*); ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*); -void sqlite3ExprListSetSortOrder(ExprList*,int); +void sqlite3ExprListSetSortOrder(ExprList*,int,int); void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int); void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*); void sqlite3ExprListDelete(sqlite3*, ExprList*); |