MXS-1337 Better sqlite3 initialization

The sqlite3 initialization is done a bit more properly now.
It is also ensured that issues are logged at most once, even
if a statement is parsed twice.
This commit is contained in:
Johan Wikman
2017-08-08 15:58:28 +03:00
parent 05ac06c901
commit aeb881afea
2 changed files with 92 additions and 38 deletions

View File

@ -186,6 +186,15 @@ int exposed_sqlite3Dequote(char *z)
return sqlite3Dequote(z);
}
void exposed_sqlite3Insert(Parse* pParse,
SrcList* pTabList,
Select* pSelect,
IdList* pColumns,
int onError)
{
sqlite3Insert(pParse, pTabList, pSelect, pColumns, onError);
}
void exposed_sqlite3EndTable(Parse* pParse, Token* pCons, Token* pEnd, u8 tabOpts, Select* pSelect)
{
sqlite3EndTable(pParse, pCons, pEnd, tabOpts, pSelect);
@ -207,6 +216,11 @@ void exposed_sqlite3StartTable(Parse *pParse, /* Parser context */
sqlite3StartTable(pParse, pName1, pName2, isTemp, isView, isVirtual, noErr);
}
void exposed_sqlite3Update(Parse* pParse, SrcList* pTabList, ExprList* pChanges, Expr* pWhere, int onError)
{
sqlite3Update(pParse, pTabList, pChanges, pWhere, onError);
}
/*
** Disable all error recovery processing in the parser push-down
** automaton.
@ -1631,7 +1645,6 @@ cmd ::= with(W) insert_cmd(R) INTO fullname(X) idlist_opt(F) select(S). {
#else
sqlite3Insert(pParse, X, S, F, R);
#endif
sqlite3SelectDelete(pParse->db, S);
}
cmd ::= with(W) insert_cmd(R) INTO fullname(X) idlist_opt(F) DEFAULT VALUES.
{
@ -1653,7 +1666,6 @@ cmd ::= with(W) insert_cmd(R) fullname(X) idlist_opt(F) DEFAULT VALUES.
cmd ::= with(W) insert_cmd(R) fullname(X) idlist_opt(F) select(S). {
sqlite3WithPush(pParse, W, 1);
mxs_sqlite3Insert(pParse, X, S, F, R, 0);
sqlite3SelectDelete(pParse->db, S);
}
%type col_name {ExprSpan}