summaryrefslogtreecommitdiffstats
path: root/src/memdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memdb.c')
-rw-r--r--src/memdb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/memdb.c b/src/memdb.c
index 657cb9c..d83a51d 100644
--- a/src/memdb.c
+++ b/src/memdb.c
@@ -799,6 +799,14 @@ unsigned char *sqlite3_serialize(
pOut = 0;
}else{
sz = sqlite3_column_int64(pStmt, 0)*szPage;
+ if( sz==0 ){
+ sqlite3_reset(pStmt);
+ sqlite3_exec(db, "BEGIN IMMEDIATE; COMMIT;", 0, 0, 0);
+ rc = sqlite3_step(pStmt);
+ if( rc==SQLITE_ROW ){
+ sz = sqlite3_column_int64(pStmt, 0)*szPage;
+ }
+ }
if( piSize ) *piSize = sz;
if( mFlags & SQLITE_SERIALIZE_NOCOPY ){
pOut = 0;