1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Increased test coverage. (CVS 5414)

FossilOrigin-Name: 7cf91e08c08ce515c24c738c7d079f5b81eebee6
This commit is contained in:
drh
2008-07-15 00:27:34 +00:00
parent c2c66a030d
commit 85e9e22b33
13 changed files with 187 additions and 44 deletions

View File

@ -1,5 +1,5 @@
C Delete\sall\sfts3\sindex\sdata\sthe\stable\sbecomes\sempty.\s\sPreviously,\ndeleting\sall\srows\sfrom\san\sfts3\stable\swould\sleave\sa\sbunch\sof\sindex\sdata\ndescribing\sthe\sterms\sof\sthe\soriginal\sdata,\splus\sdeletions\sof\sthose\nterms,\sperhaps\swith\ssome\samount\sof\sit\smerged\stogether\sso\sthe\sdeletions\nknocked\sout\sthe\soriginals.\s\sEven\swhen\sall\srows\swere\sdeleted\sthat\noriginal\sdata\swould\shang\sout,\sthough\seventually\sit\swould\smostly\sbe\noverwritten\sif\snew\sdata\scontained\sthe\ssame\sset\sof\sterms.\s(CVS\s5413) C Increased\stest\scoverage.\s(CVS\s5414)
D 2008-07-14T20:43:15 D 2008-07-15T00:27:35
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4 F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -139,9 +139,9 @@ F src/pager.h 6aa3050a3c684475a5a9dbad5ff1cebad612acba
F src/parse.y 097bff733e89fbf554a07d9327046718ce364011 F src/parse.y 097bff733e89fbf554a07d9327046718ce364011
F src/pragma.c 6fad83fbcc7ec6e76d91fe2805fe972ff3af6a0c F src/pragma.c 6fad83fbcc7ec6e76d91fe2805fe972ff3af6a0c
F src/prepare.c c9bb0aacb7a571d049805699ed18f2bb136ea091 F src/prepare.c c9bb0aacb7a571d049805699ed18f2bb136ea091
F src/printf.c 36895cfc04fd235af3a6cc162078d751b88bd811 F src/printf.c 2174222bc346a11b1eac2a654ccc4f635355ae7e
F src/random.c 5c754319d38abdd6acd74601ee0105504adc508a F src/random.c 5c754319d38abdd6acd74601ee0105504adc508a
F src/select.c b909e21358f141627d1cadfdfbdb43ec08ed0a4b F src/select.c 972bdef5063d1ec2b6375f8bf07e3eec2d5bb1cb
F src/shell.c 4b835fe734304ac22a3385868cd3790c1e4f7aa1 F src/shell.c 4b835fe734304ac22a3385868cd3790c1e4f7aa1
F src/sqlite.h.in f85aad3e88f382474407672ad5950c5d4328826d F src/sqlite.h.in f85aad3e88f382474407672ad5950c5d4328826d
F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e
@ -161,7 +161,7 @@ F src/test8.c 3b85c05b15ccfc6844093791e83d5c8a1e0354ca
F src/test9.c 904ebe0ed1472d6bad17a81e2ecbfc20017dc237 F src/test9.c 904ebe0ed1472d6bad17a81e2ecbfc20017dc237
F src/test_async.c da9f58f49faccd3a26ba89f58de125862351b6e2 F src/test_async.c da9f58f49faccd3a26ba89f58de125862351b6e2
F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad
F src/test_btree.c af13f421952807ceba599bdb63b652ac68cd6c9f F src/test_btree.c 7170e0c922ed3979f2d38f4a3f84728e5740dfc3
F src/test_config.c 7d3c3bb37e12d8ed22c5e0900e1361178b0580a3 F src/test_config.c 7d3c3bb37e12d8ed22c5e0900e1361178b0580a3
F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b
F src/test_func.c 24a556989685495013e08f311ae31c4ef86ddb8c F src/test_func.c 24a556989685495013e08f311ae31c4ef86ddb8c
@ -279,7 +279,7 @@ F test/eval.test 020a21a236667bd4c56205d999c9992f1d944cac
F test/exclusive.test 5390ddf1f90a6d055111c0ebe6311045dd3035e1 F test/exclusive.test 5390ddf1f90a6d055111c0ebe6311045dd3035e1
F test/exclusive2.test d13bf66753dca46e61241d35d36ab7c868b0d313 F test/exclusive2.test d13bf66753dca46e61241d35d36ab7c868b0d313
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7 F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
F test/expr.test 5c606f12045dd640ede7f840270340baf5ef1450 F test/expr.test a34267926f2f4b3a8ae6b7c8614fd8fb2fe251af
F test/filectrl.test 524853082d5d7fb442599730ec3a0f3f84a3a936 F test/filectrl.test 524853082d5d7fb442599730ec3a0f3f84a3a936
F test/filefmt.test 053b622009fbbb74dd37921ffad374d852c13cd8 F test/filefmt.test 053b622009fbbb74dd37921ffad374d852c13cd8
F test/fkey1.test dcb4f28eb22d5141f15161d6bdca9a4f58c95729 F test/fkey1.test dcb4f28eb22d5141f15161d6bdca9a4f58c95729
@ -335,7 +335,7 @@ F test/fts3b.test b3a25180a633873d37d86e1ccd00ed690d37237a
F test/fts3c.test 4c7ef29b37aca3e8ebb6a39b57910caa6506034e F test/fts3c.test 4c7ef29b37aca3e8ebb6a39b57910caa6506034e
F test/fts3d.test 12ad44b84e2b71b4217288747a9744201f779892 F test/fts3d.test 12ad44b84e2b71b4217288747a9744201f779892
F test/fts3near.test 2d4dadcaac5025ab65bb87e66c45f39e92966194 F test/fts3near.test 2d4dadcaac5025ab65bb87e66c45f39e92966194
F test/func.test 1a2476c57e34c79aeb6323d3e3700a8c7a1ee0af F test/func.test 92f017ac3c1fb85c8015800aa578a1d588a237a4
F test/fuzz.test 62fc19dd36a427777fd671b569df07166548628a F test/fuzz.test 62fc19dd36a427777fd671b569df07166548628a
F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb
F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731 F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731
@ -420,7 +420,7 @@ F test/misc5.test 0b68dcb630d44af2dbcdca94dd2b17c8d580f6fa
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
F test/misc7.test b0d80b95dc2b46ce417cf3e06bfff18166e55181 F test/misc7.test b0d80b95dc2b46ce417cf3e06bfff18166e55181
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33 F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
F test/mutex1.test c4fed76ad88646e6cfab0435fd89f5fc72da4dde F test/mutex1.test 7f5e21fd11fe22de079e5dcd394ee4f6c257e68e
F test/mutex2.test 240cfcb5093d2702790a918b4666d5858323e006 F test/mutex2.test 240cfcb5093d2702790a918b4666d5858323e006
F test/nan.test 14c41572ff52dbc740b1c3303dd313a90dc6084c F test/nan.test 14c41572ff52dbc740b1c3303dd313a90dc6084c
F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82 F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82
@ -447,7 +447,7 @@ F test/rtree.test b85fd4f0861a40ca366ac195e363be2528dcfadf
F test/safety.test b69e2b2dd5d52a3f78e216967086884bbc1a09c6 F test/safety.test b69e2b2dd5d52a3f78e216967086884bbc1a09c6
F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c
F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e
F test/select1.test 0c7ed6dbe1c54b45dc850d8a7df8a8462bb3e34e F test/select1.test e66c18df883aa2a3b883d5b0aeece3fa64053a9b
F test/select2.test 272a3d3e35b1d3a0760168ababf555e656357fc4 F test/select2.test 272a3d3e35b1d3a0760168ababf555e656357fc4
F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054 F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
F test/select4.test 0618c9377013840194b7901e6224d841cd3e7193 F test/select4.test 0618c9377013840194b7901e6224d841cd3e7193
@ -456,7 +456,7 @@ F test/select6.test 1131113eb6ae398069a8bc2173eb6c9a2d8ff1cd
F test/select7.test 7906735805cfbee4dddc0bed4c14e68d7f5f9c5f F test/select7.test 7906735805cfbee4dddc0bed4c14e68d7f5f9c5f
F test/select8.test 391de11bdd52339c30580dabbbbe97e3e9a3c79d F test/select8.test 391de11bdd52339c30580dabbbbe97e3e9a3c79d
F test/select9.test b4007b15396cb7ba2615cab31e1973b572e43210 F test/select9.test b4007b15396cb7ba2615cab31e1973b572e43210
F test/selectA.test e4501789a1d0fe9d00db15187623fb5b7031357b F test/selectA.test 09c6b889f2307c8177b19bd3c58e4e0ea00aa79e
F test/selectB.test 59c1caf267b0cab464b6f40846c6163816a95fa9 F test/selectB.test 59c1caf267b0cab464b6f40846c6163816a95fa9
F test/server1.test f5b790d4c0498179151ca8a7715a65a7802c859c F test/server1.test f5b790d4c0498179151ca8a7715a65a7802c859c
F test/shared.test b9f3bbd3ba727c5f1f8c815b7d0199262aacf214 F test/shared.test b9f3bbd3ba727c5f1f8c815b7d0199262aacf214
@ -477,9 +477,9 @@ F test/speed3.test e312d7e442a5047d730569fdae2ba99bc94e1a13
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
F test/sqllimits1.test bfa4ffaeb287f04f0f082abcb5d7581daaaa9bf3 F test/sqllimits1.test 2f7ca3c7e7cef39a9c499e941e98b7f1708c4780
F test/subquery.test d78fe135ff01a3f91f0b62915740f90b35f7e951 F test/subquery.test d78fe135ff01a3f91f0b62915740f90b35f7e951
F test/subselect.test 974e87f8fc91c5f00dd565316d396a5a6c3106c4 F test/subselect.test 61267b87828155e9e67681252cfe1603641c3547
F test/substr.test 4be572ac017143e59b4058dc75c91a0d0dc6d4e0 F test/substr.test 4be572ac017143e59b4058dc75c91a0d0dc6d4e0
F test/sync.test ded6b39d8d8ca3c0c5518516c6371b3316d3e3a3 F test/sync.test ded6b39d8d8ca3c0c5518516c6371b3316d3e3a3
F test/table.test 13b1c2e2fb4727b35ee1fb7641fc469214fd2455 F test/table.test 13b1c2e2fb4727b35ee1fb7641fc469214fd2455
@ -576,7 +576,7 @@ F test/vtabC.test 9f2d9eb84bf65e606d6616f20977c5a32a11f548
F test/vtab_alter.test 3a299749fee97ca3d53bd55717f536e4a2284856 F test/vtab_alter.test 3a299749fee97ca3d53bd55717f536e4a2284856
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
F test/vtab_shared.test c19b2555b807ef2ee014c882cdda5bc8d84fcf48 F test/vtab_shared.test c19b2555b807ef2ee014c882cdda5bc8d84fcf48
F test/where.test a2b6b45a9f38a1b2bdc021aecfc677f6d9afde63 F test/where.test 4f1b9a403bba6855681eb7e7e9230e5decb67309
F test/where2.test 7012c0ad022a54430dd22c98288d3f4d6599dbcf F test/where2.test 7012c0ad022a54430dd22c98288d3f4d6599dbcf
F test/where3.test 97d3936e6a443b968f1a61cdcc0f673252000e94 F test/where3.test 97d3936e6a443b968f1a61cdcc0f673252000e94
F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2 F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
@ -607,7 +607,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 7d5e1c4375599a913d23e5954fa63c10ac9d7688 P 8b872e426091d9ef108e52dbec0d968ed7452907
R 7766dad7431ce3dddf87a600080fac2f R d48e30f805045313ee6396ef33f6a5cc
U shess U drh
Z ce089cda99d0ad780780b717294a1a22 Z 8698cf385c48d5e8ab762a39892fd883

View File

@ -1 +1 @@
8b872e426091d9ef108e52dbec0d968ed7452907 7cf91e08c08ce515c24c738c7d079f5b81eebee6

View File

@ -5,7 +5,7 @@
** an historical reference. Most of the "enhancements" have been backed ** an historical reference. Most of the "enhancements" have been backed
** out so that the functionality is now the same as standard printf(). ** out so that the functionality is now the same as standard printf().
** **
** $Id: printf.c,v 1.91 2008/07/14 12:52:53 drh Exp $ ** $Id: printf.c,v 1.92 2008/07/15 00:27:35 drh Exp $
** **
************************************************************************** **************************************************************************
** **
@ -892,7 +892,7 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
return z; return z;
} }
#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) || defined(SQLITE_MEMDEBUG) #if defined(SQLITE_DEBUG)
/* /*
** A version of printf() that understands %lld. Used for debugging. ** A version of printf() that understands %lld. Used for debugging.
** The printf() built into some versions of windows does not understand %lld ** The printf() built into some versions of windows does not understand %lld

View File

@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite. ** to handle SELECT statements in SQLite.
** **
** $Id: select.c,v 1.455 2008/07/11 21:02:54 drh Exp $ ** $Id: select.c,v 1.456 2008/07/15 00:27:35 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -2281,6 +2281,7 @@ static int generateOutputSubroutine(
break; break;
} }
#if 0 /* Never occurs on an ORDER BY query */
/* If any row exist in the result set, record that fact and abort. /* If any row exist in the result set, record that fact and abort.
*/ */
case SRT_Exists: { case SRT_Exists: {
@ -2288,6 +2289,7 @@ static int generateOutputSubroutine(
/* The LIMIT clause will terminate the loop for us */ /* The LIMIT clause will terminate the loop for us */
break; break;
} }
#endif
/* If this is a scalar select that is part of an expression, then /* If this is a scalar select that is part of an expression, then
** store the results in the appropriate memory cell and break out ** store the results in the appropriate memory cell and break out

View File

@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated ** is not included in the SQLite library. It is used for automated
** testing of the SQLite library. ** testing of the SQLite library.
** **
** $Id: test_btree.c,v 1.5 2008/07/11 21:02:54 drh Exp $ ** $Id: test_btree.c,v 1.6 2008/07/15 00:27:35 drh Exp $
*/ */
#include "btreeInt.h" #include "btreeInt.h"
#include <tcl.h> #include <tcl.h>
@ -48,6 +48,7 @@ int sqlite3BtreeSharedCacheReport(
** Print debugging information about all cursors to standard output. ** Print debugging information about all cursors to standard output.
*/ */
void sqlite3BtreeCursorList(Btree *p){ void sqlite3BtreeCursorList(Btree *p){
#ifdef SQLITE_DEBUG
BtCursor *pCur; BtCursor *pCur;
BtShared *pBt = p->pBt; BtShared *pBt = p->pBt;
for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
@ -59,6 +60,7 @@ void sqlite3BtreeCursorList(Btree *p){
(pCur->eState==CURSOR_VALID) ? "" : " eof" (pCur->eState==CURSOR_VALID) ? "" : " eof"
); );
} }
#endif
} }

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing expressions. # focus of this file is testing expressions.
# #
# $Id: expr.test,v 1.62 2008/01/22 01:48:09 drh Exp $ # $Id: expr.test,v 1.63 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -144,6 +144,7 @@ test_expr expr-1.106 {i1=0} {(1<<63)/-1} -9223372036854775808
test_expr expr-1.107 {i1=0} {(1<<63)%-1} 0 test_expr expr-1.107 {i1=0} {(1<<63)%-1} 0
test_expr expr-1.108 {i1=0} {1%0} {{}} test_expr expr-1.108 {i1=0} {1%0} {{}}
test_expr expr-1.109 {i1=0} {1/0} {{}} test_expr expr-1.109 {i1=0} {1/0} {{}}
test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807
test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57
test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions. # focus of this file is testing built-in functions.
# #
# $Id: func.test,v 1.81 2008/07/07 14:50:14 drh Exp $ # $Id: func.test,v 1.82 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -290,6 +290,18 @@ do_test func-8.4 {
SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t3; SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t3;
} }
} {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP} } {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP}
do_test func-8.5 {
execsql {
SELECT sum(x) FROM (SELECT '9223372036' || '854775807' AS x
UNION ALL SELECT -9223372036854775807)
}
} {0}
do_test func-8.6 {
execsql {
SELECT sum(x) FROM (SELECT '9223372036' || '854775808' AS x
UNION ALL SELECT -9223372036854775807)
}
} {1.0}
# How do you test the random() function in a meaningful, deterministic way? # How do you test the random() function in a meaningful, deterministic way?
# #

View File

@ -9,7 +9,7 @@
# #
#*********************************************************************** #***********************************************************************
# #
# $Id: mutex1.test,v 1.9 2008/07/12 15:55:55 danielk1977 Exp $ # $Id: mutex1.test,v 1.10 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -138,16 +138,18 @@ sqlite3_enable_shared_cache $enable_shared_cache
# Open and use a connection in "nomutex" mode. Test that no recursive # Open and use a connection in "nomutex" mode. Test that no recursive
# mutexes are obtained. # mutexes are obtained.
do_test mutex1.3.1 { ifcapable threadsafe {
catch {db close} do_test mutex1.3.1 {
clear_mutex_counters catch {db close}
sqlite3 db test.db -nomutex 1 clear_mutex_counters
execsql { SELECT * FROM abc } sqlite3 db test.db -nomutex 1
} {1 2 3 1 2 3 1 2 3} execsql { SELECT * FROM abc }
do_test mutex1.3.2 { } {1 2 3 1 2 3 1 2 3}
mutex_counters counters do_test mutex1.3.2 {
set counters(recursive) mutex_counters counters
} {0} set counters(recursive)
} {0}
}
do_test mutex1-X { do_test mutex1-X {
catch {db close} catch {db close}

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement. # focus of this file is testing the SELECT statement.
# #
# $Id: select1.test,v 1.63 2008/07/10 00:32:42 drh Exp $ # $Id: select1.test,v 1.64 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -405,7 +405,7 @@ do_test select1-5.1 {
lappend v $msg lappend v $msg
} {0 33} } {0 33}
execsql {CREATE TABLE test2(t1 test, t2 text)} execsql {CREATE TABLE test2(t1 text, t2 text)}
execsql {INSERT INTO test2 VALUES('abc','xyz')} execsql {INSERT INTO test2 VALUES('abc','xyz')}
# Check for column naming # Check for column naming
@ -552,6 +552,59 @@ do_test select1-6.9.8 {
regsub -all {subquery_[0-9a-fA-F]+_} $x {subquery} x regsub -all {subquery_[0-9a-fA-F]+_} $x {subquery} x
set x set x
} {a.f1 11 a.f2 22 b.x 5 b.y 6} } {a.f1 11 a.f2 22 b.x 5 b.y 6}
do_test select1-6.9.9 {
execsql2 {
SELECT a.f1, b.f2 FROM test1 a, test1 b LIMIT 1
}
} {test1.f1 11 test1.f2 22}
do_test select1-6.9.10 {
execsql2 {
SELECT f1, t1 FROM test1, test2 LIMIT 1
}
} {test1.f1 11 test2.t1 abc}
do_test select1-6.9.11 {
db eval {
PRAGMA short_column_names=ON;
PRAGMA full_column_names=ON;
}
execsql2 {
SELECT a.f1, b.f2 FROM test1 a, test1 b LIMIT 1
}
} {test1.f1 11 test1.f2 22}
do_test select1-6.9.12 {
execsql2 {
SELECT f1, t1 FROM test1, test2 LIMIT 1
}
} {test1.f1 11 test2.t1 abc}
do_test select1-6.9.13 {
db eval {
PRAGMA short_column_names=ON;
PRAGMA full_column_names=OFF;
}
execsql2 {
SELECT a.f1, b.f1 FROM test1 a, test1 b LIMIT 1
}
} {f1 11 f1 11}
do_test select1-6.9.14 {
execsql2 {
SELECT f1, t1 FROM test1, test2 LIMIT 1
}
} {f1 11 t1 abc}
do_test select1-6.9.15 {
db eval {
PRAGMA short_column_names=OFF;
PRAGMA full_column_names=ON;
}
execsql2 {
SELECT a.f1, b.f1 FROM test1 a, test1 b LIMIT 1
}
} {test1.f1 11 test1.f1 11}
do_test select1-6.9.16 {
execsql2 {
SELECT f1, t1 FROM test1, test2 LIMIT 1
}
} {test1.f1 11 test2.t1 abc}
db eval { db eval {
PRAGMA short_column_names=ON; PRAGMA short_column_names=ON;

View File

@ -17,7 +17,7 @@
# explicit sort order and explicit collating secquites) and # explicit sort order and explicit collating secquites) and
# with and without optional LIMIT and OFFSET clauses. # with and without optional LIMIT and OFFSET clauses.
# #
# $Id: selectA.test,v 1.3 2008/06/25 14:31:53 drh Exp $ # $Id: selectA.test,v 1.4 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -630,6 +630,26 @@ do_test selectA-2.92 {
ORDER BY y COLLATE NOCASE DESC,x,z ORDER BY y COLLATE NOCASE DESC,x,z
} }
} {mad Z z -23 Y y 5200000.0 X x {} U u hare m M abc e e hello d D {} C c 9.9 b B 1 a a} } {mad Z z -23 Y y 5200000.0 X x {} U u hare m M abc e e hello d D {} C c 9.9 b B 1 a a}
do_test selectA-2.93 {
execsql {
SELECT upper((SELECT c FROM t1 UNION SELECT z FROM t2 ORDER BY 1));
}
} {A}
do_test selectA-2.94 {
execsql {
SELECT lower((SELECT c FROM t1 UNION ALL SELECT z FROM t2 ORDER BY 1));
}
} {a}
do_test selectA-2.95 {
execsql {
SELECT lower((SELECT c FROM t1 INTERSECT SELECT z FROM t2 ORDER BY 1));
}
} {{}}
do_test selectA-2.96 {
execsql {
SELECT lower((SELECT z FROM t2 EXCEPT SELECT c FROM t1 ORDER BY 1));
}
} {m}
do_test selectA-3.0 { do_test selectA-3.0 {
@ -1216,6 +1236,38 @@ do_test selectA-3.92 {
ORDER BY y COLLATE NOCASE DESC,x,z ORDER BY y COLLATE NOCASE DESC,x,z
} }
} {mad Z z -23 Y y 5200000.0 X x {} U u hare m M abc e e hello d D {} C c 9.9 b B 1 a a} } {mad Z z -23 Y y 5200000.0 X x {} U u hare m M abc e e hello d D {} C c 9.9 b B 1 a a}
do_test selectA-3.93 {
execsql {
SELECT upper((SELECT c FROM t1 UNION SELECT z FROM t2 ORDER BY 1));
}
} {A}
do_test selectA-3.94 {
execsql {
SELECT lower((SELECT c FROM t1 UNION ALL SELECT z FROM t2 ORDER BY 1));
}
} {a}
do_test selectA-3.95 {
execsql {
SELECT lower((SELECT c FROM t1 INTERSECT SELECT z FROM t2 ORDER BY 1));
}
} {{}}
do_test selectA-3.96 {
execsql {
SELECT lower((SELECT z FROM t2 EXCEPT SELECT c FROM t1 ORDER BY 1));
}
} {m}
do_test selectA-3.97 {
execsql {
SELECT upper((SELECT x FROM (
SELECT x,y,z FROM t2
INTERSECT SELECT a,b,c FROM t3
EXCEPT SELECT c,b,a FROM t1
UNION SELECT a,b,c FROM t3
INTERSECT SELECT a,b,c FROM t3
EXCEPT SELECT c,b,a FROM t1
UNION SELECT a,b,c FROM t3
ORDER BY y COLLATE NOCASE DESC,x,z)))
}
} {MAD}
finish_test finish_test

View File

@ -12,7 +12,7 @@
# This file contains tests to verify that the limits defined in # This file contains tests to verify that the limits defined in
# sqlite source file limits.h are enforced. # sqlite source file limits.h are enforced.
# #
# $Id: sqllimits1.test,v 1.30 2008/07/10 00:32:42 drh Exp $ # $Id: sqllimits1.test,v 1.31 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -360,9 +360,17 @@ set strvalue [string repeat A $::SQLITE_LIMIT_LENGTH]
do_test sqllimits1-5.16 { do_test sqllimits1-5.16 {
catchsql "SELECT '$strvalue'" catchsql "SELECT '$strvalue'"
} [list 0 $strvalue] } [list 0 $strvalue]
do_test sqllimits1-5.17 { do_test sqllimits1-5.17.1 {
catchsql "SELECT 'A$strvalue'" catchsql "SELECT 'A$strvalue'"
} [list 1 {string or blob too big}] } [list 1 {string or blob too big}]
do_test sqllimits1-5.17.2 {
sqlite3_limit db SQLITE_LIMIT_LENGTH 0x7fffffff
catchsql {SELECT 'A' || $::strvalue}
} [list 0 A$strvalue]
do_test sqllimits1-5.17.3 {
sqlite3_limit db SQLITE_LIMIT_LENGTH $SQLITE_LIMIT_LENGTH
catchsql {SELECT 'A' || $::strvalue}
} [list 1 {string or blob too big}]
set blobvalue [string repeat 41 $::SQLITE_LIMIT_LENGTH] set blobvalue [string repeat 41 $::SQLITE_LIMIT_LENGTH]
do_test sqllimits1-5.18 { do_test sqllimits1-5.18 {
catchsql "SELECT x'$blobvalue'" catchsql "SELECT x'$blobvalue'"

View File

@ -12,7 +12,7 @@
# focus of this file is testing SELECT statements that are part of # focus of this file is testing SELECT statements that are part of
# expressions. # expressions.
# #
# $Id: subselect.test,v 1.14 2007/04/12 03:54:39 drh Exp $ # $Id: subselect.test,v 1.15 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -53,9 +53,15 @@ do_test subselect-1.3b {
do_test subselect-1.3c { do_test subselect-1.3c {
execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=6)} execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=6)}
} {6} } {6}
do_test subselect-1.3c { do_test subselect-1.3d {
execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=8)} execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=8)}
} {} } {}
do_test subselect-1.3e {
execsql {
SELECT b FROM t1
WHERE a = (SELECT a FROM t1 UNION SELECT b FROM t1 ORDER BY 1);
}
} {2}
# What if the subselect doesn't return any value. We should get # What if the subselect doesn't return any value. We should get
# NULL as the result. Check it out. # NULL as the result. Check it out.

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the use of indices in WHERE clases. # focus of this file is testing the use of indices in WHERE clases.
# #
# $Id: where.test,v 1.45 2008/07/12 14:52:21 drh Exp $ # $Id: where.test,v 1.46 2008/07/15 00:27:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -344,6 +344,11 @@ do_test where-4.6 {
SELECT 99 WHERE 0.0 SELECT 99 WHERE 0.0
} }
} {} } {}
do_test where-4.7 {
execsql {
SELECT count(*) FROM t1 WHERE t1.w
}
} {100}
# Verify that IN operators in a WHERE clause are handled correctly. # Verify that IN operators in a WHERE clause are handled correctly.
# Omit these tests if the build is not capable of sub-queries. # Omit these tests if the build is not capable of sub-queries.