Fix an off-by-one comparison in the intarray() virtual table. Get the
intarray() virtual table tests working using the legacy makefile. FossilOrigin-Name: 7c3d441f2a9f642f3d91dcee854a4d16d298bc34
This commit is contained in:
parent
2519b2a3e5
commit
ba637157ca
@ -25,7 +25,7 @@
|
||||
** The intarray "function" is really a virtual table with the
|
||||
** following schema:
|
||||
**
|
||||
** CREATE FUNCTION intarray(
|
||||
** CREATE TABLE intarray(
|
||||
** value,
|
||||
** pointer HIDDEN,
|
||||
** count HIDDEN
|
||||
@ -168,7 +168,7 @@ static int intarrayRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
|
||||
*/
|
||||
static int intarrayEof(sqlite3_vtab_cursor *cur){
|
||||
intarray_cursor *pCur = (intarray_cursor*)cur;
|
||||
return pCur->iRowid>=pCur->iCnt;
|
||||
return pCur->iRowid>pCur->iCnt;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -181,7 +181,6 @@ static int intarrayFilter(
|
||||
int argc, sqlite3_value **argv
|
||||
){
|
||||
intarray_cursor *pCur = (intarray_cursor *)pVtabCursor;
|
||||
int i = 0;
|
||||
if( idxNum ){
|
||||
pCur->iPtr = sqlite3_value_int64(argv[0]);
|
||||
pCur->iCnt = sqlite3_value_int64(argv[1]);
|
||||
@ -210,10 +209,8 @@ static int intarrayBestIndex(
|
||||
sqlite3_index_info *pIdxInfo
|
||||
){
|
||||
int i; /* Loop over constraints */
|
||||
int idxNum = 0; /* The query plan bitmask */
|
||||
int ptrIdx = -1; /* Index of the pointer= constraint, or -1 if none */
|
||||
int cntIdx = -1; /* Index of the count= constraint, or -1 if none */
|
||||
int nArg = 0; /* Number of arguments that intarrayFilter() expects */
|
||||
|
||||
const struct sqlite3_index_constraint *pConstraint;
|
||||
pConstraint = pIdxInfo->aConstraint;
|
||||
|
1
main.mk
1
main.mk
@ -324,6 +324,7 @@ TESTSRC = \
|
||||
#
|
||||
TESTSRC += \
|
||||
$(TOP)/ext/misc/amatch.c \
|
||||
$(TOP)/ext/misc/array.c \
|
||||
$(TOP)/ext/misc/closure.c \
|
||||
$(TOP)/ext/misc/csv.c \
|
||||
$(TOP)/ext/misc/eval.c \
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Merge\sthe\salternative\stable-valued\sfunction\sRHS\sof\sIN\soperator\simplementation\nfrom\strunk.
|
||||
D 2016-07-02T20:51:31.298
|
||||
C Fix\san\soff-by-one\scomparison\sin\sthe\sintarray()\svirtual\stable.\s\sGet\sthe\nintarray()\svirtual\stable\stests\sworking\susing\sthe\slegacy\smakefile.
|
||||
D 2016-07-02T20:57:06.871
|
||||
F Makefile.in 541d493154ec3b0b20b2f1d495ec66f55905191e
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc 50149765ef72f4e652b9a0f1f6462c4784bb9423
|
||||
@ -204,7 +204,7 @@ F ext/icu/README.txt d9fbbad0c2f647c3fdf715fc9fd64af53aedfc43
|
||||
F ext/icu/icu.c 43df9d8ef2fae7a325100ebd713ab089dc829dd7
|
||||
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
|
||||
F ext/misc/amatch.c 211108e201105e4bb0c076527b8cfd34330fc234
|
||||
F ext/misc/array.c 20af0591e6611755dd8a9d1124e9c9a8cf42761f
|
||||
F ext/misc/array.c bce2608f123d35eff81ac73e443b0620bed89ca1
|
||||
F ext/misc/closure.c 0d2a038df8fbae7f19de42e7c7d71f2e4dc88704
|
||||
F ext/misc/compress.c 122faa92d25033d6c3f07c39231de074ab3d2e83
|
||||
F ext/misc/csv.c f01126ba170fd4ef7c752b156568a80c912d4441
|
||||
@ -308,7 +308,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 3f669c06db5c4a53ff21dda639247c6310497180
|
||||
F main.mk 162bb978db5519dbcaba141be346247c82b7caa8
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
@ -1116,7 +1116,7 @@ F test/symlink.test c9ebe7330d228249e447038276bfc8a7b22f4849
|
||||
F test/sync.test 2f84bdbc2b2df1fcb0220575b4b9f8cea94b7529
|
||||
F test/syscall.test f59ba4e25f7ba4a4c031026cc2ef8b6e4b4c639c
|
||||
F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04
|
||||
F test/tabfunc01.test 96e56e22e5be82818d9673e9e993e9f26f80079a
|
||||
F test/tabfunc01.test ebcfb548b88f874a5ded67e7c85ca0d5ab31f4b5
|
||||
F test/table.test b708f3e5fa2542fa51dfab21fc07b36ea445cb2f
|
||||
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
|
||||
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
|
||||
@ -1504,7 +1504,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P ba1b441b6003808810667d749635fe6b2e8c6165 bead151e72215e6ca2a90eb049cfca414dccea04
|
||||
R ab2f6bd04c16fa8193c86a3894a34997
|
||||
P 507fdbfb54ce377f0d870260b07d71b797843fcf
|
||||
R 7bb6d7d8a00bd78e137b76d2018230b6
|
||||
U drh
|
||||
Z f71a4b07caffe5df9d8bd19d720e6958
|
||||
Z f5dbc3921a51d0860e9141544e9a9fdc
|
||||
|
@ -1 +1 @@
|
||||
507fdbfb54ce377f0d870260b07d71b797843fcf
|
||||
7c3d441f2a9f642f3d91dcee854a4d16d298bc34
|
@ -201,6 +201,17 @@ do_test tabfunc01-671 {
|
||||
do_test tabfunc01-672 {
|
||||
sqlite3_column_int $VM 0
|
||||
} 11
|
||||
do_test tabfunc01-673 {
|
||||
sqlite3_step $VM
|
||||
sqlite3_column_int $VM 0
|
||||
} 22
|
||||
do_test tabfunc01-674 {
|
||||
sqlite3_step $VM
|
||||
sqlite3_column_int $VM 0
|
||||
} 33
|
||||
do_test tabfunc01-675 {
|
||||
sqlite3_step $VM
|
||||
} {SQLITE_DONE}
|
||||
sqlite3_finalize $VM
|
||||
|
||||
catch {sqlite3_bind_intarray}
|
||||
|
Loading…
x
Reference in New Issue
Block a user