diff options
author | dan <dan@noemail.net> | 2018-01-23 16:38:57 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2018-01-23 16:38:57 +0000 |
commit | a916b570137f728a04d4a3be0cb792dd5a22cf63 (patch) | |
tree | 1ad6e04b1812d53ab77fd715822afb08bd5bff96 /src | |
parent | 61d04974f06ad307a56442602c910783f7fa02a0 (diff) | |
download | sqlite-a916b570137f728a04d4a3be0cb792dd5a22cf63.tar.gz sqlite-a916b570137f728a04d4a3be0cb792dd5a22cf63.zip |
Fix a bug causing spurious "sub-select returns N columns expected 1" errors
in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause.
FossilOrigin-Name: 14dfd96f9bca2df5033b2d894bf63cc8bf450a45ca11df5e3bbb814fdf96b656
Diffstat (limited to 'src')
-rw-r--r-- | src/wherecode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 32dd2048b..8e8672ff9 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -2170,6 +2170,12 @@ Bitmask sqlite3WhereCodeOneLoopStart( WO_EQ|WO_IN|WO_IS, 0); if( pAlt==0 ) continue; if( pAlt->wtFlags & (TERM_CODED) ) continue; + if( (pAlt->eOperator & WO_IN) + && (pAlt->pExpr->flags & EP_xIsSelect) + && (pAlt->pExpr->x.pSelect->pEList->nExpr>1) + ){ + continue; + } testcase( pAlt->eOperator & WO_EQ ); testcase( pAlt->eOperator & WO_IS ); testcase( pAlt->eOperator & WO_IN ); |