aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/memdb.c5
-rw-r--r--src/sqlite.h.in4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/memdb.c b/src/memdb.c
index 4e5751f93..dc29a2db7 100644
--- a/src/memdb.c
+++ b/src/memdb.c
@@ -809,10 +809,11 @@ int sqlite3_deserialize(
sqlite3_mutex_enter(db->mutex);
if( zSchema==0 ) zSchema = db->aDb[0].zDbSName;
iDb = sqlite3FindDbName(db, zSchema);
- if( iDb<0 ){
+ testcase( iDb==1 );
+ if( iDb<2 && iDb!=0 ){
rc = SQLITE_ERROR;
goto end_deserialize;
- }
+ }
zSql = sqlite3_mprintf("ATTACH x AS %Q", zSchema);
if( zSql==0 ){
rc = SQLITE_NOMEM;
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 3ac46fb55..e4ea66a72 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -9923,6 +9923,10 @@ unsigned char *sqlite3_serialize(
** database is currently in a read transaction or is involved in a backup
** operation.
**
+** It is not possible to deserialized into the TEMP database. If the
+** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the
+** function returns SQLITE_ERROR.
+**
** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the
** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then
** [sqlite3_free()] is invoked on argument P prior to returning.