/ Check-in [1a1a59c6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1a1a59c6c570879c8f318bbc132103c0285088ba233dd8c32e049b86419347b0
User & Date: drh 2018-12-06 01:08:58
Context
2018-12-06
01:53
Fix a potential NULL pointer dereference that can occur in ALTER TABLE following an OOM. Test case in TH3. check-in: ea50815b user: drh tags: trunk
01:08
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. check-in: 1a1a59c6 user: drh tags: trunk
2018-12-05
23:56
Get rid of the hash table used to track IN operators in the sqlite3_normalized_sql() implementation. Use simple integer variables instead. check-in: 272dc74f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeapi.c.

  1710   1710   /*
  1711   1711   ** Return the normalized SQL associated with a prepared statement.
  1712   1712   */
  1713   1713   const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
  1714   1714     Vdbe *p = (Vdbe *)pStmt;
  1715   1715     if( p==0 ) return 0;
  1716   1716     if( p->zNormSql==0 && p->zSql!=0 ){
         1717  +    sqlite3_mutex_enter(p->db->mutex);
  1717   1718       p->zNormSql = sqlite3Normalize(p, p->zSql, sqlite3Strlen30(p->zSql));
         1719  +    sqlite3_mutex_leave(p->db->mutex);
  1718   1720     }
  1719   1721     return p->zNormSql;
  1720   1722   }
  1721   1723   #endif /* SQLITE_ENABLE_NORMALIZE */
  1722   1724   
  1723   1725   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
  1724   1726   /*