grammar: Disable window function parsing

Remove the window function grammar rules. I think they are not needed
anyway as long as we only parse CREATE TABLE and CREATE INDEX
statements and unexpectedly they do seem to cause problems. It it still
worth investigating how this is possible but for now removing them seems
like the best option.

See issue #1733.
This commit is contained in:
Martin Kleusberg
2019-02-09 13:26:21 +01:00
parent 5f4d0ee7ff
commit ee70a34ead
5 changed files with 94 additions and 1151 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -66,11 +66,7 @@ public:
public: void castexpr();
public: void caseexpr();
public: void raisefunction();
public: void windowfunc();
public: void suffixexpr();
public: void windowdefn();
public: void orderingterm();
public: void framespec();
public: void like_operator();
public: void between_subexpr();
public:
@@ -84,10 +80,10 @@ protected:
private:
static const char* tokenNames[];
#ifndef NO_STATIC_CONSTS
static const int NUM_TOKENS = 125;
static const int NUM_TOKENS = 121;
#else
enum {
NUM_TOKENS = 125
NUM_TOKENS = 121
};
#endif
@@ -141,14 +137,6 @@ private:
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23;
static const unsigned long _tokenSet_24_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24;
static const unsigned long _tokenSet_25_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25;
static const unsigned long _tokenSet_26_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26;
static const unsigned long _tokenSet_27_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27;
static const unsigned long _tokenSet_28_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28;
};
#endif /*INC_Sqlite3Parser_hpp_*/

View File

@@ -454,7 +454,7 @@ subexpr
| EXISTS LPAREN (expr | selectstmt) RPAREN
| caseexpr
| raisefunction
| windowfunc
// | windowfunc
)
(suffixexpr)?
;
@@ -469,6 +469,7 @@ caseexpr
CASE_T (expr)? (WHEN expr THEN expr)+ (ELSE_T expr)? END
;
/*
windowfunc
:
functionname LPAREN (STAR | (expr (COMMA expr)*))? RPAREN (FILTER LPAREN WHERE expr RPAREN)? OVER
@@ -516,6 +517,7 @@ framespec
| (expr FOLLOWING)
)
;
*/
like_operator
:

View File

@@ -127,12 +127,8 @@ struct CUSTOM_API sqlite3TokenTypes {
BITWISELEFT = 116,
BITWISERIGHT = 117,
SELECT = 118,
BY = 119,
ORDER = 120,
CURRENT = 121,
ROW = 122,
SLASH = 123,
PERCENT = 124,
SLASH = 119,
PERCENT = 120,
NULL_TREE_LOOKAHEAD = 3
};
#ifdef __cplusplus