mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
VACUUM works even on an empty database. Ticket #1512. (CVS 2760)
FossilOrigin-Name: 1b6bf4188e8ebf55cf1972b7081f6d31bf525555
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
# This file implements some common TCL routines used for regression
|
||||
# testing the SQLite library
|
||||
#
|
||||
# $Id: tester.tcl,v 1.50 2005/09/17 15:20:28 drh Exp $
|
||||
# $Id: tester.tcl,v 1.51 2005/11/04 22:03:30 drh Exp $
|
||||
|
||||
# Make sure tclsqlite3 was compiled correctly. Abort now with an
|
||||
# error message if not.
|
||||
@@ -362,7 +362,7 @@ proc do_ioerr_test {testname args} {
|
||||
do_test $testname.$n.3 {
|
||||
set r [catch $::ioerrorbody msg]
|
||||
set ::go [expr {$::sqlite_io_error_pending<=0}]
|
||||
set s [expr $::sqlite_io_error_pending>0]
|
||||
set s [expr $::sqlite_io_error_hit==0]
|
||||
# puts "$::sqlite_io_error_pending $r $msg"
|
||||
expr { ($s && !$r) || (!$s && $r) }
|
||||
# expr {$::sqlite_io_error_pending>0 || $r!=0}
|
||||
|
45
test/tkt1512.test
Normal file
45
test/tkt1512.test
Normal file
@@ -0,0 +1,45 @@
|
||||
# 2005 September 19
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# This file implements tests to verify that ticket #1512 is
|
||||
# fixed.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_test tkt1512-1.1 {
|
||||
execsql {
|
||||
CREATE TABLE t1(a,b);
|
||||
INSERT INTO t1 VALUES(1,2);
|
||||
INSERT INTO t1 VALUES(3,4);
|
||||
SELECT * FROM t1
|
||||
}
|
||||
} {1 2 3 4}
|
||||
do_test tkt1512-1.2 {
|
||||
file size test.db
|
||||
} {2048}
|
||||
do_test tkt1512-1.3 {
|
||||
execsql {
|
||||
DROP TABLE t1;
|
||||
}
|
||||
file size test.db
|
||||
} {2048}
|
||||
do_test tkt1512-1.4 {
|
||||
execsql {
|
||||
VACUUM;
|
||||
}
|
||||
file size test.db
|
||||
} {1024}
|
||||
|
||||
|
||||
finish_test
|
Reference in New Issue
Block a user