diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datacache/plugin_datacache_postgres.c | 16 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 18 | ||||
-rw-r--r-- | src/include/Makefile.am | 1 | ||||
-rw-r--r-- | src/include/gnunet_db_lib.h | 54 | ||||
-rw-r--r-- | src/include/gnunet_pq_lib.h | 52 | ||||
-rw-r--r-- | src/namecache/plugin_namecache_postgres.c | 14 | ||||
-rw-r--r-- | src/namestore/plugin_namestore_postgres.c | 10 | ||||
-rw-r--r-- | src/pq/pq_eval.c | 44 | ||||
-rw-r--r-- | src/psycstore/plugin_psycstore_postgres.c | 30 |
9 files changed, 132 insertions, 107 deletions
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index c99f5fd68..5c497cdf8 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c | |||
@@ -170,7 +170,7 @@ postgres_plugin_put (void *cls, | |||
170 | path_info_len * sizeof (struct GNUNET_PeerIdentity)), | 170 | path_info_len * sizeof (struct GNUNET_PeerIdentity)), |
171 | GNUNET_PQ_query_param_end | 171 | GNUNET_PQ_query_param_end |
172 | }; | 172 | }; |
173 | enum GNUNET_PQ_QueryStatus ret; | 173 | enum GNUNET_DB_QueryStatus ret; |
174 | 174 | ||
175 | ret = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, | 175 | ret = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
176 | "put", | 176 | "put", |
@@ -311,7 +311,7 @@ postgres_plugin_get (void *cls, | |||
311 | GNUNET_PQ_query_param_uint32 (&type32), | 311 | GNUNET_PQ_query_param_uint32 (&type32), |
312 | GNUNET_PQ_query_param_end | 312 | GNUNET_PQ_query_param_end |
313 | }; | 313 | }; |
314 | enum GNUNET_PQ_QueryStatus res; | 314 | enum GNUNET_DB_QueryStatus res; |
315 | struct HandleResultContext hr_ctx; | 315 | struct HandleResultContext hr_ctx; |
316 | 316 | ||
317 | hr_ctx.iter = iter; | 317 | hr_ctx.iter = iter; |
@@ -354,7 +354,7 @@ postgres_plugin_del (void *cls) | |||
354 | &key), | 354 | &key), |
355 | GNUNET_PQ_result_spec_end | 355 | GNUNET_PQ_result_spec_end |
356 | }; | 356 | }; |
357 | enum GNUNET_PQ_QueryStatus res; | 357 | enum GNUNET_DB_QueryStatus res; |
358 | struct GNUNET_PQ_QueryParam dparam[] = { | 358 | struct GNUNET_PQ_QueryParam dparam[] = { |
359 | GNUNET_PQ_query_param_uint32 (&oid), | 359 | GNUNET_PQ_query_param_uint32 (&oid), |
360 | GNUNET_PQ_query_param_end | 360 | GNUNET_PQ_query_param_end |
@@ -366,7 +366,7 @@ postgres_plugin_del (void *cls) | |||
366 | rs); | 366 | rs); |
367 | if (0 > res) | 367 | if (0 > res) |
368 | return GNUNET_SYSERR; | 368 | return GNUNET_SYSERR; |
369 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == res) | 369 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == res) |
370 | { | 370 | { |
371 | /* no result */ | 371 | /* no result */ |
372 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 372 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -412,7 +412,7 @@ postgres_plugin_get_random (void *cls, | |||
412 | struct GNUNET_PeerIdentity *path; | 412 | struct GNUNET_PeerIdentity *path; |
413 | struct GNUNET_HashCode key; | 413 | struct GNUNET_HashCode key; |
414 | uint32_t type; | 414 | uint32_t type; |
415 | enum GNUNET_PQ_QueryStatus res; | 415 | enum GNUNET_DB_QueryStatus res; |
416 | struct GNUNET_PQ_QueryParam params[] = { | 416 | struct GNUNET_PQ_QueryParam params[] = { |
417 | GNUNET_PQ_query_param_uint32 (&off), | 417 | GNUNET_PQ_query_param_uint32 (&off), |
418 | GNUNET_PQ_query_param_end | 418 | GNUNET_PQ_query_param_end |
@@ -448,7 +448,7 @@ postgres_plugin_get_random (void *cls, | |||
448 | GNUNET_break (0); | 448 | GNUNET_break (0); |
449 | return 0; | 449 | return 0; |
450 | } | 450 | } |
451 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == res) | 451 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == res) |
452 | { | 452 | { |
453 | GNUNET_break (0); | 453 | GNUNET_break (0); |
454 | return 0; | 454 | return 0; |
@@ -595,7 +595,7 @@ postgres_plugin_get_closest (void *cls, | |||
595 | GNUNET_PQ_query_param_uint32 (&num_results32), | 595 | GNUNET_PQ_query_param_uint32 (&num_results32), |
596 | GNUNET_PQ_query_param_end | 596 | GNUNET_PQ_query_param_end |
597 | }; | 597 | }; |
598 | enum GNUNET_PQ_QueryStatus res; | 598 | enum GNUNET_DB_QueryStatus res; |
599 | struct ExtractResultContext erc; | 599 | struct ExtractResultContext erc; |
600 | 600 | ||
601 | erc.iter = iter; | 601 | erc.iter = iter; |
@@ -611,7 +611,7 @@ postgres_plugin_get_closest (void *cls, | |||
611 | "Ending iteration (postgres error)\n"); | 611 | "Ending iteration (postgres error)\n"); |
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == res) | 614 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == res) |
615 | { | 615 | { |
616 | /* no result */ | 616 | /* no result */ |
617 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 617 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index 9380a56c0..fd1a533bb 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c | |||
@@ -198,7 +198,7 @@ postgres_plugin_estimate_size (void *cls, | |||
198 | &total), | 198 | &total), |
199 | GNUNET_PQ_result_spec_end | 199 | GNUNET_PQ_result_spec_end |
200 | }; | 200 | }; |
201 | enum GNUNET_PQ_QueryStatus ret; | 201 | enum GNUNET_DB_QueryStatus ret; |
202 | 202 | ||
203 | if (NULL == estimate) | 203 | if (NULL == estimate) |
204 | return; | 204 | return; |
@@ -206,7 +206,7 @@ postgres_plugin_estimate_size (void *cls, | |||
206 | "estimate_size", | 206 | "estimate_size", |
207 | params, | 207 | params, |
208 | rs); | 208 | rs); |
209 | if (GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT != ret) | 209 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ret) |
210 | { | 210 | { |
211 | *estimate = 0LL; | 211 | *estimate = 0LL; |
212 | return; | 212 | return; |
@@ -247,7 +247,7 @@ postgres_plugin_put (void *cls, | |||
247 | { | 247 | { |
248 | struct Plugin *plugin = cls; | 248 | struct Plugin *plugin = cls; |
249 | struct GNUNET_HashCode vhash; | 249 | struct GNUNET_HashCode vhash; |
250 | enum GNUNET_PQ_QueryStatus ret; | 250 | enum GNUNET_DB_QueryStatus ret; |
251 | 251 | ||
252 | GNUNET_CRYPTO_hash (data, | 252 | GNUNET_CRYPTO_hash (data, |
253 | size, | 253 | size, |
@@ -510,7 +510,7 @@ postgres_plugin_get_key (void *cls, | |||
510 | GNUNET_PQ_query_param_end | 510 | GNUNET_PQ_query_param_end |
511 | }; | 511 | }; |
512 | struct ProcessResultContext prc; | 512 | struct ProcessResultContext prc; |
513 | enum GNUNET_PQ_QueryStatus res; | 513 | enum GNUNET_DB_QueryStatus res; |
514 | 514 | ||
515 | if (random) | 515 | if (random) |
516 | { | 516 | { |
@@ -564,7 +564,7 @@ postgres_plugin_get_zero_anonymity (void *cls, | |||
564 | GNUNET_PQ_query_param_end | 564 | GNUNET_PQ_query_param_end |
565 | }; | 565 | }; |
566 | struct ProcessResultContext prc; | 566 | struct ProcessResultContext prc; |
567 | enum GNUNET_PQ_QueryStatus res; | 567 | enum GNUNET_DB_QueryStatus res; |
568 | 568 | ||
569 | prc.plugin = plugin; | 569 | prc.plugin = plugin; |
570 | prc.proc = proc; | 570 | prc.proc = proc; |
@@ -644,7 +644,7 @@ repl_proc (void *cls, | |||
644 | GNUNET_PQ_query_param_uint32 (&oid), | 644 | GNUNET_PQ_query_param_uint32 (&oid), |
645 | GNUNET_PQ_query_param_end | 645 | GNUNET_PQ_query_param_end |
646 | }; | 646 | }; |
647 | enum GNUNET_PQ_QueryStatus qret; | 647 | enum GNUNET_DB_QueryStatus qret; |
648 | 648 | ||
649 | ret = rc->proc (rc->proc_cls, | 649 | ret = rc->proc (rc->proc_cls, |
650 | key, | 650 | key, |
@@ -689,7 +689,7 @@ postgres_plugin_get_replication (void *cls, | |||
689 | }; | 689 | }; |
690 | struct ReplCtx rc; | 690 | struct ReplCtx rc; |
691 | struct ProcessResultContext prc; | 691 | struct ProcessResultContext prc; |
692 | enum GNUNET_PQ_QueryStatus res; | 692 | enum GNUNET_DB_QueryStatus res; |
693 | 693 | ||
694 | rc.plugin = plugin; | 694 | rc.plugin = plugin; |
695 | rc.proc = proc; | 695 | rc.proc = proc; |
@@ -872,7 +872,7 @@ postgres_plugin_remove_key (void *cls, | |||
872 | void *cont_cls) | 872 | void *cont_cls) |
873 | { | 873 | { |
874 | struct Plugin *plugin = cls; | 874 | struct Plugin *plugin = cls; |
875 | enum GNUNET_PQ_QueryStatus ret; | 875 | enum GNUNET_DB_QueryStatus ret; |
876 | struct GNUNET_PQ_QueryParam params[] = { | 876 | struct GNUNET_PQ_QueryParam params[] = { |
877 | GNUNET_PQ_query_param_auto_from_type (key), | 877 | GNUNET_PQ_query_param_auto_from_type (key), |
878 | GNUNET_PQ_query_param_fixed_size (data, size), | 878 | GNUNET_PQ_query_param_fixed_size (data, size), |
@@ -891,7 +891,7 @@ postgres_plugin_remove_key (void *cls, | |||
891 | _("Postgress exec failure")); | 891 | _("Postgress exec failure")); |
892 | return; | 892 | return; |
893 | } | 893 | } |
894 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == ret) | 894 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == ret) |
895 | { | 895 | { |
896 | cont (cont_cls, | 896 | cont (cont_cls, |
897 | key, | 897 | key, |
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index a1240b05c..e5abec416 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -48,6 +48,7 @@ gnunetinclude_HEADERS = \ | |||
48 | gnunet_datacache_plugin.h \ | 48 | gnunet_datacache_plugin.h \ |
49 | gnunet_datastore_service.h \ | 49 | gnunet_datastore_service.h \ |
50 | gnunet_datastore_plugin.h \ | 50 | gnunet_datastore_plugin.h \ |
51 | gnunet_db_lib.h \ | ||
51 | gnunet_dht_service.h \ | 52 | gnunet_dht_service.h \ |
52 | gnunet_disk_lib.h \ | 53 | gnunet_disk_lib.h \ |
53 | gnunet_dnsparser_lib.h \ | 54 | gnunet_dnsparser_lib.h \ |
diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h new file mode 100644 index 000000000..71ac4aae9 --- /dev/null +++ b/src/include/gnunet_db_lib.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2017 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify it under the | ||
6 | terms of the GNU General Public License as published by the Free Software | ||
7 | Foundation; either version 3, or (at your option) any later version. | ||
8 | |||
9 | GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
11 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with | ||
14 | GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> | ||
15 | */ | ||
16 | /** | ||
17 | * @file include/gnunet_db_lib.h | ||
18 | * @brief shared defintions for transactional databases | ||
19 | * @author Christian Grothoff | ||
20 | */ | ||
21 | #ifndef GNUNET_DB_LIB_H | ||
22 | #define GNUNET_DB_LIB_H | ||
23 | |||
24 | |||
25 | /** | ||
26 | * Status code returned from functions running database commands. | ||
27 | * Can be combined with a function that returns the number | ||
28 | * of results, so non-negative values indicate success. | ||
29 | */ | ||
30 | enum GNUNET_DB_QueryStatus | ||
31 | { | ||
32 | /** | ||
33 | * A hard error occurred, retrying will not help. | ||
34 | */ | ||
35 | GNUNET_DB_STATUS_HARD_ERROR = -2, | ||
36 | |||
37 | /** | ||
38 | * A soft error occurred, retrying the transaction may succeed. | ||
39 | */ | ||
40 | GNUNET_DB_STATUS_SOFT_ERROR = -1, | ||
41 | |||
42 | /** | ||
43 | * The transaction succeeded, but yielded zero results. | ||
44 | */ | ||
45 | GNUNET_DB_STATUS_SUCCESS_NO_RESULTS = 0, | ||
46 | |||
47 | /** | ||
48 | * The transaction succeeded, and yielded one result. | ||
49 | */ | ||
50 | GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1 | ||
51 | |||
52 | }; | ||
53 | |||
54 | #endif | ||
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h index 0f6b88b78..ed295b500 100644 --- a/src/include/gnunet_pq_lib.h +++ b/src/include/gnunet_pq_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2016 GNUnet e.V. | 3 | Copyright (C) 2016, 2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify it under the | 5 | GNUnet is free software; you can redistribute it and/or modify it under the |
6 | terms of the GNU General Public License as published by the Free Software | 6 | terms of the GNU General Public License as published by the Free Software |
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include <libpq-fe.h> | 24 | #include <libpq-fe.h> |
25 | #include "gnunet_util_lib.h" | 25 | #include "gnunet_util_lib.h" |
26 | 26 | #include "gnunet_db_lib.h" | |
27 | 27 | ||
28 | /* ************************* pq_query_helper.c functions ************************ */ | 28 | /* ************************* pq_query_helper.c functions ************************ */ |
29 | 29 | ||
@@ -466,36 +466,6 @@ GNUNET_PQ_cleanup_result (struct GNUNET_PQ_ResultSpec *rs); | |||
466 | 466 | ||
467 | 467 | ||
468 | /** | 468 | /** |
469 | * Status code returned from functions running PQ commands. | ||
470 | * Can be combined with a function that returns the number | ||
471 | * of results, so non-negative values indicate success. | ||
472 | */ | ||
473 | enum GNUNET_PQ_QueryStatus | ||
474 | { | ||
475 | /** | ||
476 | * A hard error occurred, retrying will not help. | ||
477 | */ | ||
478 | GNUNET_PQ_STATUS_HARD_ERROR = -2, | ||
479 | |||
480 | /** | ||
481 | * A soft error occurred, retrying the transaction may succeed. | ||
482 | */ | ||
483 | GNUNET_PQ_STATUS_SOFT_ERROR = -1, | ||
484 | |||
485 | /** | ||
486 | * The transaction succeeded, but yielded zero results. | ||
487 | */ | ||
488 | GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS = 0, | ||
489 | |||
490 | /** | ||
491 | * The transaction succeeded, and yielded one result. | ||
492 | */ | ||
493 | GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT = 1 | ||
494 | |||
495 | }; | ||
496 | |||
497 | |||
498 | /** | ||
499 | * Check the @a result's error code to see what happened. | 469 | * Check the @a result's error code to see what happened. |
500 | * Also logs errors. | 470 | * Also logs errors. |
501 | * | 471 | * |
@@ -503,12 +473,12 @@ enum GNUNET_PQ_QueryStatus | |||
503 | * @param statement_name name of the statement that created @a result | 473 | * @param statement_name name of the statement that created @a result |
504 | * @param result result to check | 474 | * @param result result to check |
505 | * @return status code from the result, mapping PQ status | 475 | * @return status code from the result, mapping PQ status |
506 | * codes to `enum GNUNET_PQ_QueryStatus`. Never | 476 | * codes to `enum GNUNET_DB_QueryStatus`. Never |
507 | * returns positive values as this function does | 477 | * returns positive values as this function does |
508 | * not look at the result set. | 478 | * not look at the result set. |
509 | * @deprecated (low level, let's see if we can do with just the high-level functions) | 479 | * @deprecated (low level, let's see if we can do with just the high-level functions) |
510 | */ | 480 | */ |
511 | enum GNUNET_PQ_QueryStatus | 481 | enum GNUNET_DB_QueryStatus |
512 | GNUNET_PQ_eval_result (PGconn *connection, | 482 | GNUNET_PQ_eval_result (PGconn *connection, |
513 | const char *statement_name, | 483 | const char *statement_name, |
514 | PGresult *result); | 484 | PGresult *result); |
@@ -523,14 +493,14 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
523 | * @param statement_name name of the statement | 493 | * @param statement_name name of the statement |
524 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) | 494 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) |
525 | * @return status code from the result, mapping PQ status | 495 | * @return status code from the result, mapping PQ status |
526 | * codes to `enum GNUNET_PQ_QueryStatus`. If the | 496 | * codes to `enum GNUNET_DB_QueryStatus`. If the |
527 | * statement was a DELETE or UPDATE statement, the | 497 | * statement was a DELETE or UPDATE statement, the |
528 | * number of affected rows is returned; if the | 498 | * number of affected rows is returned; if the |
529 | * statment was an INSERT statement, and no row | 499 | * statment was an INSERT statement, and no row |
530 | * was added due to a UNIQUE violation, we return | 500 | * was added due to a UNIQUE violation, we return |
531 | * zero; if INSERT was successful, we return one. | 501 | * zero; if INSERT was successful, we return one. |
532 | */ | 502 | */ |
533 | enum GNUNET_PQ_QueryStatus | 503 | enum GNUNET_DB_QueryStatus |
534 | GNUNET_PQ_eval_prepared_non_select (PGconn *connection, | 504 | GNUNET_PQ_eval_prepared_non_select (PGconn *connection, |
535 | const char *statement_name, | 505 | const char *statement_name, |
536 | const struct GNUNET_PQ_QueryParam *params); | 506 | const struct GNUNET_PQ_QueryParam *params); |
@@ -563,9 +533,9 @@ typedef void | |||
563 | * @param rh function to call with the result set, NULL to ignore | 533 | * @param rh function to call with the result set, NULL to ignore |
564 | * @param rh_cls closure to pass to @a rh | 534 | * @param rh_cls closure to pass to @a rh |
565 | * @return status code from the result, mapping PQ status | 535 | * @return status code from the result, mapping PQ status |
566 | * codes to `enum GNUNET_PQ_QueryStatus`. | 536 | * codes to `enum GNUNET_DB_QueryStatus`. |
567 | */ | 537 | */ |
568 | enum GNUNET_PQ_QueryStatus | 538 | enum GNUNET_DB_QueryStatus |
569 | GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | 539 | GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, |
570 | const char *statement_name, | 540 | const char *statement_name, |
571 | const struct GNUNET_PQ_QueryParam *params, | 541 | const struct GNUNET_PQ_QueryParam *params, |
@@ -578,7 +548,7 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
578 | * which must return a single result in @a connection using the given | 548 | * which must return a single result in @a connection using the given |
579 | * @a params. Stores the result (if any) in @a rs, which the caller | 549 | * @a params. Stores the result (if any) in @a rs, which the caller |
580 | * must then clean up using #GNUNET_PQ_cleanup_result() if the return | 550 | * must then clean up using #GNUNET_PQ_cleanup_result() if the return |
581 | * value was #GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT. Returns the | 551 | * value was #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT. Returns the |
582 | * resulting session status. | 552 | * resulting session status. |
583 | * | 553 | * |
584 | * @param connection connection to execute the statement in | 554 | * @param connection connection to execute the statement in |
@@ -586,9 +556,9 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
586 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) | 556 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) |
587 | * @param[in,out] rs result specification to use for storing the result of the query | 557 | * @param[in,out] rs result specification to use for storing the result of the query |
588 | * @return status code from the result, mapping PQ status | 558 | * @return status code from the result, mapping PQ status |
589 | * codes to `enum GNUNET_PQ_QueryStatus`. | 559 | * codes to `enum GNUNET_DB_QueryStatus`. |
590 | */ | 560 | */ |
591 | enum GNUNET_PQ_QueryStatus | 561 | enum GNUNET_DB_QueryStatus |
592 | GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, | 562 | GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, |
593 | const char *statement_name, | 563 | const char *statement_name, |
594 | const struct GNUNET_PQ_QueryParam *params, | 564 | const struct GNUNET_PQ_QueryParam *params, |
diff --git a/src/namecache/plugin_namecache_postgres.c b/src/namecache/plugin_namecache_postgres.c index 3cf11f1d8..d943b0cd8 100644 --- a/src/namecache/plugin_namecache_postgres.c +++ b/src/namecache/plugin_namecache_postgres.c | |||
@@ -153,12 +153,12 @@ namecache_postgres_expire_blocks (struct Plugin *plugin) | |||
153 | GNUNET_PQ_query_param_absolute_time (&now), | 153 | GNUNET_PQ_query_param_absolute_time (&now), |
154 | GNUNET_PQ_query_param_end | 154 | GNUNET_PQ_query_param_end |
155 | }; | 155 | }; |
156 | enum GNUNET_PQ_QueryStatus res; | 156 | enum GNUNET_DB_QueryStatus res; |
157 | 157 | ||
158 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, | 158 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
159 | "expire_blocks", | 159 | "expire_blocks", |
160 | params); | 160 | params); |
161 | GNUNET_break (GNUNET_PQ_STATUS_HARD_ERROR != res); | 161 | GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != res); |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
@@ -179,12 +179,12 @@ delete_old_block (struct Plugin *plugin, | |||
179 | GNUNET_PQ_query_param_absolute_time_nbo (&expiration_time), | 179 | GNUNET_PQ_query_param_absolute_time_nbo (&expiration_time), |
180 | GNUNET_PQ_query_param_end | 180 | GNUNET_PQ_query_param_end |
181 | }; | 181 | }; |
182 | enum GNUNET_PQ_QueryStatus res; | 182 | enum GNUNET_DB_QueryStatus res; |
183 | 183 | ||
184 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, | 184 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
185 | "delete_block", | 185 | "delete_block", |
186 | params); | 186 | params); |
187 | GNUNET_break (GNUNET_PQ_STATUS_HARD_ERROR != res); | 187 | GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != res); |
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
@@ -210,7 +210,7 @@ namecache_postgres_cache_block (void *cls, | |||
210 | GNUNET_PQ_query_param_absolute_time_nbo (&block->expiration_time), | 210 | GNUNET_PQ_query_param_absolute_time_nbo (&block->expiration_time), |
211 | GNUNET_PQ_query_param_end | 211 | GNUNET_PQ_query_param_end |
212 | }; | 212 | }; |
213 | enum GNUNET_PQ_QueryStatus res; | 213 | enum GNUNET_DB_QueryStatus res; |
214 | 214 | ||
215 | namecache_postgres_expire_blocks (plugin); | 215 | namecache_postgres_expire_blocks (plugin); |
216 | GNUNET_CRYPTO_hash (&block->derived_key, | 216 | GNUNET_CRYPTO_hash (&block->derived_key, |
@@ -263,7 +263,7 @@ namecache_postgres_lookup_block (void *cls, | |||
263 | &bsize), | 263 | &bsize), |
264 | GNUNET_PQ_result_spec_end | 264 | GNUNET_PQ_result_spec_end |
265 | }; | 265 | }; |
266 | enum GNUNET_PQ_QueryStatus res; | 266 | enum GNUNET_DB_QueryStatus res; |
267 | 267 | ||
268 | res = GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, | 268 | res = GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, |
269 | "lookup_block", | 269 | "lookup_block", |
@@ -275,7 +275,7 @@ namecache_postgres_lookup_block (void *cls, | |||
275 | "Failing lookup block in namecache (postgres error)\n"); | 275 | "Failing lookup block in namecache (postgres error)\n"); |
276 | return GNUNET_SYSERR; | 276 | return GNUNET_SYSERR; |
277 | } | 277 | } |
278 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == res) | 278 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == res) |
279 | { | 279 | { |
280 | /* no result */ | 280 | /* no result */ |
281 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 281 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 5a607cac5..b1a6529aa 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c | |||
@@ -216,7 +216,7 @@ namestore_postgres_store_records (void *cls, | |||
216 | GNUNET_PQ_query_param_string (label), | 216 | GNUNET_PQ_query_param_string (label), |
217 | GNUNET_PQ_query_param_end | 217 | GNUNET_PQ_query_param_end |
218 | }; | 218 | }; |
219 | enum GNUNET_PQ_QueryStatus res; | 219 | enum GNUNET_DB_QueryStatus res; |
220 | 220 | ||
221 | if (data_size != | 221 | if (data_size != |
222 | GNUNET_GNSRECORD_records_serialize (rd_count, rd, | 222 | GNUNET_GNSRECORD_records_serialize (rd_count, rd, |
@@ -229,7 +229,7 @@ namestore_postgres_store_records (void *cls, | |||
229 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, | 229 | res = GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
230 | "store_records", | 230 | "store_records", |
231 | params); | 231 | params); |
232 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != res) | 232 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != res) |
233 | return GNUNET_SYSERR; | 233 | return GNUNET_SYSERR; |
234 | } | 234 | } |
235 | return GNUNET_OK; | 235 | return GNUNET_OK; |
@@ -362,7 +362,7 @@ namestore_postgres_lookup_records (void *cls, | |||
362 | GNUNET_PQ_query_param_end | 362 | GNUNET_PQ_query_param_end |
363 | }; | 363 | }; |
364 | struct ParserContext pc; | 364 | struct ParserContext pc; |
365 | enum GNUNET_PQ_QueryStatus res; | 365 | enum GNUNET_DB_QueryStatus res; |
366 | 366 | ||
367 | pc.iter = iter; | 367 | pc.iter = iter; |
368 | pc.iter_cls = iter_cls; | 368 | pc.iter_cls = iter_cls; |
@@ -397,7 +397,7 @@ namestore_postgres_iterate_records (void *cls, | |||
397 | void *iter_cls) | 397 | void *iter_cls) |
398 | { | 398 | { |
399 | struct Plugin *plugin = cls; | 399 | struct Plugin *plugin = cls; |
400 | enum GNUNET_PQ_QueryStatus res; | 400 | enum GNUNET_DB_QueryStatus res; |
401 | struct ParserContext pc; | 401 | struct ParserContext pc; |
402 | 402 | ||
403 | pc.iter = iter; | 403 | pc.iter = iter; |
@@ -459,7 +459,7 @@ namestore_postgres_zone_to_name (void *cls, | |||
459 | GNUNET_PQ_query_param_auto_from_type (value_zone), | 459 | GNUNET_PQ_query_param_auto_from_type (value_zone), |
460 | GNUNET_PQ_query_param_end | 460 | GNUNET_PQ_query_param_end |
461 | }; | 461 | }; |
462 | enum GNUNET_PQ_QueryStatus res; | 462 | enum GNUNET_DB_QueryStatus res; |
463 | struct ParserContext pc; | 463 | struct ParserContext pc; |
464 | 464 | ||
465 | pc.iter = iter; | 465 | pc.iter = iter; |
diff --git a/src/pq/pq_eval.c b/src/pq/pq_eval.c index b19742bba..0f28aec7e 100644 --- a/src/pq/pq_eval.c +++ b/src/pq/pq_eval.c | |||
@@ -47,12 +47,12 @@ | |||
47 | * @param statement_name name of the statement that created @a result | 47 | * @param statement_name name of the statement that created @a result |
48 | * @param result result to check | 48 | * @param result result to check |
49 | * @return status code from the result, mapping PQ status | 49 | * @return status code from the result, mapping PQ status |
50 | * codes to `enum GNUNET_PQ_QueryStatus`. Never | 50 | * codes to `enum GNUNET_DB_QueryStatus`. Never |
51 | * returns positive values as this function does | 51 | * returns positive values as this function does |
52 | * not look at the result set. | 52 | * not look at the result set. |
53 | * @deprecated (low level, let's see if we can do with just the high-level functions) | 53 | * @deprecated (low level, let's see if we can do with just the high-level functions) |
54 | */ | 54 | */ |
55 | enum GNUNET_PQ_QueryStatus | 55 | enum GNUNET_DB_QueryStatus |
56 | GNUNET_PQ_eval_result (PGconn *connection, | 56 | GNUNET_PQ_eval_result (PGconn *connection, |
57 | const char *statement_name, | 57 | const char *statement_name, |
58 | PGresult *result) | 58 | PGresult *result) |
@@ -71,7 +71,7 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
71 | { | 71 | { |
72 | /* very unexpected... */ | 72 | /* very unexpected... */ |
73 | GNUNET_break (0); | 73 | GNUNET_break (0); |
74 | return GNUNET_PQ_STATUS_HARD_ERROR; | 74 | return GNUNET_DB_STATUS_HARD_ERROR; |
75 | } | 75 | } |
76 | if ( (0 == strcmp (sqlstate, | 76 | if ( (0 == strcmp (sqlstate, |
77 | PQ_DIAG_SQLSTATE_DEADLOCK)) || | 77 | PQ_DIAG_SQLSTATE_DEADLOCK)) || |
@@ -91,7 +91,7 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
91 | PQresultErrorMessage (result), | 91 | PQresultErrorMessage (result), |
92 | PQresStatus (PQresultStatus (result)), | 92 | PQresStatus (PQresultStatus (result)), |
93 | PQerrorMessage (connection)); | 93 | PQerrorMessage (connection)); |
94 | return GNUNET_PQ_STATUS_SOFT_ERROR; | 94 | return GNUNET_DB_STATUS_SOFT_ERROR; |
95 | } | 95 | } |
96 | if (0 == strcmp (sqlstate, | 96 | if (0 == strcmp (sqlstate, |
97 | PQ_DIAG_SQLSTATE_UNIQUE_VIOLATION)) | 97 | PQ_DIAG_SQLSTATE_UNIQUE_VIOLATION)) |
@@ -108,7 +108,7 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
108 | PQresultErrorMessage (result), | 108 | PQresultErrorMessage (result), |
109 | PQresStatus (PQresultStatus (result)), | 109 | PQresStatus (PQresultStatus (result)), |
110 | PQerrorMessage (connection)); | 110 | PQerrorMessage (connection)); |
111 | return GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS; | 111 | return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; |
112 | } | 112 | } |
113 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | 113 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, |
114 | "pq", | 114 | "pq", |
@@ -121,9 +121,9 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
121 | PQresultErrorMessage (result), | 121 | PQresultErrorMessage (result), |
122 | PQresStatus (PQresultStatus (result)), | 122 | PQresStatus (PQresultStatus (result)), |
123 | PQerrorMessage (connection)); | 123 | PQerrorMessage (connection)); |
124 | return GNUNET_PQ_STATUS_HARD_ERROR; | 124 | return GNUNET_DB_STATUS_HARD_ERROR; |
125 | } | 125 | } |
126 | return GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS; | 126 | return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; |
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
@@ -136,20 +136,20 @@ GNUNET_PQ_eval_result (PGconn *connection, | |||
136 | * @param statement_name name of the statement | 136 | * @param statement_name name of the statement |
137 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) | 137 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) |
138 | * @return status code from the result, mapping PQ status | 138 | * @return status code from the result, mapping PQ status |
139 | * codes to `enum GNUNET_PQ_QueryStatus`. If the | 139 | * codes to `enum GNUNET_DB_QueryStatus`. If the |
140 | * statement was a DELETE or UPDATE statement, the | 140 | * statement was a DELETE or UPDATE statement, the |
141 | * number of affected rows is returned.; if the | 141 | * number of affected rows is returned.; if the |
142 | * statment was an INSERT statement, and no row | 142 | * statment was an INSERT statement, and no row |
143 | * was added due to a UNIQUE violation, we return | 143 | * was added due to a UNIQUE violation, we return |
144 | * zero; if INSERT was successful, we return one. | 144 | * zero; if INSERT was successful, we return one. |
145 | */ | 145 | */ |
146 | enum GNUNET_PQ_QueryStatus | 146 | enum GNUNET_DB_QueryStatus |
147 | GNUNET_PQ_eval_prepared_non_select (PGconn *connection, | 147 | GNUNET_PQ_eval_prepared_non_select (PGconn *connection, |
148 | const char *statement_name, | 148 | const char *statement_name, |
149 | const struct GNUNET_PQ_QueryParam *params) | 149 | const struct GNUNET_PQ_QueryParam *params) |
150 | { | 150 | { |
151 | PGresult *result; | 151 | PGresult *result; |
152 | enum GNUNET_PQ_QueryStatus qs; | 152 | enum GNUNET_DB_QueryStatus qs; |
153 | 153 | ||
154 | result = GNUNET_PQ_exec_prepared (connection, | 154 | result = GNUNET_PQ_exec_prepared (connection, |
155 | statement_name, | 155 | statement_name, |
@@ -157,7 +157,7 @@ GNUNET_PQ_eval_prepared_non_select (PGconn *connection, | |||
157 | qs = GNUNET_PQ_eval_result (connection, | 157 | qs = GNUNET_PQ_eval_result (connection, |
158 | statement_name, | 158 | statement_name, |
159 | result); | 159 | result); |
160 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS == qs) | 160 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) |
161 | { | 161 | { |
162 | const char *tuples; | 162 | const char *tuples; |
163 | 163 | ||
@@ -184,9 +184,9 @@ GNUNET_PQ_eval_prepared_non_select (PGconn *connection, | |||
184 | * @param rh function to call with the result set, NULL to ignore | 184 | * @param rh function to call with the result set, NULL to ignore |
185 | * @param rh_cls closure to pass to @a rh | 185 | * @param rh_cls closure to pass to @a rh |
186 | * @return status code from the result, mapping PQ status | 186 | * @return status code from the result, mapping PQ status |
187 | * codes to `enum GNUNET_PQ_QueryStatus`. | 187 | * codes to `enum GNUNET_DB_QueryStatus`. |
188 | */ | 188 | */ |
189 | enum GNUNET_PQ_QueryStatus | 189 | enum GNUNET_DB_QueryStatus |
190 | GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | 190 | GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, |
191 | const char *statement_name, | 191 | const char *statement_name, |
192 | const struct GNUNET_PQ_QueryParam *params, | 192 | const struct GNUNET_PQ_QueryParam *params, |
@@ -194,7 +194,7 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
194 | void *rh_cls) | 194 | void *rh_cls) |
195 | { | 195 | { |
196 | PGresult *result; | 196 | PGresult *result; |
197 | enum GNUNET_PQ_QueryStatus qs; | 197 | enum GNUNET_DB_QueryStatus qs; |
198 | unsigned int ret; | 198 | unsigned int ret; |
199 | 199 | ||
200 | result = GNUNET_PQ_exec_prepared (connection, | 200 | result = GNUNET_PQ_exec_prepared (connection, |
@@ -223,7 +223,7 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
223 | * which must return a single result in @a connection using the given | 223 | * which must return a single result in @a connection using the given |
224 | * @a params. Stores the result (if any) in @a rs, which the caller | 224 | * @a params. Stores the result (if any) in @a rs, which the caller |
225 | * must then clean up using #GNUNET_PQ_cleanup_result() if the return | 225 | * must then clean up using #GNUNET_PQ_cleanup_result() if the return |
226 | * value was #GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT. Returns the | 226 | * value was #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT. Returns the |
227 | * resulting session status. | 227 | * resulting session status. |
228 | * | 228 | * |
229 | * @param connection connection to execute the statement in | 229 | * @param connection connection to execute the statement in |
@@ -231,16 +231,16 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, | |||
231 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) | 231 | * @param params parameters to give to the statement (#GNUNET_PQ_query_param_end-terminated) |
232 | * @param[in,out] rs result specification to use for storing the result of the query | 232 | * @param[in,out] rs result specification to use for storing the result of the query |
233 | * @return status code from the result, mapping PQ status | 233 | * @return status code from the result, mapping PQ status |
234 | * codes to `enum GNUNET_PQ_QueryStatus`. | 234 | * codes to `enum GNUNET_DB_QueryStatus`. |
235 | */ | 235 | */ |
236 | enum GNUNET_PQ_QueryStatus | 236 | enum GNUNET_DB_QueryStatus |
237 | GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, | 237 | GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, |
238 | const char *statement_name, | 238 | const char *statement_name, |
239 | const struct GNUNET_PQ_QueryParam *params, | 239 | const struct GNUNET_PQ_QueryParam *params, |
240 | struct GNUNET_PQ_ResultSpec *rs) | 240 | struct GNUNET_PQ_ResultSpec *rs) |
241 | { | 241 | { |
242 | PGresult *result; | 242 | PGresult *result; |
243 | enum GNUNET_PQ_QueryStatus qs; | 243 | enum GNUNET_DB_QueryStatus qs; |
244 | 244 | ||
245 | result = GNUNET_PQ_exec_prepared (connection, | 245 | result = GNUNET_PQ_exec_prepared (connection, |
246 | statement_name, | 246 | statement_name, |
@@ -256,14 +256,14 @@ GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, | |||
256 | if (0 == PQntuples (result)) | 256 | if (0 == PQntuples (result)) |
257 | { | 257 | { |
258 | PQclear (result); | 258 | PQclear (result); |
259 | return GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS; | 259 | return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; |
260 | } | 260 | } |
261 | if (1 != PQntuples (result)) | 261 | if (1 != PQntuples (result)) |
262 | { | 262 | { |
263 | /* more than one result, but there must be at most one */ | 263 | /* more than one result, but there must be at most one */ |
264 | GNUNET_break (0); | 264 | GNUNET_break (0); |
265 | PQclear (result); | 265 | PQclear (result); |
266 | return GNUNET_PQ_STATUS_HARD_ERROR; | 266 | return GNUNET_DB_STATUS_HARD_ERROR; |
267 | } | 267 | } |
268 | if (GNUNET_OK != | 268 | if (GNUNET_OK != |
269 | GNUNET_PQ_extract_result (result, | 269 | GNUNET_PQ_extract_result (result, |
@@ -271,10 +271,10 @@ GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, | |||
271 | 0)) | 271 | 0)) |
272 | { | 272 | { |
273 | PQclear (result); | 273 | PQclear (result); |
274 | return GNUNET_PQ_STATUS_HARD_ERROR; | 274 | return GNUNET_DB_STATUS_HARD_ERROR; |
275 | } | 275 | } |
276 | PQclear (result); | 276 | PQclear (result); |
277 | return GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT; | 277 | return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c index de4b6e43f..b8010af0a 100644 --- a/src/psycstore/plugin_psycstore_postgres.c +++ b/src/psycstore/plugin_psycstore_postgres.c | |||
@@ -391,7 +391,7 @@ exec_channel (struct Plugin *plugin, const char *stmt, | |||
391 | GNUNET_PQ_query_param_end | 391 | GNUNET_PQ_query_param_end |
392 | }; | 392 | }; |
393 | 393 | ||
394 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 394 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
395 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) | 395 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) |
396 | return GNUNET_SYSERR; | 396 | return GNUNET_SYSERR; |
397 | 397 | ||
@@ -409,7 +409,7 @@ transaction_begin (struct Plugin *plugin, enum Transactions transaction) | |||
409 | GNUNET_PQ_query_param_end | 409 | GNUNET_PQ_query_param_end |
410 | }; | 410 | }; |
411 | 411 | ||
412 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 412 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
413 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_begin", params)) | 413 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_begin", params)) |
414 | return GNUNET_SYSERR; | 414 | return GNUNET_SYSERR; |
415 | 415 | ||
@@ -428,7 +428,7 @@ transaction_commit (struct Plugin *plugin) | |||
428 | GNUNET_PQ_query_param_end | 428 | GNUNET_PQ_query_param_end |
429 | }; | 429 | }; |
430 | 430 | ||
431 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 431 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
432 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_commit", params)) | 432 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_commit", params)) |
433 | return GNUNET_SYSERR; | 433 | return GNUNET_SYSERR; |
434 | 434 | ||
@@ -447,7 +447,7 @@ transaction_rollback (struct Plugin *plugin) | |||
447 | GNUNET_PQ_query_param_end | 447 | GNUNET_PQ_query_param_end |
448 | }; | 448 | }; |
449 | 449 | ||
450 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 450 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
451 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_rollback", params)) | 451 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "transaction_rollback", params)) |
452 | return GNUNET_SYSERR; | 452 | return GNUNET_SYSERR; |
453 | 453 | ||
@@ -465,7 +465,7 @@ channel_key_store (struct Plugin *plugin, | |||
465 | GNUNET_PQ_query_param_end | 465 | GNUNET_PQ_query_param_end |
466 | }; | 466 | }; |
467 | 467 | ||
468 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 468 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
469 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_channel_key", params)) | 469 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_channel_key", params)) |
470 | return GNUNET_SYSERR; | 470 | return GNUNET_SYSERR; |
471 | 471 | ||
@@ -482,7 +482,7 @@ slave_key_store (struct Plugin *plugin, | |||
482 | GNUNET_PQ_query_param_end | 482 | GNUNET_PQ_query_param_end |
483 | }; | 483 | }; |
484 | 484 | ||
485 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 485 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
486 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_slave_key", params)) | 486 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_slave_key", params)) |
487 | return GNUNET_SYSERR; | 487 | return GNUNET_SYSERR; |
488 | 488 | ||
@@ -535,7 +535,7 @@ postgres_membership_store (void *cls, | |||
535 | GNUNET_PQ_query_param_end | 535 | GNUNET_PQ_query_param_end |
536 | }; | 536 | }; |
537 | 537 | ||
538 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 538 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
539 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_membership", params)) | 539 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_membership", params)) |
540 | return GNUNET_SYSERR; | 540 | return GNUNET_SYSERR; |
541 | 541 | ||
@@ -572,7 +572,7 @@ membership_test (void *cls, | |||
572 | GNUNET_PQ_result_spec_end | 572 | GNUNET_PQ_result_spec_end |
573 | }; | 573 | }; |
574 | 574 | ||
575 | if (GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT != | 575 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
576 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, "select_membership", | 576 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, "select_membership", |
577 | params_select, results_select)) | 577 | params_select, results_select)) |
578 | return GNUNET_SYSERR; | 578 | return GNUNET_SYSERR; |
@@ -635,7 +635,7 @@ fragment_store (void *cls, | |||
635 | GNUNET_PQ_query_param_end | 635 | GNUNET_PQ_query_param_end |
636 | }; | 636 | }; |
637 | 637 | ||
638 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 638 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
639 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_fragment", params_insert)) | 639 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_fragment", params_insert)) |
640 | return GNUNET_SYSERR; | 640 | return GNUNET_SYSERR; |
641 | 641 | ||
@@ -664,7 +664,7 @@ message_add_flags (void *cls, | |||
664 | GNUNET_PQ_query_param_end | 664 | GNUNET_PQ_query_param_end |
665 | }; | 665 | }; |
666 | 666 | ||
667 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 667 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
668 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "update_message_flags", params_update)) | 668 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "update_message_flags", params_update)) |
669 | return GNUNET_SYSERR; | 669 | return GNUNET_SYSERR; |
670 | 670 | ||
@@ -994,7 +994,7 @@ counters_message_get (void *cls, | |||
994 | GNUNET_PQ_result_spec_end | 994 | GNUNET_PQ_result_spec_end |
995 | }; | 995 | }; |
996 | 996 | ||
997 | if (GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT != | 997 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
998 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, | 998 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, |
999 | params_select, results_select)) | 999 | params_select, results_select)) |
1000 | return GNUNET_SYSERR; | 1000 | return GNUNET_SYSERR; |
@@ -1028,7 +1028,7 @@ counters_state_get (void *cls, | |||
1028 | GNUNET_PQ_result_spec_end | 1028 | GNUNET_PQ_result_spec_end |
1029 | }; | 1029 | }; |
1030 | 1030 | ||
1031 | if (GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT != | 1031 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
1032 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, | 1032 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, |
1033 | params_select, results_select)) | 1033 | params_select, results_select)) |
1034 | return GNUNET_SYSERR; | 1034 | return GNUNET_SYSERR; |
@@ -1054,7 +1054,7 @@ state_assign (struct Plugin *plugin, const char *stmt, | |||
1054 | GNUNET_PQ_query_param_end | 1054 | GNUNET_PQ_query_param_end |
1055 | }; | 1055 | }; |
1056 | 1056 | ||
1057 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 1057 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
1058 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) | 1058 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) |
1059 | return GNUNET_SYSERR; | 1059 | return GNUNET_SYSERR; |
1060 | 1060 | ||
@@ -1074,7 +1074,7 @@ update_message_id (struct Plugin *plugin, | |||
1074 | GNUNET_PQ_query_param_end | 1074 | GNUNET_PQ_query_param_end |
1075 | }; | 1075 | }; |
1076 | 1076 | ||
1077 | if (GNUNET_PQ_STATUS_SUCCESS_NO_RESULTS != | 1077 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != |
1078 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) | 1078 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, stmt, params)) |
1079 | return GNUNET_SYSERR; | 1079 | return GNUNET_SYSERR; |
1080 | 1080 | ||
@@ -1305,7 +1305,7 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | |||
1305 | GNUNET_PQ_result_spec_end | 1305 | GNUNET_PQ_result_spec_end |
1306 | }; | 1306 | }; |
1307 | 1307 | ||
1308 | if (GNUNET_PQ_STATUS_SUCCESS_ONE_RESULT != | 1308 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
1309 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, | 1309 | GNUNET_PQ_eval_prepared_singleton_select (plugin->dbh, stmt, |
1310 | params_select, results_select)) | 1310 | params_select, results_select)) |
1311 | return GNUNET_SYSERR; | 1311 | return GNUNET_SYSERR; |