SQLite User Forum

The vacuum statement doesn't enforce the limit on the number of reserved bytes
Login

The vacuum statement doesn't enforce the limit on the number of reserved bytes

(1) By Bo Lindbergh (_blgl_) on 2021-01-21 16:59:14 [source]

	SQLite version 3.34.0 2020-12-01 16:14:00
	Enter ".help" for usage hints.
	sqlite> .dbinfo
	database page size:  1024
	write format:        1
	read format:         1
	reserved bytes:      33
	file change counter: 3
	database page count: 274
	freelist page count: 0
	schema cookie:       10
	schema format:       4
	default cache size:  0
	autovacuum top root: 0
	incremental vacuum:  0
	text encoding:       1 (utf8)
	user version:        0
	application id:      0
	software version:    3034000
	number of tables:    7
	number of indexes:   5
	number of triggers:  0
	number of views:     0
	schema size:         1616
	data version         2
	sqlite> pragma page_size=512;
	sqlite> vacuum;
	sqlite> .dbinfo
	error: file is not a database
	sqlite> 

No error, no warning, just a defunct database file.

(2) By Richard Hipp (drh) on 2021-01-21 21:39:47 in reply to 1 [link] [source]

Thanks for the bug report. The problem is fixed on trunk. If you request a page_size of 512 and reserve_bytes is 33 or more, then the page_size is actually set to 1024. See check-in d5ea75a09d4bf612.

The test cases are in TH3, in case you were wondering.

(3) By anonymous on 2021-01-22 10:16:45 in reply to 2 [link] [source]

A-OK.