/ Check-in [ce6eaac1]
Login

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

Overview
Comment:Test that if the definition of a collation sequence is changed and VACUUM run, the new database contains records sorted in the (new) correct order.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ce6eaac10a190b26b87bfe75918e2ef58fd7a3f9
User & Date: dan 2015-04-13 14:08:27
Context
2015-04-13
14:44
Remove a faulty assert() from the btree balancing logic. check-in: d06669d9 user: drh tags: trunk
14:08
Test that if the definition of a collation sequence is changed and VACUUM run, the new database contains records sorted in the (new) correct order. check-in: ce6eaac1 user: dan tags: trunk
14:03
Remove an unreachable branch from the VACUUM logic. check-in: 65ace4b0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/vacuum2.test.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
223
224
225
226
227
228
229





230














231
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum2.test,v 1.10 2009/02/18 20:31:18 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
#
do_not_use_codec

# If the VACUUM statement is disabled in the current build, skip all
................................................................................
  db eval {SELECT a, b FROM t1 WHERE a<=10} {
    if {$a==6} { set res [catchsql VACUUM] }
    lappend res2 $a
  }
  lappend res2 $res
} {1 2 3 4 5 6 7 8 9 10 {1 {cannot VACUUM - SQL statements in progress}}}





















finish_test







>







 







>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
224
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
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum2.test,v 1.10 2009/02/18 20:31:18 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix vacuum2

# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
#
do_not_use_codec

# If the VACUUM statement is disabled in the current build, skip all
................................................................................
  db eval {SELECT a, b FROM t1 WHERE a<=10} {
    if {$a==6} { set res [catchsql VACUUM] }
    lappend res2 $a
  }
  lappend res2 $res
} {1 2 3 4 5 6 7 8 9 10 {1 {cannot VACUUM - SQL statements in progress}}}

#-------------------------------------------------------------------------
# Check that if the definition of a collation sequence is changed and
# VACUUM run, records are store in the (new) correct order following the
# VACUUM. Even if the modified collation is attached to a PK of a WITHOUT
# ROWID table.

proc cmp {lhs rhs} { string compare $lhs $rhs }
db collate cmp cmp
do_execsql_test 6.0 {
  CREATE TABLE t6(x PRIMARY KEY COLLATE cmp, y) WITHOUT ROWID;
  CREATE INDEX t6y ON t6(y);
  INSERT INTO t6 VALUES('i', 'one');
  INSERT INTO t6 VALUES('ii', 'one');
  INSERT INTO t6 VALUES('iii', 'one');
}
integrity_check 6.1
proc cmp {lhs rhs} { string compare $rhs $lhs }
do_execsql_test 6.2 VACUUM
integrity_check 6.3

finish_test