MXS-2431 Recognize the XA keyword
Recognize the XA keyword and classify the statement as write. Needs to be dealt with explicitly as sqlite3 assumes there are no keywords starting with the letter X.
This commit is contained in:
parent
62f2a86a5f
commit
4131f09c16
@ -1575,18 +1575,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void mxs_sqlite3BeginTrigger(Parse* pParse, /* The parse context of the CREATE TRIGGER statement
|
||||
* */
|
||||
Token* pName1, /* The name of the trigger */
|
||||
Token* pName2, /* The name of the trigger */
|
||||
int tr_tm, /* One of TK_BEFORE, TK_AFTER, TK_INSTEAD */
|
||||
int op, /* One of TK_INSERT, TK_UPDATE, TK_DELETE */
|
||||
IdList* pColumns, /* column list if this is an UPDATE OF trigger */
|
||||
SrcList* pTableName, /* The name of the table/view the trigger applies to
|
||||
* */
|
||||
Expr* pWhen, /* WHEN clause */
|
||||
int isTemp, /* True if the TEMPORARY keyword is present */
|
||||
int noErr) /* Suppress errors if the trigger already exists */
|
||||
void mxs_sqlite3BeginTrigger(Parse* pParse, /* The parse context of the CREATE TRIGGER statement */
|
||||
Token* pName1, /* The name of the trigger */
|
||||
Token* pName2, /* The name of the trigger */
|
||||
int tr_tm, /* One of TK_BEFORE, TK_AFTER, TK_INSTEAD */
|
||||
int op, /* One of TK_INSERT, TK_UPDATE, TK_DELETE */
|
||||
IdList* pColumns, /* column list if this is an UPDATE OF trigger */
|
||||
SrcList* pTableName, /* The name of the table/view the trigger applies to */
|
||||
Expr* pWhen, /* WHEN clause */
|
||||
int isTemp, /* True if the TEMPORARY keyword is present */
|
||||
int noErr) /* Suppress errors if the trigger already exists */
|
||||
{
|
||||
mxb_assert(this_thread.initialized);
|
||||
|
||||
@ -2632,6 +2630,11 @@ public:
|
||||
m_type_mask = (QUERY_TYPE_WRITE | QUERY_TYPE_COMMIT);
|
||||
break;
|
||||
|
||||
case TK_XA:
|
||||
m_status = QC_QUERY_TOKENIZED;
|
||||
m_type_mask = QUERY_TYPE_WRITE;
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
@ -639,6 +639,7 @@ columnid(A) ::= nm(X). {
|
||||
VALUE VIEW /*VIRTUAL*/
|
||||
/*WITH*/
|
||||
WORK
|
||||
XA
|
||||
%endif
|
||||
.
|
||||
%wildcard ANY.
|
||||
|
@ -626,6 +626,22 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){
|
||||
/* If it is not a BLOB literal, then it must be an ID, since no
|
||||
** SQL keywords start with the letter 'x'. Fall through */
|
||||
}
|
||||
#endif
|
||||
#ifdef MAXSCALE
|
||||
// It may be the "XA" keyword.
|
||||
// If the next character is 'a' or 'A', followed by whitespace or a
|
||||
// comment, then we are indeed dealing with the "XA" keyword.
|
||||
if (( z[1]=='a' || z[1]=='A' ) &&
|
||||
(sqlite3Isspace(z[2]) || // Whitespace
|
||||
(z[2]=='/' && z[3]=='*') || // Beginning of /* comment
|
||||
(z[2]=='#') || // # eol comment
|
||||
(z[2]=='-' && z[3]=='-' && sqlite3Isspace(z[4])))) { // -- eol comment
|
||||
extern int maxscaleKeyword(int);
|
||||
|
||||
*tokenType = TK_XA;
|
||||
maxscaleKeyword(*tokenType);
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
case CC_ID: {
|
||||
i = 1;
|
||||
|
@ -500,6 +500,7 @@ static Keyword aKeywordTable[] = {
|
||||
#ifdef MAXSCALE
|
||||
{ "WORK", "TK_WORK", ALWAYS },
|
||||
{ "WRITE", "TK_WRITE", ALWAYS },
|
||||
{ "XA", "TK_XA", ALWAYS },
|
||||
#endif
|
||||
{ "ZEROFILL", "TK_ZEROFILL", ALWAYS },
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user