mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Get vacuum working on database that used to have autoincrement tables but
where all such tables have been dropped. Ticket #1121. (CVS 2344) FossilOrigin-Name: 8f7c639da0f862fa2dd2f55eb7e4d453cd321540
This commit is contained in:
13
manifest
13
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Move\sthe\sspecial\sbuilt-in\sSQL\sfunctions\sused\sby\sALTER\sTABLE\sout\sof\sfunc.c\nand\sinto\salter.c.\s(CVS\s2343)
|
C Get\svacuum\sworking\son\sdatabase\sthat\sused\sto\shave\sautoincrement\stables\sbut\r\nwhere\sall\ssuch\stables\shave\sbeen\sdropped.\s\sTicket\s#1121.\s(CVS\s2344)
|
||||||
D 2005-02-15T21:36:18
|
D 2005-02-16T03:27:05
|
||||||
F Makefile.in 76443a83549d1539105e12d13bd0054a05ab2214
|
F Makefile.in 76443a83549d1539105e12d13bd0054a05ab2214
|
||||||
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
|
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
|
||||||
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
|
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
|
||||||
@@ -74,7 +74,7 @@ F src/trigger.c 038c8e128d4551cd016426cd11bbf5c478816481
|
|||||||
F src/update.c b6f4668c11059f86b71581187d09197fa28ec4be
|
F src/update.c b6f4668c11059f86b71581187d09197fa28ec4be
|
||||||
F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c
|
F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c
|
||||||
F src/util.c 1b7b9a127b66743ab6cba8d44597aeb570723c99
|
F src/util.c 1b7b9a127b66743ab6cba8d44597aeb570723c99
|
||||||
F src/vacuum.c ccb34e92fd662b2d975e3c8d8cfd229c9081cb78
|
F src/vacuum.c 5cf598003191bd91c17a64742bad8e46241698a8
|
||||||
F src/vdbe.c d9ec62c9f63768b4d4f8513b25aded8faf2de17b
|
F src/vdbe.c d9ec62c9f63768b4d4f8513b25aded8faf2de17b
|
||||||
F src/vdbe.h bb9186484f749a839c6c43953e79a6530253f7cd
|
F src/vdbe.h bb9186484f749a839c6c43953e79a6530253f7cd
|
||||||
F src/vdbeInt.h e80721cd8ff611789e20743eec43363a9fb5a48e
|
F src/vdbeInt.h e80721cd8ff611789e20743eec43363a9fb5a48e
|
||||||
@@ -207,6 +207,7 @@ F test/unique.test 0e38d4cc7affeef2527720d1dafd1f6870f02f2b
|
|||||||
F test/update.test 7669ca789d62c258b678e8aa7a22a57eac10f2cf
|
F test/update.test 7669ca789d62c258b678e8aa7a22a57eac10f2cf
|
||||||
F test/utf16.test 459c2f5ab80c60092c603630a348c32d6e59c558
|
F test/utf16.test 459c2f5ab80c60092c603630a348c32d6e59c558
|
||||||
F test/vacuum.test 76c4bc4589353d071e81c003a25338d02560474d
|
F test/vacuum.test 76c4bc4589353d071e81c003a25338d02560474d
|
||||||
|
F test/vacuum2.test 5d77e98c458bcdbeecc6327de5107179ba1aa095
|
||||||
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
||||||
F test/view.test 306cc4342eb03c28de1a92c681836189e03e5af9
|
F test/view.test 306cc4342eb03c28de1a92c681836189e03e5af9
|
||||||
F test/where.test ffb790dfda75d977bae7a1f5830351623f76861b
|
F test/where.test ffb790dfda75d977bae7a1f5830351623f76861b
|
||||||
@@ -272,7 +273,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
|
|||||||
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
|
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
|
||||||
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
|
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
|
||||||
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
|
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
|
||||||
P 90d6573c2631fac92b9e572e9e21698ae2480c9d
|
P dbd11a0c581b447bb2f220a1a185d9fd36933ee3
|
||||||
R 384fca8815ea2fd0b9f2d663a9b9c24b
|
R 3e933ca53eeeb55c0d837e7fbde35ff0
|
||||||
U drh
|
U drh
|
||||||
Z 4a0adb18d6e3aab9863249bdabd00180
|
Z 495b7f43a6bd00411892cdab27def873
|
||||||
|
@@ -1 +1 @@
|
|||||||
dbd11a0c581b447bb2f220a1a185d9fd36933ee3
|
8f7c639da0f862fa2dd2f55eb7e4d453cd321540
|
@@ -14,7 +14,7 @@
|
|||||||
** Most of the code in this file may be omitted by defining the
|
** Most of the code in this file may be omitted by defining the
|
||||||
** SQLITE_OMIT_VACUUM macro.
|
** SQLITE_OMIT_VACUUM macro.
|
||||||
**
|
**
|
||||||
** $Id: vacuum.c,v 1.39 2005/02/12 00:19:30 drh Exp $
|
** $Id: vacuum.c,v 1.40 2005/02/16 03:27:05 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -211,13 +211,13 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
|
|||||||
*/
|
*/
|
||||||
rc = execExecSql(db,
|
rc = execExecSql(db,
|
||||||
"SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' "
|
"SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' "
|
||||||
"FROM sqlite_master WHERE name='sqlite_sequence' "
|
"FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
|
||||||
);
|
);
|
||||||
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
||||||
rc = execExecSql(db,
|
rc = execExecSql(db,
|
||||||
"SELECT 'INSERT INTO vacuum_db.' || quote(name) "
|
"SELECT 'INSERT INTO vacuum_db.' || quote(name) "
|
||||||
"|| ' SELECT * FROM ' || quote(name) || ';' "
|
"|| ' SELECT * FROM ' || quote(name) || ';' "
|
||||||
"FROM sqlite_master WHERE name=='sqlite_sequence';"
|
"FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
|
||||||
);
|
);
|
||||||
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
||||||
|
|
||||||
|
42
test/vacuum2.test
Normal file
42
test/vacuum2.test
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# 2005 February 15
|
||||||
|
#
|
||||||
|
# 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 file is testing the VACUUM statement.
|
||||||
|
#
|
||||||
|
# $Id: vacuum2.test,v 1.1 2005/02/16 03:27:08 drh Exp $
|
||||||
|
|
||||||
|
set testdir [file dirname $argv0]
|
||||||
|
source $testdir/tester.tcl
|
||||||
|
|
||||||
|
# If the VACUUM statement is disabled in the current build, skip all
|
||||||
|
# the tests in this file.
|
||||||
|
#
|
||||||
|
ifcapable {!vacuum} {
|
||||||
|
finish_test
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if $AUTOVACUUM {
|
||||||
|
finish_test
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ticket #1121 - make sure vacuum works if all autoincrement tables
|
||||||
|
# have been deleted.
|
||||||
|
#
|
||||||
|
do_test vacuum2-1.1 {
|
||||||
|
execsql {
|
||||||
|
CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y);
|
||||||
|
DROP TABLE t1;
|
||||||
|
VACUUM;
|
||||||
|
}
|
||||||
|
} {}
|
||||||
|
|
||||||
|
finish_test
|
Reference in New Issue
Block a user