Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove the dependency on the direct btree interface from as many test scripts as is practical. Fix a bug in the output limiter of the integrity_check pragma that came up while making this change. (CVS 4880) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
24e769972eb6052b82dc94d20444c186 |
User & Date: | drh 2008-03-19 00:21:31.000 |
Context
2008-03-19
| ||
13:03 | When a parse of the sqlite_master table fails, include the name of the object being parsed as part of the error message. (CVS 4881) (check-in: 57805b588f user: drh tags: trunk) | |
00:21 | Remove the dependency on the direct btree interface from as many test scripts as is practical. Fix a bug in the output limiter of the integrity_check pragma that came up while making this change. (CVS 4880) (check-in: 24e769972e user: drh tags: trunk) | |
2008-03-18
| ||
13:47 | Update the documentation to distinguish between protected and unprotected sqlite3_value objects. (CVS 4879) (check-in: 074ee55ffd user: drh tags: trunk) | |
Changes
Changes to src/pragma.c.
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 | - + | /* ** 2003 April 6 ** ** 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 contains code used to implement the PRAGMA command. ** |
︙ | |||
933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 | 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | + + + | { OP_Rowid, 1, 4, 0}, { OP_String8, 0, 5, 0}, /* 3 */ { OP_String8, 0, 6, 0}, /* 4 */ { OP_Concat, 4, 3, 3}, { OP_Concat, 5, 3, 3}, { OP_Concat, 6, 3, 3}, { OP_ResultRow, 3, 1, 0}, { OP_IfPos, 1, 0, 0}, /* 9 */ { OP_Halt, 0, 0, 0}, }; sqlite3GenerateIndexKey(pParse, pIdx, 1, 3); jmp2 = sqlite3VdbeAddOp3(v, OP_Found, j+2, 0, 3); addr = sqlite3VdbeAddOpList(v, ArraySize(idxErr), idxErr); sqlite3VdbeChangeP4(v, addr+1, "rowid ", P4_STATIC); sqlite3VdbeChangeP4(v, addr+3, " missing from index ", P4_STATIC); sqlite3VdbeChangeP4(v, addr+4, pIdx->zName, P4_STATIC); sqlite3VdbeJumpHere(v, addr+9); sqlite3VdbeJumpHere(v, jmp2); } sqlite3VdbeAddOp2(v, OP_Next, 1, loopTop+1); sqlite3VdbeJumpHere(v, loopTop); for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ static const VdbeOpList cntIdx[] = { { OP_Integer, 0, 3, 0}, |
︙ |
Changes to src/test2.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 the pager.c module in SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** |
︙ | |||
713 714 715 716 717 718 719 | 713 714 715 716 717 718 719 720 721 722 723 | - - | (char*)&sqlite3_io_error_hardhit, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_diskfull_pending", (char*)&sqlite3_diskfull_pending, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_diskfull", (char*)&sqlite3_diskfull, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_pending_byte", (char*)&sqlite3_pending_byte, TCL_LINK_INT); |
Changes to test/alter2.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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - + - + - - + - - + - - - - - + + + - + - - - | # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing that SQLite can handle a subtle # file format change that may be used in the future to implement # "ALTER TABLE ... ADD COLUMN". # |
︙ | |||
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 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 | + + - + - + + + | #--------------------------------------------------------------------- # Check that an error occurs if the database is upgraded to a file # format that SQLite does not support (in this case 5). Note: The # file format is checked each time the schema is read, so changing the # file format requires incrementing the schema cookie. # do_test alter2-4.1 { db close set_file_format 5 sqlite3 db test.db } {} do_test alter2-4.2 { # We have to run two queries here because the Tcl interface uses # sqlite3_prepare_v2(). In this case, the first query encounters an # SQLITE_SCHEMA error. Then, when trying to recompile the statement, the # "unsupported file format" error is encountered. So the error code # returned is SQLITE_SCHEMA, not SQLITE_ERROR as required by the following # test case. # # When the query is attempted a second time, the same error message is # returned but the error code is SQLITE_ERROR, because the unsupported # file format was detected during a call to sqlite3_prepare(), not # sqlite3_step(). # catchsql { SELECT * FROM sqlite_master; } catchsql { SELECT * FROM sqlite_master; } } {1 {unsupported file format}} do_test alter2-4.3 { |
︙ | |||
292 293 294 295 296 297 298 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | - | # Test that when a database with file-format 2 is opened, new # databases are still created with file-format 1. # do_test alter2-6.1 { db close set_file_format 2 sqlite3 db test.db |
︙ |
Changes to test/alter3.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. The # focus of this script is testing that SQLite can handle a subtle # file format change that may be used in the future to implement # "ALTER TABLE ... ADD COLUMN". # |
︙ | |||
46 47 48 49 50 51 52 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - + - - - | # alter3-6.*: Test that temp triggers are not accidentally dropped. # alter3-7.*: Test that VACUUM resets the file-format. # # This procedure returns the value of the file-format in file 'test.db'. # proc get_file_format {{fname test.db}} { |
︙ |
Changes to test/capi3.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 | - + | # 2003 January 29 # # 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 script testing the callback-free C/C++ API. # |
︙ | |||
630 631 632 633 634 635 636 637 638 639 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 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 702 703 704 705 706 707 708 709 710 711 712 713 714 | + + + + + + + + + + + + + + + + + - - - - - + - - - - + - - - - - + + + + - - - - - - + - - - + - - - - - + - - - + + + - - - - + + + + - - - - - + - | sqlite3_finalize $STMT } {SQLITE_OK} do_test capi3-6.4-misuse { db cache flush sqlite3_close $DB } {SQLITE_OK} db close # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. # proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] incr schemacookie hexio_write test.db 40 [hexio_render_int32 $schemacookie] return {} } # This procedure returns the value of the file-format in file 'test.db'. # proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } if {![sqlite3 -has-codec]} { # Test what happens when the library encounters a newer file format. |
︙ |
Changes to test/capi3c.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 is a copy of the capi3.test file that has been adapted to # test the new sqlite3_prepare_v2 interface. # |
︙ | |||
590 591 592 593 594 595 596 | 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | - - | } SQLITE_OK set ::ENC [execsql {pragma encoding}] db close do_test capi3c-6.0 { |
︙ | |||
617 618 619 620 621 622 623 624 625 626 | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 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 | + + + + + + + + + + + + + + + + + - - - - - + - - - - + - - - - - + + + + - - - - - - + - - - + - - - - - + - - - + + + - - - - + + + + - - - - - + - | do_test capi3c-6.4 { db cache flush sqlite3_close $DB } {SQLITE_OK} do_test capi3c-6.99-misuse { db close } {} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. # proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] incr schemacookie hexio_write test.db 40 [hexio_render_int32 $schemacookie] return {} } # This procedure returns the value of the file-format in file 'test.db'. # proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } if {![sqlite3 -has-codec]} { # Test what happens when the library encounters a newer file format. |
︙ |
Changes to test/descidx1.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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + - + - - + - - - - - + + + - + - - - + | # 2005 December 21 # # 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 script is descending indices. # |
︙ |
Changes to test/descidx2.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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + - + - - + - - - - - + + + - + - - - + | # 2005 December 21 # # 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 script is descending indices. # |
︙ |
Changes to test/descidx3.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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - + - + - - + - - - - - + + + - + - - - | # 2006 January 02 # # 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 script is descending indices. # |
︙ |
Changes to test/minmax3.test.
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - + - + - - + - - - - - + + + - - - - - - - + + + + + + | # 2008 January 5 # # 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. # #*********************************************************************** |
︙ | |||
137 138 139 140 141 142 143 | 133 134 135 136 137 138 139 | - | } {VI 0} do_test minmax3-1.4.4 { execsql { DROP INDEX i1 } } {} finish_test |
Changes to test/pragma.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. # # This file implements tests for the PRAGMA command. # |
︙ | |||
258 259 260 261 262 263 264 | 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 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - - - - + + + + - - - - + + + + + - + - + - + - + - + - + | COMMIT; SELECT rowid, * from t2; } } {1 11 2 3 2 22 3 4} ifcapable attach { if {![sqlite3 -has-codec] && $sqlite_options(integrityck)} { do_test pragma-3.2 { |
︙ | |||
322 323 324 325 326 327 328 | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | - + - + | execsql { ATTACH 'testerr.db' AS t2; PRAGMA integrity_check } } {{*** in database t2 *** Page 4 is never used Page 5 is never used |
︙ | |||
368 369 370 371 372 373 374 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | - + - + - + - + - + - + | execsql { ATTACH 'testerr.db' AS t3; PRAGMA integrity_check } } {{*** in database t2 *** Page 4 is never used Page 5 is never used |
︙ |