Merge branch '2.0' into 2.1

This commit is contained in:
Johan Wikman
2017-03-07 11:45:00 +02:00
6 changed files with 84 additions and 0 deletions

View File

@ -1778,6 +1778,17 @@ void mxs_sqlite3Update(Parse* pParse, SrcList* pTabList, ExprList* pChanges, Exp
exposed_sqlite3ExprDelete(pParse->db, pWhere);
}
void mxs_sqlite3Savepoint(Parse *pParse, int op, Token *pName)
{
QC_TRACE();
QC_SQLITE_INFO* info = this_thread.info;
ss_dassert(info);
info->status = QC_QUERY_PARSED;
info->type_mask = QUERY_TYPE_WRITE;
}
void maxscaleCollectInfoFromSelect(Parse* pParse, Select* pSelect, int sub_select)
{
QC_SQLITE_INFO* info = this_thread.info;

View File

@ -99,6 +99,7 @@ extern void mxs_sqlite3DropTable(Parse*, SrcList*, int, int, int);
extern void mxs_sqlite3EndTable(Parse*, Token*, Token*, u8, Select*, SrcList*);
extern void mxs_sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int,ExprList*);
extern void mxs_sqlite3RollbackTransaction(Parse*);
extern void mxs_sqlite3Savepoint(Parse *pParse, int op, Token *pName);
extern int mxs_sqlite3Select(Parse*, Select*, SelectDest*);
extern void mxs_sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
extern void mxs_sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
@ -339,6 +340,22 @@ cmd ::= END trans_opt. {sqlite3CommitTransaction(pParse);}
cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);}
%endif
%ifdef MAXSCALE
savepoint_opt ::= SAVEPOINT.
savepoint_opt ::= .
work_opt ::= WORK.
work_opt ::= .
cmd ::= SAVEPOINT nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &X);
}
cmd ::= RELEASE savepoint_opt nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &X);
}
cmd ::= ROLLBACK work_opt TO savepoint_opt nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &X);
}
%endif
%ifndef MAXSCALE
savepoint_opt ::= SAVEPOINT.
savepoint_opt ::= .
@ -603,6 +620,7 @@ columnid(A) ::= nm(X). {
UNSIGNED
VALUE VIEW /*VIRTUAL*/
/*WITH*/
WORK
%endif
.
%wildcard ANY.

View File

@ -462,6 +462,7 @@ static Keyword aKeywordTable[] = {
{ "WHEN", "TK_WHEN", ALWAYS },
{ "WHERE", "TK_WHERE", ALWAYS },
#ifdef MAXSCALE
{ "WORK", "TK_WORK", ALWAYS },
{ "WRITE", "TK_WRITE", ALWAYS },
#endif
{ "ZEROFILL", "TK_ZEROFILL", ALWAYS },