1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix corer cases of vector IN operators where the RHS is a compound SELECT

that includes an ORDER BY clause.

FossilOrigin-Name: 8329ac6f8d1edcc19c3e0559abe9a8011dbe1497
This commit is contained in:
drh
2016-09-06 18:51:25 +00:00
parent 773d3afaa3
commit 1431807a0b
4 changed files with 18 additions and 16 deletions

View File

@@ -2631,17 +2631,15 @@ static int generateOutputSubroutine(
}
#ifndef SQLITE_OMIT_SUBQUERY
/* If we are creating a set for an "expr IN (SELECT ...)" construct,
** then there should be a single item on the stack. Write this
** item into the set table with bogus data.
/* If we are creating a set for an "expr IN (SELECT ...)".
*/
case SRT_Set: {
int r1;
assert( pIn->nSdst==1 || pParse->nErr>0 );
testcase( pIn->nSdst>1 && pParse->nErr==0 );
r1 = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst,
r1, pDest->zAffSdst,1);
sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, 1);
r1, pDest->zAffSdst, pIn->nSdst);
sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst);
sqlite3VdbeAddOp2(v, OP_IdxInsert, pDest->iSDParm, r1);
sqlite3ReleaseTempReg(pParse, r1);
break;