mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix a missing mutex in the sqlite3_normalized_sql() interface when it is
called on a prepared statement that did not previously have a computed normalization of the input SQL. FossilOrigin-Name: 1a1a59c6c570879c8f318bbc132103c0285088ba233dd8c32e049b86419347b0
This commit is contained in:
@@ -1714,7 +1714,9 @@ const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
|
||||
Vdbe *p = (Vdbe *)pStmt;
|
||||
if( p==0 ) return 0;
|
||||
if( p->zNormSql==0 && p->zSql!=0 ){
|
||||
sqlite3_mutex_enter(p->db->mutex);
|
||||
p->zNormSql = sqlite3Normalize(p, p->zSql, sqlite3Strlen30(p->zSql));
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
}
|
||||
return p->zNormSql;
|
||||
}
|
||||
|
Reference in New Issue
Block a user