MXS-1196: Turn certain keywords into ids
This commit is contained in:
@ -2483,6 +2483,26 @@ void maxscaleLock(Parse* pParse, mxs_lock_t type, SrcList* pTables)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int maxscaleTranslateKeyword(int token)
|
||||||
|
{
|
||||||
|
switch (token)
|
||||||
|
{
|
||||||
|
case TK_CHARSET:
|
||||||
|
case TK_DO:
|
||||||
|
case TK_HANDLER:
|
||||||
|
if (this_unit.sql_mode == QC_SQL_MODE_ORACLE)
|
||||||
|
{
|
||||||
|
token = TK_ID;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the tokenization of a keyword.
|
* Register the tokenization of a keyword.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -569,11 +569,17 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){
|
|||||||
|
|
||||||
if (*tokenType != TK_ID) {
|
if (*tokenType != TK_ID) {
|
||||||
extern int maxscaleKeyword(int);
|
extern int maxscaleKeyword(int);
|
||||||
if (maxscaleKeyword(*tokenType) != 0)
|
extern int maxscaleTranslateKeyword(int);
|
||||||
{
|
|
||||||
/* Consume the entire string. */
|
*tokenType = maxscaleTranslateKeyword(*tokenType);
|
||||||
while ( z[i] ) {
|
|
||||||
++i;
|
if (*tokenType != TK_ID) {
|
||||||
|
if (maxscaleKeyword(*tokenType) != 0)
|
||||||
|
{
|
||||||
|
/* Consume the entire string. */
|
||||||
|
while ( z[i] ) {
|
||||||
|
++i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user