1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Rig sqlite3_serialize() so that it will initialize a previously uninitialized

database prior to serializing it, so that it does not have a zero-byte size
and does not return NULL (except for OOM).
[forum:/forumpost/498777780e16880a|Forum thread 498777780e16880a].

FossilOrigin-Name: e638d5e408ea2e189b6771d16bbc2e42c606e88e05fbea78079b6e39e41f344c
This commit is contained in:
drh
2024-01-20 16:29:19 +00:00
parent 4c43f1881e
commit b23f61b73f
4 changed files with 28 additions and 8 deletions

View File

@ -267,4 +267,16 @@ if {[wal_is_capable]} {
} {1 {database disk image is malformed}}
}
# 2024-01-20
# https://sqlite.org/forum/forumpost/498777780e16880a
#
# Make sure a database is initialized before serializing it.
#
reset_db
sqlite3 dbempty :memory:
do_test 900 {
set len [string length [dbempty serialize]]
expr {$len>0}
} 1
finish_test