Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Miscellaneous code simplifications and cleanup and test coverage enhancements. (CVS 4730) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
af129b6d158cc90ce9752dd6383c1de4 |
User & Date: | drh 2008-01-19 20:11:26.000 |
Context
2008-01-19
| ||
23:50 | Additional test coverage improvements. Test coverage now stands at 98.73%. (CVS 4731) (check-in: 010f7b780c user: drh tags: trunk) | |
20:11 | Miscellaneous code simplifications and cleanup and test coverage enhancements. (CVS 4730) (check-in: af129b6d15 user: drh tags: trunk) | |
03:35 | Cleanup and simplification of constraint processing. Simplifications to the VM for better test coverage. (CVS 4729) (check-in: d9ebe9d78c user: drh tags: trunk) | |
Changes
Changes to mkopcodeh.awk.
︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | + + | # Assign numbers to all opcodes and output the result. END { cnt = 0 max = 0 print "/* Automatically generated. Do not edit */" print "/* See the mkopcodeh.awk script for details */" op["OP_Noop"] = -1; op["OP_Explain"] = -1; for(name in op){ if( op[name]<0 ){ cnt++ while( used[cnt] ) cnt++ op[name] = cnt } used[op[name]] = 1; |
︙ |
Changes to src/test1.c.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing all sorts of SQLite interfaces. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** |
︙ | |||
4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 | 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | static int vfs_unlink_test( ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */ ){ int i; sqlite3_vfs *pMain; sqlite3_vfs *apVfs[20]; sqlite3_vfs one, two; sqlite3_vfs_unregister(0); /* Unregister of NULL is harmless */ one.zName = "__one"; two.zName = "__two"; /* Calling sqlite3_vfs_register with 2nd argument of 0 does not ** change the default VFS */ pMain = sqlite3_vfs_find(0); sqlite3_vfs_register(&one, 0); assert( pMain==0 || pMain==sqlite3_vfs_find(0) ); sqlite3_vfs_register(&two, 0); assert( pMain==0 || pMain==sqlite3_vfs_find(0) ); /* We can find a VFS by its name */ assert( sqlite3_vfs_find("__one")==&one ); assert( sqlite3_vfs_find("__two")==&two ); /* Calling sqlite_vfs_register with non-zero second parameter changes the ** default VFS, even if the 1st parameter is an existig VFS that is ** previously registered as the non-default. */ sqlite3_vfs_register(&one, 1); assert( sqlite3_vfs_find("__one")==&one ); assert( sqlite3_vfs_find("__two")==&two ); assert( sqlite3_vfs_find(0)==&one ); sqlite3_vfs_register(&two, 1); assert( sqlite3_vfs_find("__one")==&one ); assert( sqlite3_vfs_find("__two")==&two ); assert( sqlite3_vfs_find(0)==&two ); if( pMain ){ sqlite3_vfs_register(pMain, 1); assert( sqlite3_vfs_find("__one")==&one ); assert( sqlite3_vfs_find("__two")==&two ); assert( sqlite3_vfs_find(0)==pMain ); } /* Unlink the default VFS. Repeat until there are no more VFSes ** registered. */ for(i=0; i<sizeof(apVfs)/sizeof(apVfs[0]); i++){ apVfs[i] = sqlite3_vfs_find(0); if( apVfs[i] ){ assert( apVfs[i]==sqlite3_vfs_find(apVfs[i]->zName) ); sqlite3_vfs_unregister(apVfs[i]); assert( 0==sqlite3_vfs_find(apVfs[i]->zName) ); } } assert( 0==sqlite3_vfs_find(0) ); /* Relink all VFSes in reverse order. */ for(i=sizeof(apVfs)/sizeof(apVfs[0])-1; i>=0; i--){ if( apVfs[i] ){ sqlite3_vfs_register(apVfs[i], 1); assert( apVfs[i]==sqlite3_vfs_find(0) ); assert( apVfs[i]==sqlite3_vfs_find(apVfs[i]->zName) ); } } /* Unregister out sample VFSes. */ sqlite3_vfs_unregister(&one); sqlite3_vfs_unregister(&two); /* Unregistering a VFS that is not currently registered is harmless */ sqlite3_vfs_unregister(&one); sqlite3_vfs_unregister(&two); assert( sqlite3_vfs_find("__one")==0 ); assert( sqlite3_vfs_find("__two")==0 ); /* We should be left with the original default VFS back as the ** original */ assert( sqlite3_vfs_find(0)==pMain ); return TCL_OK; } /* ** tclcmd: save_prng_state */ static int save_prng_state( |
︙ |
Changes to src/vdbe.c.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** |
︙ | |||
2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 | 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 | + + + + + + + - + - + - + | /* Opcode: MoveGe P1 P2 P3 * * ** ** Use the value in register P3 as a key. Reposition ** cursor P1 so that it points to the smallest entry that is greater ** than or equal to the key in register P3. ** If there are no records greater than or equal to the key and P2 ** is not zero, then jump to P2. ** ** A special feature of this opcode (and different from the ** related OP_MoveGt, OP_MoveLt, and OP_MoveLe) is that if P2 is ** zero and P1 is an SQL table (a b-tree with integer keys) then ** the seek is deferred until it is actually needed. It might be ** the case that the cursor is never accessed. By deferring the ** seek, we avoid unnecessary seeks. ** ** See also: Found, NotFound, Distinct, MoveLt, MoveGt, MoveLe */ /* Opcode: MoveGt P1 P2 P3 * * ** ** Use the value in register P3 as a key. Reposition ** cursor P1 so that it points to the smallest entry that is greater ** than the key in register P3. |
︙ | |||
2742 2743 2744 2745 2746 2747 2748 | 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 | - + + + | if( pC->pCursor!=0 ){ int res, oc; oc = pOp->opcode; pC->nullRow = 0; *pC->pIncrKey = oc==OP_MoveGt || oc==OP_MoveLe; if( pC->isTable ){ i64 iKey = sqlite3VdbeIntValue(pIn3); |
︙ | |||
2789 2790 2791 2792 2793 2794 2795 2796 | 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 | + - - + - - - | }else{ /* res might be negative because the table is empty. Check to ** see if this is the case. */ res = sqlite3BtreeEof(pC->pCursor); } } assert( pOp->p2>0 ); if( res ){ |
︙ | |||
3002 3003 3004 3005 3006 3007 3008 | 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 | - + | /* res might be uninitialized if rc!=SQLITE_OK. But if rc!=SQLITE_OK ** processing is about to abort so we really do not care whether or not ** the following jump is taken. (In other words, do not stress over ** the error that valgrind sometimes shows on the next statement when ** running ioerr.test and similar failure-recovery test scripts.) */ if( res!=0 ){ pc = pOp->p2 - 1; |
︙ | |||
3152 3153 3154 3155 3156 3157 3158 | 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 | - - - + + - - - + + - + | } } if( pC->useRandomRowid ){ assert( pOp->p3==0 ); /* SQLITE_FULL must have occurred prior to this */ v = db->priorNewRowid; cnt = 0; do{ |
︙ | |||
3290 3291 3292 3293 3294 3295 3296 | 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 | - + + + + + + + + + - + - - - - - - - - + + + + + + + - - - - - + - - + - - - - - - - + + + + + - - - - - - + + + + + + - | ** record in the table. If it is left pointing at the next record, then ** the next Next instruction will be a no-op. Hence it is OK to delete ** a record from within an Next loop. ** ** If the OPFLAG_NCHANGE flag of P2 is set, then the row change count is ** incremented (otherwise not). ** |
︙ | |||
4709 4710 4711 4712 4713 4714 4715 | 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 | - + + + + + + + + + + + - + - | } #endif /* SQLITE_DEBUG */ } break; } #endif |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
507 508 509 510 511 512 513 | 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | + - - + + + - + | ** to a string or structure that is guaranteed to exist for the lifetime of ** the Vdbe. In these cases we can just copy the pointer. ** ** If addr<0 then change P4 on the most recently inserted instruction. */ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){ Op *pOp; assert( p!=0 ); |
︙ | |||
536 537 538 539 540 541 542 | 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | - + + + + + + + | int nField, nByte; nField = ((KeyInfo*)zP4)->nField; nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]) + nField; pKeyInfo = sqlite3_malloc( nByte ); pOp->p4.pKeyInfo = pKeyInfo; if( pKeyInfo ){ |
︙ |
Changes to src/where.c.
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + | ** This module contains C code that generates VDBE code used to process ** the WHERE clause of SQL statements. This module is reponsible for ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** |
︙ | |||
2552 2553 2554 2555 2556 2557 2558 | 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 | - + | r1 = sqlite3GetTempReg(pParse); if( topLimit | btmLimit ){ sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1); sqlite3VdbeAddOp2(v, OP_IsNull, r1, cont); } if( !omitTable ){ sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, r1); |
︙ | |||
2627 2628 2629 2630 2631 2632 2633 | 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 | - + | start = sqlite3VdbeAddOp3(v, OP_IdxGE, iIdxCur, nxt, pLevel->iMem); sqlite3VdbeChangeP5(v, 1); pLevel->op = OP_Next; } if( !omitTable ){ r1 = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, r1); |
︙ |
Changes to test/all.test.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file runs all tests. # |
︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | + | } else { catch {unset ::SETUP_SQL} } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $EXCLUDE $tail]>=0} continue if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue reset_prng_state source $testfile catch {db close} if {$sqlite_open_file_count>0} { puts "$tail did not close all files: $sqlite_open_file_count" incr nErr lappend ::failList $tail set sqlite_open_file_count 0 |
︙ |
Changes to test/cast.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | # 2005 June 25 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CAST operator. # |
︙ | |||
178 179 180 181 182 183 184 185 186 187 188 189 190 191 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } integer do_test cast-1.51 { execsql {SELECT CAST('123.5abc' AS numeric)} } 123.5 do_test cast-1.53 { execsql {SELECT CAST('123.5abc' AS integer)} } 123 do_test case-1.60 { execsql {SELECT CAST(null AS REAL)} } {{}} do_test case-1.61 { execsql {SELECT typeof(CAST(null AS REAL))} } {null} do_test case-1.62 { execsql {SELECT CAST(1 AS REAL)} } {1.0} do_test case-1.63 { execsql {SELECT typeof(CAST(1 AS REAL))} } {real} do_test case-1.64 { execsql {SELECT CAST('1' AS REAL)} } {1.0} do_test case-1.65 { execsql {SELECT typeof(CAST('1' AS REAL))} } {real} do_test case-1.66 { execsql {SELECT CAST('abc' AS REAL)} } {0.0} do_test case-1.67 { execsql {SELECT typeof(CAST('abc' AS REAL))} } {real} do_test case-1.68 { execsql {SELECT CAST(x'31' AS REAL)} } {1.0} do_test case-1.69 { execsql {SELECT typeof(CAST(x'31' AS REAL))} } {real} # Ticket #1662. Ignore leading spaces in numbers when casting. # do_test cast-2.1 { execsql {SELECT CAST(' 123' AS integer)} } 123 do_test cast-2.2 { |
︙ |
Changes to test/expr.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing expressions. # |
︙ | |||
68 69 70 71 72 73 74 75 76 77 78 79 80 81 | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + | test_expr expr-1.40 {i1=1, i2=2} {+(i2+i1)} {3} test_expr expr-1.41 {i1=1, i2=2} {-(i2+i1)} {-3} test_expr expr-1.42 {i1=1, i2=2} {i1|i2} {3} test_expr expr-1.42b {i1=1, i2=2} {4|2} {6} test_expr expr-1.43 {i1=1, i2=2} {i1&i2} {0} test_expr expr-1.43b {i1=1, i2=2} {4&5} {4} test_expr expr-1.44 {i1=1} {~i1} {-2} test_expr expr-1.44b {i1=NULL} {~i1} {{}} test_expr expr-1.45 {i1=1, i2=3} {i1<<i2} {8} test_expr expr-1.46 {i1=32, i2=3} {i1>>i2} {4} test_expr expr-1.47 {i1=9999999999, i2=8888888888} {i1<i2} 0 test_expr expr-1.48 {i1=9999999999, i2=8888888888} {i1=i2} 0 test_expr expr-1.49 {i1=9999999999, i2=8888888888} {i1>i2} 1 test_expr expr-1.50 {i1=99999999999, i2=99999999998} {i1<i2} 0 test_expr expr-1.51 {i1=99999999999, i2=99999999998} {i1=i2} 0 |
︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 149 150 | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | + + | test_expr expr-1.103 {i1=0} {(-2147483648.0 % -1)} 0.0 test_expr expr-1.104 {i1=0} {(-9223372036854775808.0 % -1)} 0.0 test_expr expr-1.105 {i1=0} {(-9223372036854775808.0 / -1)>1} 1 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.108 {i1=0} {1%0} {{}} test_expr expr-1.109 {i1=0} {1/0} {{}} 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.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 set tcl_precision 15 test_expr expr-2.4 {r1=1.23, r2=2.34} {r1/r2} 0.525641025641026 test_expr expr-2.5 {r1=1.23, r2=2.34} {r2/r1} 1.90243902439024 |
︙ | |||
165 166 167 168 169 170 171 172 173 174 175 176 177 178 | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | + + | test_expr expr-2.20 {r1=2.34, r2=2.34} {r2<>r1} 0 test_expr expr-2.21 {r1=2.34, r2=2.34} {r2==r1} 1 test_expr expr-2.22 {r1=1.23, r2=2.34} {min(r1,r2,r1+r2,r1-r2)} {-1.11} test_expr expr-2.23 {r1=1.23, r2=2.34} {max(r1,r2,r1+r2,r1-r2)} {3.57} test_expr expr-2.24 {r1=25.0, r2=11.0} {r1%r2} 3.0 test_expr expr-2.25 {r1=1.23, r2=NULL} {coalesce(r1+r2,99.0)} 99.0 test_expr expr-2.26 {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 test_expr expr-2.27 {r1=1.1, r2=0.0} {r1/r2} {{}} test_expr expr-2.28 {r1=1.1, r2=0.0} {r1%r2} {{}} test_expr expr-3.1 {t1='abc', t2='xyz'} {t1<t2} 1 test_expr expr-3.2 {t1='xyz', t2='abc'} {t1<t2} 0 test_expr expr-3.3 {t1='abc', t2='abc'} {t1<t2} 0 test_expr expr-3.4 {t1='abc', t2='xyz'} {t1<=t2} 1 test_expr expr-3.5 {t1='xyz', t2='abc'} {t1<=t2} 0 test_expr expr-3.6 {t1='abc', t2='abc'} {t1<=t2} 1 |
︙ |
Changes to test/hook.test.
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + | # # The focus of the tests in this file is the following interface: # # sqlite_commit_hook (tests hook-1..hook-3 inclusive) # sqlite_update_hook (tests hook-4-*) # sqlite_rollback_hook (tests hook-5.*) # |
︙ | |||
132 133 134 135 136 137 138 139 140 141 142 143 144 145 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + + + + + + + + + + + + + + + + + + | DELETE main t1 2 \ UPDATE main t1 1 \ UPDATE main t1 3 \ DELETE main t1 1 \ DELETE main t1 3 \ DELETE main t1 4 \ ] # Update hook is not invoked for changes to sqlite_master # do_test hook-4.1.3 { set ::update_hook {} execsql { CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN SELECT RAISE(IGNORE); END; } set ::update_hook } {} do_test hook-4.1.4 { set ::update_hook {} execsql { DROP TRIGGER r1; } set ::update_hook } {} set ::update_hook {} ifcapable trigger { do_test hook-4.2.1 { catchsql { DROP TABLE t2; } |
︙ |
Changes to test/incrvacuum.test.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the incremental vacuum feature. # # Note: There are also some tests for incremental vacuum and IO # errors in incrvacuum_ioerr.test. # |
︙ | |||
545 546 547 548 549 550 551 | 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | - + + + + + + + + + + + + + | execsql { PRAGMA incremental_vacuum('1'); } expr [file size test.db] / 1024 } {22} do_test incrvacuum-10.5 { |
︙ |
Changes to test/misc3.test.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | # #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for miscellanous features that were # left out of other test files. # |
︙ | |||
254 255 256 257 258 259 260 261 262 263 264 265 266 267 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | + + + + + + + + + + + + + + + + + + + + | execsql {EXPLAIN COMMIT} catchsql {COMMIT} } {0 {}} do_test misc3-6.3 { execsql {BEGIN; EXPLAIN ROLLBACK} catchsql {ROLLBACK} } {0 {}} # Do some additional EXPLAIN operations to exercise the displayP4 logic. do_test misc3-6.10 { set x [execsql { CREATE TABLE ex1(a INTEGER, b TEXT DEFAULT "hello", c); CREATE UNIQUE INDEX ex1i1 ON ex1(a); EXPLAIN REINDEX; }] regexp { IsUnique \d+ \d+ \d+ \d+ } $x } {1} do_test misc3-6.11 { set x [execsql { EXPLAIN SELECT a+123456789012, b*4.5678, c FROM ex1 ORDER BY a, b DESC }] set y [regexp { 123456789012 } $x] lappend y [regexp { 4.5678 } $x] lappend y [regexp { hello } $x] lappend y [regexp {,-BINARY} $x] } {1 1 1 1} } ifcapable {trigger} { # Ticket #640: vdbe stack overflow with a LIMIT clause on a SELECT inside # of a trigger. # do_test misc3-7.1 { |
︙ |
Changes to test/rowid.test.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the magic ROWID column that is # found on all tables. # |
︙ | |||
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | + + + + + + + + + - + + + + + + + + + + + - - + + + + + + + + + + | do_test rowid-11.4 { execsql {SELECT rowid, a FROM t5 WHERE rowid<='abc'} } {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8} # Test the automatic generation of rowids when the table already contains # a rowid with the maximum value. # # Once the the maximum rowid is taken, rowids are normally chosen at # random. By by reseting the random number generator, we can cause # the rowid guessing loop to collide with prior rowids, and test the # loop out to its limit of 100 iterations. After 100 collisions, the # rowid guesser gives up and reports SQLITE_FULL. # do_test rowid-12.1 { execsql { CREATE TABLE t7(x INTEGER PRIMARY KEY, y); INSERT INTO t7 VALUES(9223372036854775807,'a'); SELECT y FROM t7; } } {a} do_test rowid-12.2 { db close sqlite3 db test.db save_prng_state execsql { INSERT INTO t7 VALUES(NULL,'b'); |
Changes to test/softheap1.test.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + + + | # #*********************************************************************** # # This test script reproduces the problem reported by ticket #2565, # A database corruption bug that occurs in auto_vacuum mode when # the soft_heap_limit is set low enough to be triggered. # |
︙ |
Changes to test/tester.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements some common TCL routines used for regression # testing the SQLite library # |
︙ | |||
217 218 219 220 221 222 223 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | - + + | } } else { puts "All memory allocations freed - no leaks" ifcapable memdebug { sqlite3_memdebug_dump ./memusage.txt } } |
︙ |