SQLite

Check-in [5b3de9390f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem in test file e_reindex.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5b3de9390f2ffc4c530fd47c71c70e87972cf74b
User & Date: dan 2015-04-16 08:54:01.766
References
2015-05-20
20:50
Fix a problem in test file e_reindex.test. Cherrypick of [5b3de9390f2f]. (check-in: 80633682d7 user: dan tags: branch-3.8.6)
Context
2015-05-20
20:50
Fix a problem in test file e_reindex.test. Cherrypick of [5b3de9390f2f]. (check-in: 80633682d7 user: dan tags: branch-3.8.6)
2015-04-16
12:12
Fix the corruptC.test module due to a change in error message text. (check-in: 7c0deed257 user: drh tags: trunk)
12:09
Checked in the wrong fix. (Closed-Leaf check-in: 4b0f44848d user: drh tags: mistake)
08:54
Fix a problem in test file e_reindex.test. (check-in: 5b3de9390f user: dan tags: trunk)
07:19
Ensure the sqlite3Select() routine always returns non-zero if an error has occurred. (check-in: b51028ed2f user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/e_reindex.test.
44
45
46
47
48
49
50



51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
#    Test this by corrupting some database indexes, running REINDEX, and
#    observing that the corruption is gone.
#
do_execsql_test e_reindex-1.1 {
  INSERT INTO t1 VALUES(1, 2);
  INSERT INTO t1 VALUES(3, 4);
  INSERT INTO t1 VALUES(5, 6);



  PRAGMA writable_schema = 1;
  UPDATE sqlite_master SET sql = '-- ' || sql WHERE type = 'index';
} {}

db close
sqlite3 db test.db
do_execsql_test e_reindex-1.2 {
  DELETE FROM t1 WHERE a = 3;
  INSERT INTO t1 VALUES(7, 8);
  INSERT INTO t1 VALUES(9, 10);
  PRAGMA writable_schema = 1;
  UPDATE sqlite_master SET sql = substr(sql, 4) WHERE type = 'index';

} {}

db close
sqlite3 db test.db
do_execsql_test e_reindex-1.3 {
  PRAGMA integrity_check;
} [list \







>
>
>

|









|
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#    Test this by corrupting some database indexes, running REINDEX, and
#    observing that the corruption is gone.
#
do_execsql_test e_reindex-1.1 {
  INSERT INTO t1 VALUES(1, 2);
  INSERT INTO t1 VALUES(3, 4);
  INSERT INTO t1 VALUES(5, 6);

  CREATE TABLE saved(a,b,c,d,e);
  INSERT INTO saved SELECT * FROM sqlite_master WHERE type = 'index';
  PRAGMA writable_schema = 1;
  DELETE FROM sqlite_master WHERE type = 'index';
} {}

db close
sqlite3 db test.db
do_execsql_test e_reindex-1.2 {
  DELETE FROM t1 WHERE a = 3;
  INSERT INTO t1 VALUES(7, 8);
  INSERT INTO t1 VALUES(9, 10);
  PRAGMA writable_schema = 1;
  INSERT INTO sqlite_master SELECT * FROM saved;
  DROP TABLE saved;
} {}

db close
sqlite3 db test.db
do_execsql_test e_reindex-1.3 {
  PRAGMA integrity_check;
} [list \