aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-09-22 12:19:13 +0000
committerGabor X Toth <*@tg-x.net>2016-09-22 12:19:13 +0000
commit7a2d50d952610d17c3e3fb6d19cddfcafbde194e (patch)
treea9c9142d148029d29d759128ffb766e54b0cdce5 /src/psycstore
parent804b21e74e25b3d42719688ba809ef7f04c80803 (diff)
downloadgnunet-7a2d50d952610d17c3e3fb6d19cddfcafbde194e.tar.gz
gnunet-7a2d50d952610d17c3e3fb6d19cddfcafbde194e.zip
psycstore/mysql: check return values
Diffstat (limited to 'src/psycstore')
-rw-r--r--src/psycstore/plugin_psycstore_mysql.c184
1 files changed, 80 insertions, 104 deletions
diff --git a/src/psycstore/plugin_psycstore_mysql.c b/src/psycstore/plugin_psycstore_mysql.c
index 29ccf1a47..2896f4968 100644
--- a/src/psycstore/plugin_psycstore_mysql.c
+++ b/src/psycstore/plugin_psycstore_mysql.c
@@ -56,7 +56,13 @@
56 * a failure of the command 'cmd' on file 'filename' 56 * a failure of the command 'cmd' on file 'filename'
57 * with the message given by strerror(errno). 57 * with the message given by strerror(errno).
58 */ 58 */
59#define LOG_MYSQL(db, level, cmd, stmt) do { GNUNET_log_from (level, "psycstore-mysql", _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, mysql_stmt_error (GNUNET_MYSQL_statement_get_stmt(stmt))); } while(0) 59#define LOG_MYSQL(db, level, cmd, stmt) \
60 do { \
61 GNUNET_log_from (level, "psycstore-mysql", \
62 _("`%s' failed at %s:%d with error: %s\n"), \
63 cmd, __FILE__, __LINE__, \
64 mysql_stmt_error (GNUNET_MYSQL_statement_get_stmt(stmt))); \
65 } while (0)
60 66
61#define LOG(kind,...) GNUNET_log_from (kind, "psycstore-mysql", __VA_ARGS__) 67#define LOG(kind,...) GNUNET_log_from (kind, "psycstore-mysql", __VA_ARGS__)
62 68
@@ -282,7 +288,7 @@ database_setup (struct Plugin *plugin)
282 "psycstore-mysql", "FILENAME"); 288 "psycstore-mysql", "FILENAME");
283 return GNUNET_SYSERR; 289 return GNUNET_SYSERR;
284 } 290 }
285 291
286 if (GNUNET_OK != GNUNET_DISK_file_test (filename)) 292 if (GNUNET_OK != GNUNET_DISK_file_test (filename))
287 { 293 {
288 if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (filename)) 294 if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (filename))
@@ -619,12 +625,10 @@ exec_channel (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt,
619 GNUNET_MY_query_param_end 625 GNUNET_MY_query_param_end
620 }; 626 };
621 627
622 if(GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 628 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
623 stmt,
624 params))
625 { 629 {
626 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 630 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
627 "mysql exec_channel", stmt); 631 "mysql exec_channel", stmt);
628 } 632 }
629 633
630 if (0 != mysql_stmt_reset (GNUNET_MYSQL_statement_get_stmt (stmt))) 634 if (0 != mysql_stmt_reset (GNUNET_MYSQL_statement_get_stmt (stmt)))
@@ -645,17 +649,15 @@ static int
645transaction_begin (struct Plugin *plugin, enum Transactions transaction) 649transaction_begin (struct Plugin *plugin, enum Transactions transaction)
646{ 650{
647 struct GNUNET_MYSQL_StatementHandle *stmt = plugin->transaction_begin; 651 struct GNUNET_MYSQL_StatementHandle *stmt = plugin->transaction_begin;
648 652
649 struct GNUNET_MY_QueryParam params[] = { 653 struct GNUNET_MY_QueryParam params[] = {
650 GNUNET_MY_query_param_end 654 GNUNET_MY_query_param_end
651 }; 655 };
652 656
653 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 657 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
654 stmt,
655 params))
656 { 658 {
657 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 659 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
658 "mysql extract_result", stmt); 660 "mysql exexc_prepared", stmt);
659 return GNUNET_SYSERR; 661 return GNUNET_SYSERR;
660 } 662 }
661 663
@@ -683,12 +685,10 @@ transaction_commit (struct Plugin *plugin)
683 GNUNET_MY_query_param_end 685 GNUNET_MY_query_param_end
684 }; 686 };
685 687
686 if (GNUNET_OK != GNUNET_MY_exec_prepared( plugin->mc, 688 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
687 stmt,
688 params))
689 { 689 {
690 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 690 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
691 "mysql extract_result", stmt); 691 "mysql exec_prepared", stmt);
692 return GNUNET_SYSERR; 692 return GNUNET_SYSERR;
693 } 693 }
694 694
@@ -716,12 +716,10 @@ transaction_rollback (struct Plugin *plugin)
716 GNUNET_MY_query_param_end 716 GNUNET_MY_query_param_end
717 }; 717 };
718 718
719 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 719 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
720 stmt,
721 params))
722 { 720 {
723 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 721 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
724 "mysql extract_result", stmt); 722 "mysql exec_prepared", stmt);
725 return GNUNET_SYSERR; 723 return GNUNET_SYSERR;
726 } 724 }
727 725
@@ -748,12 +746,10 @@ channel_key_store (struct Plugin *plugin,
748 GNUNET_MY_query_param_end 746 GNUNET_MY_query_param_end
749 }; 747 };
750 748
751 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 749 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
752 stmt,
753 params))
754 { 750 {
755 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 751 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
756 "mysql exec_prepared", stmt); 752 "mysql exec_prepared", stmt);
757 return GNUNET_SYSERR; 753 return GNUNET_SYSERR;
758 } 754 }
759 755
@@ -779,12 +775,10 @@ slave_key_store (struct Plugin *plugin,
779 GNUNET_MY_query_param_end 775 GNUNET_MY_query_param_end
780 }; 776 };
781 777
782 if (GNUNET_OK != GNUNET_MY_exec_prepared( plugin->mc, 778 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
783 stmt,
784 params))
785 { 779 {
786 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 780 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
787 "mysql exec_prepared", stmt); 781 "mysql exec_prepared", stmt);
788 return GNUNET_SYSERR; 782 return GNUNET_SYSERR;
789 } 783 }
790 784
@@ -846,12 +840,10 @@ mysql_membership_store (void *cls,
846 GNUNET_MY_query_param_end 840 GNUNET_MY_query_param_end
847 }; 841 };
848 842
849 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 843 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params))
850 stmt,
851 params))
852 { 844 {
853 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 845 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
854 "mysql exec_prepared", stmt); 846 "mysql exec_prepared", stmt);
855 return GNUNET_SYSERR; 847 return GNUNET_SYSERR;
856 } 848 }
857 849
@@ -893,9 +885,7 @@ membership_test (void *cls,
893 GNUNET_MY_query_param_end 885 GNUNET_MY_query_param_end
894 }; 886 };
895 887
896 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 888 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
897 stmt,
898 params_select))
899 { 889 {
900 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 890 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
901 "mysql execute prepared", stmt); 891 "mysql execute prepared", stmt);
@@ -990,9 +980,7 @@ fragment_store (void *cls,
990 GNUNET_MY_query_param_end 980 GNUNET_MY_query_param_end
991 }; 981 };
992 982
993 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 983 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_insert))
994 stmt,
995 params_insert))
996 { 984 {
997 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 985 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
998 "mysql execute prepared", stmt); 986 "mysql execute prepared", stmt);
@@ -1035,14 +1023,13 @@ message_add_flags (void *cls,
1035 GNUNET_MY_query_param_end 1023 GNUNET_MY_query_param_end
1036 }; 1024 };
1037 1025
1038 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, 1026 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params_update);
1039 stmt, 1027 switch (sql_ret)
1040 params_update);
1041 switch(sql_ret)
1042 { 1028 {
1043 case GNUNET_OK: 1029 case GNUNET_OK:
1044 ret = GNUNET_OK; 1030 ret = GNUNET_OK;
1045 break; 1031 break;
1032
1046 default: 1033 default:
1047 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1034 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1048 "mysql execute prepared", stmt); 1035 "mysql execute prepared", stmt);
@@ -1106,12 +1093,12 @@ fragment_row (struct GNUNET_MYSQL_StatementHandle *stmt,
1106 { 1093 {
1107 case GNUNET_NO: 1094 case GNUNET_NO:
1108 if (ret != GNUNET_OK) 1095 if (ret != GNUNET_OK)
1109 ret = GNUNET_NO; 1096 ret = GNUNET_NO;
1110 break; 1097 break;
1098
1111 case GNUNET_OK: 1099 case GNUNET_OK:
1100 mp = GNUNET_malloc (sizeof (*mp) + buf_size);
1112 1101
1113 mp = GNUNET_malloc (sizeof (*mp) + buf_size);
1114
1115 mp->header.size = htons (sizeof (*mp) + buf_size); 1102 mp->header.size = htons (sizeof (*mp) + buf_size);
1116 mp->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE); 1103 mp->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE);
1117 mp->hop_counter = htonl (hop_counter); 1104 mp->hop_counter = htonl (hop_counter);
@@ -1130,13 +1117,11 @@ fragment_row (struct GNUNET_MYSQL_StatementHandle *stmt,
1130 GNUNET_memcpy (&mp[1], 1117 GNUNET_memcpy (&mp[1],
1131 buf, 1118 buf,
1132 buf_size); 1119 buf_size);
1133 ret = cb (cb_cls, 1120 ret = cb (cb_cls, mp, (enum GNUNET_PSYCSTORE_MessageFlags) flags);
1134 mp, 1121
1135 (enum GNUNET_PSYCSTORE_MessageFlags) flags);
1136
1137 GNUNET_MY_cleanup_result (results); 1122 GNUNET_MY_cleanup_result (results);
1138
1139 break; 1123 break;
1124
1140 default: 1125 default:
1141 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1126 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1142 "mysql extract_result", stmt); 1127 "mysql extract_result", stmt);
@@ -1155,37 +1140,29 @@ fragment_select (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stm
1155 int ret = GNUNET_SYSERR; 1140 int ret = GNUNET_SYSERR;
1156 int sql_ret; 1141 int sql_ret;
1157 1142
1158 if(NULL == plugin->mc) 1143 // FIXME
1159 { 1144 if (NULL == plugin->mc || NULL == stmt || NULL == params)
1160 fprintf(stderr, "bla\n");
1161 }
1162
1163 if(NULL == stmt)
1164 { 1145 {
1165 fprintf(stderr, "blo\n" ); 1146 fprintf(stderr, "%p %p %p\n", plugin->mc, stmt, params);
1166 } 1147 return GNUNET_SYSERR;
1167
1168 if(NULL == params)
1169 {
1170 fprintf(stderr, "toot\n" );
1171 } 1148 }
1172 1149
1173 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, 1150 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params);
1174 stmt, 1151 switch (sql_ret)
1175 params);
1176 switch(sql_ret)
1177 { 1152 {
1178 case GNUNET_NO: 1153 case GNUNET_NO:
1179 if (ret != GNUNET_OK) 1154 if (ret != GNUNET_OK)
1180 ret = GNUNET_NO; 1155 ret = GNUNET_NO;
1181 break; 1156 break;
1157
1182 case GNUNET_YES: 1158 case GNUNET_YES:
1183 ret = fragment_row (stmt, cb, cb_cls); 1159 ret = fragment_row (stmt, cb, cb_cls);
1184 (*returned_fragments)++; 1160 (*returned_fragments)++;
1185 break; 1161 break;
1162
1186 default: 1163 default:
1187 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1164 LOG_MYSQL (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1188 "mysql exec_prepared", stmt); 1165 "mysql exec_prepared", stmt);
1189 } 1166 }
1190 1167
1191 return ret; 1168 return ret;
@@ -1388,17 +1365,17 @@ message_get_fragment (void *cls,
1388 GNUNET_MY_query_param_end 1365 GNUNET_MY_query_param_end
1389 }; 1366 };
1390 1367
1391 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, 1368 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select);
1392 stmt, 1369 switch (sql_ret)
1393 params_select);
1394 switch(sql_ret)
1395 { 1370 {
1396 case GNUNET_NO: 1371 case GNUNET_NO:
1397 ret = GNUNET_NO; 1372 ret = GNUNET_NO;
1398 break; 1373 break;
1374
1399 case GNUNET_OK: 1375 case GNUNET_OK:
1400 ret = fragment_row (stmt, cb, cb_cls); 1376 ret = fragment_row (stmt, cb, cb_cls);
1401 break; 1377 break;
1378
1402 default: 1379 default:
1403 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1380 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1404 "mysql execute prepared", stmt); 1381 "mysql execute prepared", stmt);
@@ -1439,9 +1416,7 @@ counters_message_get (void *cls,
1439 GNUNET_MY_query_param_end 1416 GNUNET_MY_query_param_end
1440 }; 1417 };
1441 1418
1442 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 1419 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
1443 stmt,
1444 params_select))
1445 { 1420 {
1446 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1421 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1447 "mysql execute prepared", stmt); 1422 "mysql execute prepared", stmt);
@@ -1498,9 +1473,7 @@ counters_state_get (void *cls,
1498 GNUNET_MY_query_param_end 1473 GNUNET_MY_query_param_end
1499 }; 1474 };
1500 1475
1501 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, 1476 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
1502 stmt,
1503 params_select))
1504 { 1477 {
1505 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1478 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1506 "mysql execute prepared", stmt); 1479 "mysql execute prepared", stmt);
@@ -1552,14 +1525,11 @@ state_assign (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt,
1552 GNUNET_MY_query_param_end 1525 GNUNET_MY_query_param_end
1553 }; 1526 };
1554 1527
1555 ret = GNUNET_MY_exec_prepared (plugin->mc, 1528 ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params);
1556 stmt,
1557 params);
1558
1559 if (GNUNET_OK != ret) 1529 if (GNUNET_OK != ret)
1560 { 1530 {
1561 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1531 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1562 "mysql execute prepared", stmt); 1532 "mysql exec_prepared", stmt);
1563 return GNUNET_SYSERR; 1533 return GNUNET_SYSERR;
1564 } 1534 }
1565 1535
@@ -1829,16 +1799,16 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
1829 GNUNET_MY_result_spec_end 1799 GNUNET_MY_result_spec_end
1830 }; 1800 };
1831 1801
1832 GNUNET_MY_exec_prepared (plugin->mc, 1802 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
1833 stmt,
1834 params_select);
1835
1836
1837 sql_ret = GNUNET_MY_extract_result (stmt,
1838 results);
1839
1840 switch (sql_ret)
1841 { 1803 {
1804 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1805 "mysql exec_prepared", stmt);
1806 }
1807 else
1808 {
1809 sql_ret = GNUNET_MY_extract_result (stmt, results);
1810 switch (sql_ret)
1811 {
1842 case GNUNET_NO: 1812 case GNUNET_NO:
1843 ret = GNUNET_NO; 1813 ret = GNUNET_NO;
1844 break; 1814 break;
@@ -1848,7 +1818,8 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
1848 break; 1818 break;
1849 default: 1819 default:
1850 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1820 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1851 "mysql extract_result", stmt); 1821 "mysql extract_result", stmt);
1822 }
1852 } 1823 }
1853 1824
1854 if (0 != mysql_stmt_reset (GNUNET_MYSQL_statement_get_stmt (stmt))) 1825 if (0 != mysql_stmt_reset (GNUNET_MYSQL_statement_get_stmt (stmt)))
@@ -1903,17 +1874,20 @@ state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_
1903 1874
1904 do 1875 do
1905 { 1876 {
1906 GNUNET_MY_exec_prepared (plugin->mc, 1877 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
1907 stmt, 1878 {
1908 params_select); 1879 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1909 sql_ret = GNUNET_MY_extract_result (stmt, 1880 "mysql exec_prepared", stmt);
1910 results); 1881 break;
1882 }
1883 sql_ret = GNUNET_MY_extract_result (stmt, results);
1911 switch (sql_ret) 1884 switch (sql_ret)
1912 { 1885 {
1913 case GNUNET_NO: 1886 case GNUNET_NO:
1914 if (ret != GNUNET_OK) 1887 if (ret != GNUNET_OK)
1915 ret = GNUNET_NO; 1888 ret = GNUNET_NO;
1916 break; 1889 break;
1890
1917 case GNUNET_YES: 1891 case GNUNET_YES:
1918 ret = cb (cb_cls, (const char *) name2, 1892 ret = cb (cb_cls, (const char *) name2,
1919 value_current, 1893 value_current,
@@ -1922,6 +1896,7 @@ state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_
1922 if (ret != GNUNET_YES) 1896 if (ret != GNUNET_YES)
1923 sql_ret = GNUNET_NO; 1897 sql_ret = GNUNET_NO;
1924 break; 1898 break;
1899
1925 default: 1900 default:
1926 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 1901 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1927 "mysql extract_result", stmt); 1902 "mysql extract_result", stmt);
@@ -1976,12 +1951,13 @@ state_get_signed (void *cls,
1976 1951
1977 do 1952 do
1978 { 1953 {
1979 GNUNET_MY_exec_prepared (plugin->mc, 1954 if (GNUNET_OK != GNUNET_MY_exec_prepared (plugin->mc, stmt, params_select))
1980 stmt, 1955 {
1981 params_select); 1956 LOG_MYSQL(plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
1982 sql_ret = GNUNET_MY_extract_result (stmt, 1957 "mysql exec_prepared", stmt);
1983 results); 1958 break;
1984 1959 }
1960 sql_ret = GNUNET_MY_extract_result (stmt, results);
1985 switch (sql_ret) 1961 switch (sql_ret)
1986 { 1962 {
1987 case GNUNET_NO: 1963 case GNUNET_NO: