1
0
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:
drh
2018-12-06 01:08:58 +00:00
parent 7b278f0c3d
commit 1f169fefca
3 changed files with 9 additions and 7 deletions

View File

@@ -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;
}