diff options
author | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-07-22 14:00:13 +0000 |
---|---|---|
committer | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-07-22 14:00:13 +0000 |
commit | b77b2502d587f576baff39120e6f37235c5b5b90 (patch) | |
tree | c76740b5e3bfaa4792dff5cf1a4b813507973205 /src | |
parent | 3ebe7900679d41b3f08e999c1bc56f13cbbc0257 (diff) | |
download | gnunet-b77b2502d587f576baff39120e6f37235c5b5b90.tar.gz gnunet-b77b2502d587f576baff39120e6f37235c5b5b90.zip |
fix mysql_prepare function
Diffstat (limited to 'src')
-rw-r--r-- | src/psycstore/plugin_psycstore_mysql.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/psycstore/plugin_psycstore_mysql.c b/src/psycstore/plugin_psycstore_mysql.c index 2c06b9b29..6e6b9ac13 100644 --- a/src/psycstore/plugin_psycstore_mysql.c +++ b/src/psycstore/plugin_psycstore_mysql.c | |||
@@ -255,38 +255,13 @@ mysql_prepare (struct GNUNET_MYSQL_Context *mc, | |||
255 | if(NULL == *stmt) | 255 | if(NULL == *stmt) |
256 | LOG(GNUNET_ERROR_TYPE_ERROR, | 256 | LOG(GNUNET_ERROR_TYPE_ERROR, |
257 | _("Error preparing SQL query: %s\n %s\n"), | 257 | _("Error preparing SQL query: %s\n %s\n"), |
258 | mysql_stmt_error (GNUNET_MYSQL_statement_get_stmt (stmt)), sql); | 258 | mysql_stmt_error (GNUNET_MYSQL_statement_get_stmt (*stmt)), sql); |
259 | 259 | ||
260 | return 0; | 260 | return 0; |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | /** | 264 | /** |
265 | * @brief Prepare a SQL statement | ||
266 | * | ||
267 | * @param dbh handle to the database | ||
268 | * @param sql SQL statement, UTF-8 encoded | ||
269 | * @return 0 on success | ||
270 | */ | ||
271 | static int | ||
272 | mysql_exec (struct GNUNET_MYSQL_Context *mc, | ||
273 | struct GNUNET_MYSQL_StatementHandle *sh, | ||
274 | struct GNUNET_MY_QueryParam *qp) | ||
275 | { | ||
276 | int result; | ||
277 | |||
278 | result = GNUNET_MY_exec_prepared (mc, sh, qp); | ||
279 | LOG(GNUNET_ERROR_TYPE_DEBUG, | ||
280 | "Executed `GNUNET_MY_exec_prepared`' / %d\n", result); | ||
281 | if (GNUNET_OK != result) | ||
282 | LOG(GNUNET_ERROR_TYPE_ERROR, | ||
283 | _("Error executing SQL query: %s\n"), | ||
284 | mysql_stmt_error (GNUNET_MYSQL_statement_get_stmt (sh))); | ||
285 | return result; | ||
286 | } | ||
287 | |||
288 | |||
289 | /** | ||
290 | * Initialize the database connections and associated | 265 | * Initialize the database connections and associated |
291 | * data structures (create tables and indices | 266 | * data structures (create tables and indices |
292 | * as needed as well). | 267 | * as needed as well). |