Fix a problem with script mode and lost-and-found tables.
FossilOrigin-Name: 09ec588d2fe24dd321e88318fe90a9ae912cbc73c8a2d59a10c821625dd12d9d
This commit is contained in:
parent
d5e3fe50f8
commit
108c51b6ae
@ -800,13 +800,24 @@ static sqlite3_stmt *recoverLostAndFoundInsert(
|
||||
const char *zSep = "";
|
||||
sqlite3_stmt *pRet = 0;
|
||||
|
||||
for(ii=0; ii<nTotal; ii++){
|
||||
zBind = recoverMPrintf(p, "%z%s?", zBind, zBind?", ":"", ii);
|
||||
if( p->xSql==0 ){
|
||||
for(ii=0; ii<nTotal; ii++){
|
||||
zBind = recoverMPrintf(p, "%z%s?", zBind, zBind?", ":"", ii);
|
||||
}
|
||||
pRet = recoverPreparePrintf(
|
||||
p, p->dbOut, "INSERT INTO %s VALUES(%s)", zTab, zBind
|
||||
);
|
||||
}else{
|
||||
const char *zSep = "";
|
||||
for(ii=0; ii<nTotal; ii++){
|
||||
zBind = recoverMPrintf(p, "%z%squote(?)", zBind, zSep);
|
||||
zSep = "|| ', ' ||";
|
||||
}
|
||||
pRet = recoverPreparePrintf(
|
||||
p, p->dbOut, "SELECT 'INSERT INTO %s VALUES(' || %s || ')'", zTab, zBind
|
||||
);
|
||||
}
|
||||
|
||||
pRet = recoverPreparePrintf(
|
||||
p, p->dbOut, "INSERT INTO %s VALUES(%s)", zTab, zBind
|
||||
);
|
||||
sqlite3_free(zBind);
|
||||
return pRet;
|
||||
}
|
||||
@ -860,7 +871,9 @@ static void recoverLostAndFoundPopulate(
|
||||
for(ii=0; ii<nVal; ii++){
|
||||
sqlite3_bind_value(pInsert, 5+ii, apVal[ii]);
|
||||
}
|
||||
sqlite3_step(pInsert);
|
||||
if( sqlite3_step(pInsert)==SQLITE_ROW && p->xSql ){
|
||||
recoverSqlCallback(p, sqlite3_column_text(pInsert, 0));
|
||||
}
|
||||
recoverReset(p, pInsert);
|
||||
|
||||
/* Discard the accumulated row data */
|
||||
@ -1229,6 +1242,8 @@ static void recoverStep(sqlite3_recover *p){
|
||||
|
||||
assert( p->errCode==SQLITE_OK );
|
||||
|
||||
recoverSqlCallback(p, "PRAGMA writable_schema = on");
|
||||
|
||||
if( p->dbOut==0 ){
|
||||
if( recoverOpenOutput(p) ) return;
|
||||
if( recoverCacheSchema(p) ) return;
|
||||
@ -1237,6 +1252,8 @@ static void recoverStep(sqlite3_recover *p){
|
||||
if( p->zLostAndFound && recoverLostAndFound(p) ) return;
|
||||
if( recoverWriteSchema2(p) ) return;
|
||||
}
|
||||
|
||||
recoverSqlCallback(p, "PRAGMA writable_schema = off");
|
||||
}
|
||||
|
||||
int sqlite3_recover_step(sqlite3_recover *p){
|
||||
|
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Add\sa\smode\sto\soutput\sSQL\sstatements\sinstead\sof\spopulating\sa\sdatabase\sto\sthe\srecover\sextension.
|
||||
D 2022-09-05T21:00:22.268
|
||||
C Fix\sa\sproblem\swith\sscript\smode\sand\slost-and-found\stables.
|
||||
D 2022-09-05T21:22:35.859
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -390,7 +390,7 @@ F ext/rbu/test_rbu.c 03f6f177096a5f822d68d8e4069ad8907fe572c62ff2d19b141f5974282
|
||||
F ext/recover/recover1.test ae8ce9828210aa6c466bf88e23b0933849d5bb43091abe48cf2e56d636e51e93
|
||||
F ext/recover/recover_common.tcl 6679af7dffc858e345053a91c9b0a897595b4a13007aceffafca75304ccb137c
|
||||
F ext/recover/recoverold.test f368a6ae2db12b6017257b332a19ab5df527f4061e43f12f5c85d8e2b236f074
|
||||
F ext/recover/sqlite3recover.c 47767b52f09fb1bba47009236285f09bcf68b6b5d1ec0de96b1a30b508e536a4
|
||||
F ext/recover/sqlite3recover.c 5dca1b3904cb028bef7348a5e0726a253c48f7fcd5da5ec687a44e4e665a24bf
|
||||
F ext/recover/sqlite3recover.h 32f89b66f0235c0d94dfee0f1c3e9ed1ad726b3c4f3716ef0262b31cc33e8301
|
||||
F ext/recover/test_recover.c be0d74f0eba44fe7964e22d287dba0f3fa2baf197f630d51f0f9066af9b5eb2a
|
||||
F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15
|
||||
@ -2005,8 +2005,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 69cc9aba56a196bbd159bd24868aa5ccc60bed0dc612d09ed8a3ae898f156809
|
||||
R fe94b03379801a454a2e4362e6c6eea7
|
||||
P 73058416e7da6581000898b7988a7010e2ce6632246f4c12b4398700c7744b83
|
||||
R 9dcaa53e272447eefaba97715f5d61ae
|
||||
U dan
|
||||
Z bbf845b5205dd27415c5eec6b9356a28
|
||||
Z 82e767f579594364114308f585b07fed
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
73058416e7da6581000898b7988a7010e2ce6632246f4c12b4398700c7744b83
|
||||
09ec588d2fe24dd321e88318fe90a9ae912cbc73c8a2d59a10c821625dd12d9d
|
Loading…
x
Reference in New Issue
Block a user