diff --git a/query_classifier/qc_sqlite/qc_sqlite.c b/query_classifier/qc_sqlite/qc_sqlite.c index 22c9cfca4..b51b29c13 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.c +++ b/query_classifier/qc_sqlite/qc_sqlite.c @@ -2173,6 +2173,19 @@ void maxscaleComment() } } +void maxscaleDeclare(Parse* pParse) +{ + QC_TRACE(); + + QC_SQLITE_INFO* info = this_thread.info; + ss_dassert(info); + + if (this_unit.sql_mode != QC_SQL_MODE_ORACLE) + { + info->status = QC_QUERY_INVALID; + } +} + void maxscaleDeallocate(Parse* pParse, Token* pName) { QC_TRACE(); @@ -2506,6 +2519,7 @@ int maxscaleKeyword(int token) break; case TK_BEGIN: + case TK_DECLARE: if (this_unit.sql_mode == QC_SQL_MODE_ORACLE) { // The beginning of a BLOCK. We'll assume it is in a single diff --git a/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y b/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y index 79b819be4..87ea93da5 100644 --- a/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y +++ b/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y @@ -111,6 +111,7 @@ extern void maxscaleAlterTable(Parse*, mxs_alter_t command, SrcList*, Token*); extern void maxscaleCall(Parse*, SrcList* pName, int uses_variables); extern void maxscaleCheckTable(Parse*, SrcList* pTables); extern void maxscaleCreateSequence(Parse*, Token* pDatabase, Token* pTable); +extern void maxscaleDeclare(Parse* pParse); extern void maxscaleDeallocate(Parse*, Token* pName); extern void maxscaleDo(Parse*, ExprList* pEList); extern void maxscaleDrop(Parse*, int what, Token* pDatabase, Token* pName); @@ -3325,4 +3326,10 @@ cmd ::= DROP SEQUENCE nm(X) dbnm(Y).{ // CREATE SEQUENCE db maxscaleDrop(pParse, MXS_DROP_SEQUENCE, pDatabase, pTable); } +//////////////////////// ORACLE DECLARE //////////////////////////////////// +// +cmd ::= DECLARE. { + maxscaleDeclare(pParse); +} + %endif diff --git a/query_classifier/qc_sqlite/sqlite-src-3110100/tool/mkkeywordhash.c b/query_classifier/qc_sqlite/sqlite-src-3110100/tool/mkkeywordhash.c index 15be3c92d..d496ec6be 100644 --- a/query_classifier/qc_sqlite/sqlite-src-3110100/tool/mkkeywordhash.c +++ b/query_classifier/qc_sqlite/sqlite-src-3110100/tool/mkkeywordhash.c @@ -218,6 +218,7 @@ static Keyword aKeywordTable[] = { #ifdef MAXSCALE { "DATABASES", "TK_DATABASES_KW", ALWAYS }, { "DEALLOCATE", "TK_DEALLOCATE", ALWAYS }, + { "DECLARE", "TK_DECLARE", ALWAYS }, #endif { "DEFAULT", "TK_DEFAULT", ALWAYS }, { "DEFERRED", "TK_DEFERRED", ALWAYS },