SQLite

Check-in [e405b9e4a9]
Login

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

Overview
Comment:Fix the corruptI.test script so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK and with SQLITE_DEFAULT_AUTOVACUUM=1.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e405b9e4a9ef322d84b20e902234b4f6aa196b1b
User & Date: drh 2014-10-07 20:09:27.561
Context
2014-10-07
23:02
Make sure the sqlite3VdbeMemClearAndResize() routine is never called with a zero size parameter, since a size of zero could lead to either a memory leak or an assertion fault. (check-in: f672a380e2 user: drh tags: trunk)
20:09
Fix the corruptI.test script so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK and with SQLITE_DEFAULT_AUTOVACUUM=1. (check-in: e405b9e4a9 user: drh tags: trunk)
16:59
Restrict the scope of the valueToText() routine. (check-in: 13c962b33d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/corruptI.test.
71
72
73
74
75
76
77



78
79
80

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  catchsql { SELECT * FROM r WHERE x >= 10.0 }
} {1 {database disk image is malformed}}

do_test 2.2 {
  catchsql { SELECT * FROM r WHERE x >= 10 }
} {1 {database disk image is malformed}}




reset_db

do_execsql_test 3.1 {

  PRAGMA page_size = 512;
  CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
  WITH s(a, b) AS (
    SELECT 2, 'abcdefghij'
    UNION ALL
    SELECT a+2, b FROM s WHERe a < 40
  )
  INSERT INTO t1 SELECT * FROM s;
} {}

do_test 3.2 {
  hexio_write test.db [expr 512+3] 0054
  db close
  sqlite3 db test.db
  execsql { INSERT INTO t1 VALUES(5, 'klmnopqrst') }
  execsql { INSERT INTO t1 VALUES(7, 'klmnopqrst') }
} {}

db close
sqlite3 db test.db
do_catchsql_test 3.2 {
  INSERT INTO t1 VALUES(9, 'klmnopqrst');
} {1 {database disk image is malformed}}

finish_test







>
>
>
|
<
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

71
72
73
74
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  catchsql { SELECT * FROM r WHERE x >= 10.0 }
} {1 {database disk image is malformed}}

do_test 2.2 {
  catchsql { SELECT * FROM r WHERE x >= 10 }
} {1 {database disk image is malformed}}

if {[db one {SELECT sqlite_compileoption_used('ENABLE_OVERSIZE_CELL_CHECK')}]} {
  # The following tests only work if OVERSIZE_CELL_CHECK is disabled
} else {
  reset_db

  do_execsql_test 3.1 {
     PRAGMA auto_vacuum=0;
     PRAGMA page_size = 512;
     CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
     WITH s(a, b) AS (
       SELECT 2, 'abcdefghij'
       UNION ALL
       SELECT a+2, b FROM s WHERe a < 40
     )
     INSERT INTO t1 SELECT * FROM s;
   } {}
   
   do_test 3.2 {
     hexio_write test.db [expr 512+3] 0054
     db close
     sqlite3 db test.db
     execsql { INSERT INTO t1 VALUES(5, 'klmnopqrst') }
     execsql { INSERT INTO t1 VALUES(7, 'klmnopqrst') }
   } {}
   
   db close
   sqlite3 db test.db
   do_catchsql_test 3.3 {
     INSERT INTO t1 VALUES(9, 'klmnopqrst');
   } {1 {database disk image is malformed}}
} ;# end-if !defined(ENABLE_OVERSIZE_CELL_CHECK)
finish_test