mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Avoid a segfault when running vacuum on an in-memory database. Ticket #3620. (CVS 6221)
FossilOrigin-Name: 407830c6839a81fa0a1010940740df3011713a88
This commit is contained in:
20
manifest
20
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\sround-off\serror\swhen\smoving\sdates\sby\snegative\smodifier\samounts.\nTicket\s#3618.\s\sEnhance\sthe\s"NNN\syears"\smodifier\sto\saccept\sfractional\nyears.\s(CVS\s6220)
|
C Avoid\sa\ssegfault\swhen\srunning\svacuum\son\san\sin-memory\sdatabase.\sTicket\s#3620.\s(CVS\s6221)
|
||||||
D 2009-01-30T17:27:44
|
D 2009-01-31T14:54:07
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in 3871d308188cefcb7c5ab20da4c7b6aad023bc52
|
F Makefile.in 3871d308188cefcb7c5ab20da4c7b6aad023bc52
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -103,7 +103,7 @@ F src/attach.c 1c35f95da3c62d19de75b44cfefd12c81c1791b3
|
|||||||
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
|
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
|
||||||
F src/bitvec.c 44f7059ac1f874d364b34af31b9617e52223ba75
|
F src/bitvec.c 44f7059ac1f874d364b34af31b9617e52223ba75
|
||||||
F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
|
F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
|
||||||
F src/btree.c 606c67b1b544d2324a9e4ab365cedaa1f828c7f4
|
F src/btree.c dfbbfc396fdd8cbc29754864a97c4df484b78870
|
||||||
F src/btree.h 07359623fa24748709dd61212a32364a6adc6b56
|
F src/btree.h 07359623fa24748709dd61212a32364a6adc6b56
|
||||||
F src/btreeInt.h 44bcbfe387ba99a3a9f2527bd12fa1bb8bc574b3
|
F src/btreeInt.h 44bcbfe387ba99a3a9f2527bd12fa1bb8bc574b3
|
||||||
F src/build.c c8bf5dcef4d5889bc57eecdb8b3dba178e5e06a8
|
F src/build.c c8bf5dcef4d5889bc57eecdb8b3dba178e5e06a8
|
||||||
@@ -142,8 +142,8 @@ F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c c74255cc1fcddc38fc3cc1dcf70c2325d3c2948e
|
F src/os_unix.c c74255cc1fcddc38fc3cc1dcf70c2325d3c2948e
|
||||||
F src/os_win.c ec133f2a3c0da786995ea09ba67056af8f18cc2e
|
F src/os_win.c ec133f2a3c0da786995ea09ba67056af8f18cc2e
|
||||||
F src/pager.c 3a36360acb9caa54d4fdd6439454348eab3b4b5a
|
F src/pager.c 72f4e7b3076584889ce6286cd15ff2d985325026
|
||||||
F src/pager.h 59e3b500a0f6a8d17ec61976535007b0de39b9a4
|
F src/pager.h eccf5cdeebd79006ba7f9577dd30d8179b1430da
|
||||||
F src/parse.y 4f4d16aee0d11f69fec2adb77dac88878043ed8d
|
F src/parse.y 4f4d16aee0d11f69fec2adb77dac88878043ed8d
|
||||||
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
|
F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
|
||||||
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
||||||
@@ -636,7 +636,7 @@ F test/types3.test a0f66bf12f80fad89493535474f7a6d16fa58150
|
|||||||
F test/unique.test 0253c4227a5dc533e312202ce21ecfad18058d18
|
F test/unique.test 0253c4227a5dc533e312202ce21ecfad18058d18
|
||||||
F test/update.test 8bc86fd7ef1a00014f76dc6a6a7c974df4aef172
|
F test/update.test 8bc86fd7ef1a00014f76dc6a6a7c974df4aef172
|
||||||
F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae
|
F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae
|
||||||
F test/vacuum.test 07eff517a871f08165251860438cf8bbd87d6ed4
|
F test/vacuum.test 68e39b2228b4b772166debef4a82accf6ddd32f3
|
||||||
F test/vacuum2.test fd87eec0ed72c6cc0809f7867929e2895affed92
|
F test/vacuum2.test fd87eec0ed72c6cc0809f7867929e2895affed92
|
||||||
F test/vacuum3.test f39ad1428347c5808cd2da7578c470f186a4d0ce
|
F test/vacuum3.test f39ad1428347c5808cd2da7578c470f186a4d0ce
|
||||||
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
||||||
@@ -693,7 +693,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
|||||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
P c5dca1146de72071ed2e5fdf6890f41682272587
|
P 86be908c5e77ba2b9ac98e394fa987b443d790f8
|
||||||
R 6a74041552de27456797035382a955bb
|
R 338358bbac17f79c52e09eabfb9a08f6
|
||||||
U drh
|
U danielk1977
|
||||||
Z 4f589fc1347644d84b8da190a4ca5065
|
Z 69820336f312727069bd2180b04a2b93
|
||||||
|
@@ -1 +1 @@
|
|||||||
86be908c5e77ba2b9ac98e394fa987b443d790f8
|
407830c6839a81fa0a1010940740df3011713a88
|
@@ -9,7 +9,7 @@
|
|||||||
** May you share freely, never taking more than you give.
|
** May you share freely, never taking more than you give.
|
||||||
**
|
**
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
** $Id: btree.c,v 1.562 2009/01/28 20:21:17 drh Exp $
|
** $Id: btree.c,v 1.563 2009/01/31 14:54:07 danielk1977 Exp $
|
||||||
**
|
**
|
||||||
** This file implements a external (disk-based) database using BTrees.
|
** This file implements a external (disk-based) database using BTrees.
|
||||||
** See the header comment on "btreeInt.h" for additional information.
|
** See the header comment on "btreeInt.h" for additional information.
|
||||||
@@ -7390,6 +7390,10 @@ static int btreeCopyFile(Btree *pTo, Btree *pFrom){
|
|||||||
** file APIs on the database file directly.
|
** file APIs on the database file directly.
|
||||||
*/
|
*/
|
||||||
pBtTo->db = pTo->db;
|
pBtTo->db = pTo->db;
|
||||||
|
if( nFromPageSize==nToPageSize ){
|
||||||
|
sqlite3PagerTruncateImage(pBtTo->pPager, nFromPage);
|
||||||
|
iNow = iSize;
|
||||||
|
}
|
||||||
rc = sqlite3PagerCommitPhaseOne(pBtTo->pPager, 0, 1);
|
rc = sqlite3PagerCommitPhaseOne(pBtTo->pPager, 0, 1);
|
||||||
if( iSize<iNow && rc==SQLITE_OK ){
|
if( iSize<iNow && rc==SQLITE_OK ){
|
||||||
rc = sqlite3OsTruncate(pFile, iSize);
|
rc = sqlite3OsTruncate(pFile, iSize);
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.560 2009/01/30 05:40:27 shane Exp $
|
** @(#) $Id: pager.c,v 1.561 2009/01/31 14:54:07 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -2575,7 +2575,6 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SQLITE_OMIT_AUTOVACUUM
|
|
||||||
/*
|
/*
|
||||||
** Truncate the in-memory database file image to nPage pages. This
|
** Truncate the in-memory database file image to nPage pages. This
|
||||||
** function does not actually modify the database file on disk. It
|
** function does not actually modify the database file on disk. It
|
||||||
@@ -2588,7 +2587,6 @@ void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){
|
|||||||
assert( pPager->state>=PAGER_RESERVED );
|
assert( pPager->state>=PAGER_RESERVED );
|
||||||
pPager->dbSize = nPage;
|
pPager->dbSize = nPage;
|
||||||
}
|
}
|
||||||
#endif /* ifndef SQLITE_OMIT_AUTOVACUUM */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Shutdown the page cache. Free all memory and close all files.
|
** Shutdown the page cache. Free all memory and close all files.
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
** subsystem. The page cache subsystem reads and writes a file a page
|
** subsystem. The page cache subsystem reads and writes a file a page
|
||||||
** at a time and provides a journal for rollback.
|
** at a time and provides a journal for rollback.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.h,v 1.98 2009/01/24 11:30:43 drh Exp $
|
** @(#) $Id: pager.h,v 1.99 2009/01/31 14:54:07 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PAGER_H_
|
#ifndef _PAGER_H_
|
||||||
@@ -136,10 +136,8 @@ const char *sqlite3PagerJournalname(Pager*);
|
|||||||
int sqlite3PagerNosync(Pager*);
|
int sqlite3PagerNosync(Pager*);
|
||||||
void *sqlite3PagerTempSpace(Pager*);
|
void *sqlite3PagerTempSpace(Pager*);
|
||||||
|
|
||||||
/* Functions used in auto-vacuum mode to truncate the database file. */
|
/* Functions used to truncate the database file. */
|
||||||
#ifndef SQLITE_OMIT_AUTOVACUUM
|
void sqlite3PagerTruncateImage(Pager*,Pgno);
|
||||||
void sqlite3PagerTruncateImage(Pager*,Pgno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Used by encryption extensions. */
|
/* Used by encryption extensions. */
|
||||||
#ifdef SQLITE_HAS_CODEC
|
#ifdef SQLITE_HAS_CODEC
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
# This file implements regression tests for SQLite library. The
|
# This file implements regression tests for SQLite library. The
|
||||||
# focus of this file is testing the VACUUM statement.
|
# focus of this file is testing the VACUUM statement.
|
||||||
#
|
#
|
||||||
# $Id: vacuum.test,v 1.42 2009/01/22 23:04:47 drh Exp $
|
# $Id: vacuum.test,v 1.43 2009/01/31 14:54:07 danielk1977 Exp $
|
||||||
|
|
||||||
set testdir [file dirname $argv0]
|
set testdir [file dirname $argv0]
|
||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
@@ -287,7 +287,14 @@ do_test vacuum-7.0 {
|
|||||||
CREATE TABLE t1(t);
|
CREATE TABLE t1(t);
|
||||||
VACUUM;
|
VACUUM;
|
||||||
} db2
|
} db2
|
||||||
} {}
|
execsql {
|
||||||
|
CREATE TABLE t2(t);
|
||||||
|
CREATE TABLE t3(t);
|
||||||
|
DROP TABLE t2;
|
||||||
|
VACUUM;
|
||||||
|
pragma integrity_check;
|
||||||
|
} db2
|
||||||
|
} {ok}
|
||||||
db2 close
|
db2 close
|
||||||
|
|
||||||
# Ticket #873. VACUUM a database that has ' in its name.
|
# Ticket #873. VACUUM a database that has ' in its name.
|
||||||
|
Reference in New Issue
Block a user