diff options
author | dan <dan@noemail.net> | 2019-07-02 11:56:47 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-07-02 11:56:47 +0000 |
commit | 6ba7ab0d2524748479376e70043be9fc4cfbeccc (patch) | |
tree | 6b4eac25e89854e3cb63987a11d6bc76c9c034a0 /src/sqliteInt.h | |
parent | 00a6153fafe01c9dde8f84a70f1cb810256300dd (diff) | |
download | sqlite-6ba7ab0d2524748479376e70043be9fc4cfbeccc.tar.gz sqlite-6ba7ab0d2524748479376e70043be9fc4cfbeccc.zip |
Experimental implementation of FILTER clause for aggregate functions.
FossilOrigin-Name: 1f1ae2d6ac8dcbb62e5aa3dc17bc67d559cb565fc0d0a8c00a596075d35f8130
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 1c4618331..c0f2e0a18 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2491,7 +2491,8 @@ struct Expr { union { Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL ** for a column of an index on an expression */ - Window *pWin; /* TK_FUNCTION: Window definition for the func */ + Window *pWin; /* EP_WinFunc: Window definition for the func */ + Expr *pFilter; /* EP_Filter: Filter definition for the func */ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */ int iAddr; /* Subroutine entry address */ int regReturn; /* Register used to hold return address */ @@ -2536,6 +2537,7 @@ struct Expr { #define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */ #define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */ #define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */ +#define EP_Filter 0x40000000 /* TK_[AGG_]FUNCTION with Expr.y.pFilter set */ /* ** The EP_Propagate mask is a set of properties that automatically propagate @@ -3602,7 +3604,7 @@ struct Window { void sqlite3WindowDelete(sqlite3*, Window*); void sqlite3WindowListDelete(sqlite3 *db, Window *p); Window *sqlite3WindowAlloc(Parse*, int, int, Expr*, int , Expr*, u8); -void sqlite3WindowAttach(Parse*, Expr*, Window*); +void sqlite3WindowAttach(Parse*, Expr*, Expr*, Window*); int sqlite3WindowCompare(Parse*, Window*, Window*); void sqlite3WindowCodeInit(Parse*, Window*); void sqlite3WindowCodeStep(Parse*, Select*, WhereInfo*, int, int); @@ -3617,7 +3619,7 @@ Window *sqlite3WindowAssemble(Parse*, Window*, ExprList*, ExprList*, Token*); #else # define sqlite3WindowDelete(a,b) # define sqlite3WindowFunctions() -# define sqlite3WindowAttach(a,b,c) +# define sqlite3WindowAttach(a,b,c,d) #endif /* |