Queries must hit SQLITE_DONE to execute profiling callback

This commit is contained in:
Julien BLACHE 2011-06-11 17:24:59 +02:00
parent d05634fddd
commit 333b7710bc

View File

@ -676,6 +676,11 @@ db_get_count(char *query)
ret = sqlite3_column_int(stmt, 0);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
return ret;
@ -1638,6 +1643,11 @@ db_file_path_byid(int id)
if (res)
res = strdup(res);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);
@ -1679,6 +1689,11 @@ db_file_id_byquery(char *query)
ret = sqlite3_column_int(stmt, 0);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
return ret;
@ -1823,6 +1838,11 @@ db_file_stamp_bypath(char *path)
stamp = (time_t)sqlite3_column_int64(stmt, 0);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);
@ -1937,6 +1957,11 @@ db_file_fetch_byquery(char *query)
}
}
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
return mfi;
@ -2373,6 +2398,11 @@ db_pl_id_bypath(char *path, int *id)
*id = sqlite3_column_int(stmt, 0);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);
@ -2950,6 +2980,11 @@ db_group_type_byid(int id)
ret = sqlite3_column_int(stmt, 0);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);
@ -3073,6 +3108,11 @@ db_pairing_fetch_byguid(struct pairing_info *pi)
pi->remote_id = strdup((char *)sqlite3_column_text(stmt, 0));
pi->name = strdup((char *)sqlite3_column_text(stmt, 1));
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);
@ -3161,6 +3201,11 @@ db_speaker_get(uint64_t id, int *selected, int *volume)
*selected = sqlite3_column_int(stmt, 0);
*volume = sqlite3_column_int(stmt, 1);
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
ret = 0;
@ -3451,6 +3496,11 @@ db_watch_get_bywd(struct watch_info *wi)
}
}
#ifdef DB_PROFILE
while (db_blocking_step(stmt) == SQLITE_ROW)
; /* EMPTY */
#endif
sqlite3_finalize(stmt);
sqlite3_free(query);