Fix the generate_series virtual table so that it correctly returns no

rows if any of its constraints are NULL.
Ticket [fac496b61722daf28].

FossilOrigin-Name: 3328e828e28ca7198fd1ce84503e649ab2278913a2cf85a0f0391f31d0c9c8d7
This commit is contained in:
drh
2018-04-03 14:25:51 +00:00
parent 9881155d54
commit 92a2ec00eb
3 changed files with 16 additions and 7 deletions
+9
View File
@@ -270,6 +270,15 @@ static int seriesFilter(
}else{
pCur->iStep = 1;
}
for(i=0; i<argc; i++){
if( sqlite3_value_type(argv[i])==SQLITE_NULL ){
/* If any of the constraints have a NULL value, then return no rows.
** See ticket https://www.sqlite.org/src/info/fac496b61722daf2 */
pCur->mnValue = 1;
pCur->mxValue = 0;
break;
}
}
if( idxNum & 8 ){
pCur->isDesc = 1;
pCur->iValue = pCur->mxValue;