Improved tests for the carray() table-valued function.

FossilOrigin-Name: 83a099f139aba03edac19c890a0019e922032a25
This commit is contained in:
drh 2017-02-03 15:16:25 +00:00
parent 1101ae4113
commit 59a40db3d2
3 changed files with 31 additions and 24 deletions

View File

@ -1,5 +1,5 @@
C Ensure\sthat\sall\scursors\shave\stheir\spositions\ssaved\sprior\sto\srolling\sback\na\ssavepoint.
D 2017-02-02T20:32:28.731
C Improved\stests\sfor\sthe\scarray()\stable-valued\sfunction.
D 2017-02-03T15:16:25.769
F Makefile.in 5f415e7867296d678fed2e6779aea10c1318b4bc
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc ba953c8921fc7e18333f61898007206de7e23964
@ -1155,7 +1155,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 8b2ef53caa37854864c89e1e57e8a10efd4f5e43
F test/tabfunc01.test 699251cb99651415218a891384510a685c7ab012
F test/table.test b708f3e5fa2542fa51dfab21fc07b36ea445cb2f
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
@ -1552,8 +1552,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 5a0da77c22ebc7db5e63b1520d30f3ad97b9bb3b 01d97e5b6502b1811b52a681f445e1aaae6c0ee6
R f67fbd165c607c8ab8b9fb8cff6e4d0d
T +closed 01d97e5b6502b1811b52a681f445e1aaae6c0ee6
P 8e03a8e95fada5c24d369672a71f6e02288051da
R 408679a2eb27f8712868946a0e8b1f65
U drh
Z d16d6898d272ff11e9984476ae1d9ef3
Z 773cdc68fe82e971a45f4eb8ed248cd4

View File

@ -1 +1 @@
8e03a8e95fada5c24d369672a71f6e02288051da
83a099f139aba03edac19c890a0019e922032a25

View File

@ -148,60 +148,68 @@ do_execsql_test tabfunc01-600 {
do_test tabfunc01-700 {
set PTR [intarray_addr 5 7 13 17 23]
set PTR1 [intarray_addr 5 7 13 17 23]
db eval {
SELECT b FROM t600, carray($PTR,5) WHERE a=value;
SELECT b FROM t600, carray($PTR1,5) WHERE a=value;
}
} {(005) (007) (013) (017) (023)}
do_test tabfunc01-701 {
db eval {
SELECT b FROM t600 WHERE a IN carray($PTR,5,'int32');
SELECT b FROM t600 WHERE a IN carray($PTR1,5,'int32');
}
} {(005) (007) (013) (017) (023)}
do_test tabfunc01-702 {
db eval {
SELECT b FROM t600 WHERE a IN carray($PTR,4,'int32');
SELECT b FROM t600 WHERE a IN carray($PTR1,4,'int32');
}
} {(005) (007) (013) (017)}
do_catchsql_test tabfunc01-710 {
SELECT b FROM t600 WHERE a IN carray($PTR,5,'int33');
SELECT b FROM t600 WHERE a IN carray($PTR1,5,'int33');
} {1 {unknown datatype: 'int33'}}
do_test tabfunc01-720 {
set PTR [int64array_addr 5 7 13 17 23]
set PTR2 [int64array_addr 5 7 13 17 23]
db eval {
SELECT b FROM t600, carray($PTR,5,'int64') WHERE a=value;
SELECT b FROM t600, carray($PTR2,5,'int64') WHERE a=value;
}
} {(005) (007) (013) (017) (023)}
do_test tabfunc01-721 {
db eval {
SELECT remember(123,$PTR);
SELECT value FROM carray($PTR,5,'int64');
SELECT remember(123,$PTR2);
SELECT value FROM carray($PTR2,5,'int64');
}
} {123 123 7 13 17 23}
do_test tabfunc01-722 {
set PTR2 [expr {$PTR+16}]
set PTR3 [expr {$PTR2+16}]
db eval {
SELECT remember(987,$PTR2);
SELECT value FROM carray($PTR,5,'int64');
SELECT remember(987,$PTR3);
SELECT value FROM carray($PTR2,5,'int64');
}
} {987 123 7 987 17 23}
do_test tabfunc01-730 {
set PTR [doublearray_addr 5.0 7.0 13.0 17.0 23.0]
set PTR4 [doublearray_addr 5.0 7.0 13.0 17.0 23.0]
db eval {
SELECT b FROM t600, carray($PTR,5,'double') WHERE a=value;
SELECT b FROM t600, carray($PTR4,5,'double') WHERE a=value;
}
} {(005) (007) (013) (017) (023)}
do_test tabfunc01-740 {
set PTR [textarray_addr 5 7 13 17 23]
set PTR5 [textarray_addr x5 x7 x13 x17 x23]
db eval {
SELECT b FROM t600, carray($PTR,5,'char*') WHERE a=value;
SELECT b FROM t600, carray($PTR5,5,'char*') WHERE a=trim(value,'x');
}
} {(005) (007) (013) (017) (023)}
do_test tabfunc01-750 {
db eval {
SELECT aa.value, bb.value, '|'
FROM carray($PTR4,5,'double') AS aa
JOIN carray($PTR5,5,'char*') AS bb ON aa.rowid=bb.rowid;
}
} {5.0 x5 | 7.0 x7 | 13.0 x13 | 17.0 x17 | 23.0 x23 |}
# Free up memory allocations
intarray_addr
int64array_addr
doublearray_addr