Skip to content

Commit

Permalink
Debug usage insert
Browse files Browse the repository at this point in the history
  • Loading branch information
kristrev committed Aug 31, 2019
1 parent 5f8573e commit 992e8a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metadata_writer_inventory_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ static int32_t md_inventory_execute_insert_usage(struct md_writer_sqlite *mws,
uint8_t interface_id_idx = 2;
sqlite3_stmt *stmt = mws->insert_usage;
const char *no_iccid_str = "0";
char *sql_stmt_str;

sqlite3_clear_bindings(stmt);
sqlite3_reset(stmt);
Expand Down Expand Up @@ -277,6 +278,13 @@ static int32_t md_inventory_execute_insert_usage(struct md_writer_sqlite *mws,
return SQLITE_ERROR;
}

sql_stmt_str = sqlite3_expanded_sql(stmt);

if (sql_stmt_str) {
META_PRINT_SYSLOG(mws->parent, LOG_ERR, "Insert query: %s\n", sql_stmt_str);
sqlite3_free(sql_stmt_str);
}

return sqlite3_step(stmt);
}

Expand Down

0 comments on commit 992e8a4

Please sign in to comment.