Be sure to hold the database connection mutex while calling sqlite3VdbeExpand()

from within sqlite3_expanded_sql().

FossilOrigin-Name: 527b5ba68c0b0185958b945b197f9022951d9379
This commit is contained in:
drh
2016-07-22 20:45:03 +00:00
parent dec8bc0eb4
commit 9a8b9ec51c
3 changed files with 12 additions and 8 deletions
+5 -1
View File
@@ -86,8 +86,12 @@ char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
return 0;
#else
Vdbe *p = (Vdbe *)pStmt;
char *z;
if( p==0 || p->zSql==0 ) return 0;
return sqlite3VdbeExpandSql(p, p->zSql);
sqlite3_mutex_enter(p->db->mutex);
z = sqlite3VdbeExpandSql(p, p->zSql);
sqlite3_mutex_leave(p->db->mutex);
return z;
#endif
}