mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix a problem in rbu vacuum on tables with a large sqlite_master table.
FossilOrigin-Name: 23eac52e987996afe8db847921aef434cebd25b5
This commit is contained in:
@ -241,6 +241,21 @@ foreach step {0 1} {
|
||||
PRAGMA main.user_version;
|
||||
PRAGMA main.application_id;
|
||||
} {8192 2 412 413}
|
||||
|
||||
# Vacuum a database with a large sqlite_master table.
|
||||
#
|
||||
reset_db
|
||||
do_test 1.10.1 {
|
||||
for {set i 1} {$i < 50} {incr i} {
|
||||
execsql "PRAGMA page_size = 1024"
|
||||
execsql "CREATE TABLE t$i (a, b, c, PRIMARY KEY(a, b));"
|
||||
execsql "
|
||||
INSERT INTO t$i VALUES(1, 2, 3);
|
||||
INSERT INTO t$i VALUES(4, 5, 6);
|
||||
"
|
||||
}
|
||||
} {}
|
||||
do_rbu_vacuum_test 1.10.2 $step
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -3952,9 +3952,9 @@ static int rbuVfsRead(
|
||||
rbuPutU32(&aBuf[24], pRbu->pRbuFd->iCookie+1); /* Change counter */
|
||||
|
||||
if( iAmt>100 ){
|
||||
assert( iAmt>=101 );
|
||||
memset(&aBuf[101], 0, iAmt-101);
|
||||
memset(&aBuf[100], 0, iAmt-100);
|
||||
rbuPutU16(&aBuf[105], iAmt & 0xFFFF);
|
||||
aBuf[100] = 0x0D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user