diff options
Diffstat (limited to 'src/datastore/plugin_datastore_mysql.c')
-rw-r--r-- | src/datastore/plugin_datastore_mysql.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index 98c6c4ab3..c216e989c 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c | |||
@@ -572,46 +572,6 @@ run_statement (struct Plugin *plugin, | |||
572 | } | 572 | } |
573 | 573 | ||
574 | 574 | ||
575 | #if 0 | ||
576 | /** | ||
577 | * Run the given MySQL SELECT statement. The statement | ||
578 | * must have only a single result (one column, one row). | ||
579 | * | ||
580 | * @return result on success, NULL on error | ||
581 | */ | ||
582 | static char * | ||
583 | run_statement_select (struct Plugin *plugin, | ||
584 | const char *statement) | ||
585 | { | ||
586 | MYSQL_RES *sql_res; | ||
587 | MYSQL_ROW sql_row; | ||
588 | char *ret; | ||
589 | |||
590 | if ((NULL == plugin->dbf) && (GNUNET_OK != iopen (plugin))) | ||
591 | return NULL; | ||
592 | mysql_query (plugin->dbf, statement); | ||
593 | if ((mysql_error (plugin->dbf)[0]) || | ||
594 | (!(sql_res = mysql_use_result (plugin->dbf))) || | ||
595 | (!(sql_row = mysql_fetch_row (sql_res)))) | ||
596 | { | ||
597 | LOG_MYSQL (GNUNET_ERROR_TYPE_ERROR, | ||
598 | "mysql_query", plugin); | ||
599 | return NULL; | ||
600 | } | ||
601 | if ((mysql_num_fields (sql_res) != 1) || (sql_row[0] == NULL)) | ||
602 | { | ||
603 | GNUNET_break (mysql_num_fields (sql_res) == 1); | ||
604 | if (sql_res != NULL) | ||
605 | mysql_free_result (sql_res); | ||
606 | return NULL; | ||
607 | } | ||
608 | ret = GNUNET_strdup (sql_row[0]); | ||
609 | mysql_free_result (sql_res); | ||
610 | return ret; | ||
611 | } | ||
612 | #endif | ||
613 | |||
614 | |||
615 | /** | 575 | /** |
616 | * Create a prepared statement. | 576 | * Create a prepared statement. |
617 | * | 577 | * |