aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-13 19:43:17 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-13 19:43:17 +0000
commit54edcbe9ce37e934a0d045fdde27e9caa3ac145a (patch)
tree1f87dffbbb93f09bb4d0b606022ad9595d11bad8 /src/datastore
parent2151b951b91971bd9c906b12ab940b0ee0038001 (diff)
downloadgnunet-54edcbe9ce37e934a0d045fdde27e9caa3ac145a.tar.gz
gnunet-54edcbe9ce37e934a0d045fdde27e9caa3ac145a.zip
mysql hackery
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/Makefile.am4
-rw-r--r--src/datastore/plugin_datastore_mysql.c40
2 files changed, 2 insertions, 42 deletions
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am
index a96e22d4c..3c687e8ce 100644
--- a/src/datastore/Makefile.am
+++ b/src/datastore/Makefile.am
@@ -71,10 +71,10 @@ libgnunet_plugin_datastore_mysql_la_SOURCES = \
71 plugin_datastore_mysql.c 71 plugin_datastore_mysql.c
72libgnunet_plugin_datastore_mysql_la_LIBADD = \ 72libgnunet_plugin_datastore_mysql_la_LIBADD = \
73 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 73 $(top_builddir)/src/statistics/libgnunetstatistics.la \
74 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lsqlite3 74 $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
75libgnunet_plugin_datastore_mysql_la_LDFLAGS = \ 75libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
76 $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient 76 $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
77libgnunet_plugin_datastore_sqlite_la_CPFLAGS = \ 77libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
78 $(MYSQL_CPPFLAGS) 78 $(MYSQL_CPPFLAGS)
79 79
80 80
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 */
582static char *
583run_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 *