1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-12 23:22:53 +03:00

When adding the implied "LIMIT 1" to the end of a scalar subquery, make sure

that subquery is not a VALUES-only query as such queries cannot deal with
LIMIT clauses.

FossilOrigin-Name: 7c27310bdf6b4af44a0811a2787ed64966d720d2
This commit is contained in:
drh
2015-04-15 05:20:44 +00:00
parent 0ec68f845c
commit 1978d171cb
4 changed files with 16 additions and 8 deletions

View File

@@ -2016,6 +2016,7 @@ int sqlite3CodeSubselect(
pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0,
&sqlite3IntTokens[1]);
pSel->iLimit = 0;
pSel->selFlags &= ~SF_AllValues;
if( sqlite3Select(pParse, pSel, &dest) ){
return 0;
}