MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / sqlite3_normalized_sql

Function sqlite3_normalized_sql

sqlite/src/vdbeapi.c:2153–2170  ·  view source on GitHub ↗

** Return the normalized SQL associated with a prepared statement. */

Source from the content-addressed store, hash-verified

2151** Return the normalized SQL associated with a prepared statement.
2152*/
2153const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
2154 Vdbe *p = (Vdbe *)pStmt;
2155 if( p==0 ) return 0;
2156 if( p->zNormSql==0 && ALWAYS(p->zSql!=0) ){
2157 sqlite3_mutex_enter(p->db->mutex);
2158#if defined(SQLITE_BUILDING_FOR_COMDB2)
2159 if( gbl_alternate_normalize ){
2160 p->zNormSql = sqlite3Normalize_alternate(p, p->zSql, 0);
2161 }else{
2162 p->zNormSql = sqlite3Normalize(p, p->zSql, 0);
2163 }
2164#else /* defined(SQLITE_BUILDING_FOR_COMDB2) */
2165 p->zNormSql = sqlite3Normalize(p, p->zSql);
2166#endif /* defined(SQLITE_BUILDING_FOR_COMDB2) */
2167 sqlite3_mutex_leave(p->db->mutex);
2168 }
2169 return p->zNormSql;
2170}
2171#endif /* SQLITE_ENABLE_NORMALIZE */
2172
2173#ifdef SQLITE_ENABLE_PREUPDATE_HOOK

Callers 6

test_norm_sqlFunction · 0.85
sql_trace_callbackFunction · 0.85
normalizeSqlFuncFunction · 0.85
normalize_stmt_and_storeFunction · 0.85
prepare_fingerprintFunction · 0.85
lua_end_stepFunction · 0.85

Calls 3

sqlite3_mutex_enterFunction · 0.85
sqlite3_mutex_leaveFunction · 0.85

Tested by 1

test_norm_sqlFunction · 0.68