MXS-1196: Handle DECLARE

DECLARE can also begin an anonymous block in PL/SQL.
This commit is contained in:
Johan Wikman
2017-05-23 15:28:52 +03:00
parent bf54a9bf9f
commit 2a89a4de45
3 changed files with 22 additions and 0 deletions

View File

@ -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