diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-02-23 10:48:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-02-23 10:48:08 +0100 |
commit | f1e8076ed474a429aff32839ed5f8fc20371839c (patch) | |
tree | bb38cb99b0e9cb7b937d33b539e74b9eb9fe4d32 /src/datastore | |
parent | 3d0f1dd3805bfef30ff7a7f8e246a926b7fa7838 (diff) | |
parent | 7b01b7b1760cc973719c9a20123f99e4a7e1b5a6 (diff) | |
download | gnunet-f1e8076ed474a429aff32839ed5f8fc20371839c.tar.gz gnunet-f1e8076ed474a429aff32839ed5f8fc20371839c.zip |
merge
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/perf_datastore_api.c | 4 | ||||
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 6 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 8 | ||||
-rw-r--r-- | src/datastore/test_datastore_api.c | 10 | ||||
-rw-r--r-- | src/datastore/test_datastore_api_management.c | 6 | ||||
-rw-r--r-- | src/datastore/test_plugin_datastore.c | 6 |
6 files changed, 22 insertions, 18 deletions
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index 939e60e4d..2c261b155 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -595,7 +595,7 @@ int | |||
595 | main (int argc, | 595 | main (int argc, |
596 | char *argv[]) | 596 | char *argv[]) |
597 | { | 597 | { |
598 | char cfg_name[128]; | 598 | char cfg_name[PATH_MAX]; |
599 | 599 | ||
600 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); | 600 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); |
601 | GNUNET_snprintf (cfg_name, | 601 | GNUNET_snprintf (cfg_name, |
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 9ba8fa1b0..f68d1f389 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -519,8 +519,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
519 | int | 519 | int |
520 | main (int argc, char *argv[]) | 520 | main (int argc, char *argv[]) |
521 | { | 521 | { |
522 | char dir_name[128]; | 522 | char dir_name[PATH_MAX]; |
523 | char cfg_name[128]; | 523 | char cfg_name[PATH_MAX]; |
524 | char *const xargv[] = { | 524 | char *const xargv[] = { |
525 | "perf-plugin-datastore", | 525 | "perf-plugin-datastore", |
526 | "-c", | 526 | "-c", |
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index 94db6e116..0a3018411 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -153,7 +153,11 @@ init_connection (struct Plugin *plugin) | |||
153 | "SELECT hash FROM gn090", | 153 | "SELECT hash FROM gn090", |
154 | 0), | 154 | 0), |
155 | GNUNET_PQ_make_prepare ("estimate_size", | 155 | GNUNET_PQ_make_prepare ("estimate_size", |
156 | "SELECT SUM(LENGTH(value))+256*COUNT(*) AS total FROM gn090", | 156 | "SELECT CASE WHEN NOT EXISTS" |
157 | " (SELECT 1 FROM gn090)" | ||
158 | " THEN 0" | ||
159 | " ELSE (SELECT SUM(LENGTH(value))+256*COUNT(*) FROM gn090)" | ||
160 | "END AS total", | ||
157 | 0), | 161 | 0), |
158 | GNUNET_PQ_PREPARED_STATEMENT_END | 162 | GNUNET_PQ_PREPARED_STATEMENT_END |
159 | }; | 163 | }; |
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index fa96ea9b7..daf6cccb3 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -635,7 +635,7 @@ duc_dummy (void *cls, | |||
635 | 635 | ||
636 | 636 | ||
637 | /** | 637 | /** |
638 | * check if plugin is actually working | 638 | * check if plugin is actually working |
639 | */ | 639 | */ |
640 | static int | 640 | static int |
641 | test_plugin (const char *cfg_name) | 641 | test_plugin (const char *cfg_name) |
@@ -644,7 +644,7 @@ test_plugin (const char *cfg_name) | |||
644 | struct GNUNET_CONFIGURATION_Handle *cfg; | 644 | struct GNUNET_CONFIGURATION_Handle *cfg; |
645 | struct GNUNET_DATASTORE_PluginFunctions *api; | 645 | struct GNUNET_DATASTORE_PluginFunctions *api; |
646 | struct GNUNET_DATASTORE_PluginEnvironment env; | 646 | struct GNUNET_DATASTORE_PluginEnvironment env; |
647 | 647 | ||
648 | cfg = GNUNET_CONFIGURATION_create (); | 648 | cfg = GNUNET_CONFIGURATION_create (); |
649 | if (GNUNET_OK != | 649 | if (GNUNET_OK != |
650 | GNUNET_CONFIGURATION_load (cfg, | 650 | GNUNET_CONFIGURATION_load (cfg, |
@@ -691,9 +691,9 @@ int | |||
691 | main (int argc, | 691 | main (int argc, |
692 | char *argv[]) | 692 | char *argv[]) |
693 | { | 693 | { |
694 | char cfg_name[128]; | 694 | char cfg_name[PATH_MAX]; |
695 | int ret; | 695 | int ret; |
696 | 696 | ||
697 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); | 697 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); |
698 | GNUNET_snprintf (cfg_name, | 698 | GNUNET_snprintf (cfg_name, |
699 | sizeof (cfg_name), | 699 | sizeof (cfg_name), |
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index d592ccc80..d91fe748b 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -337,7 +337,7 @@ ignore_payload_cb (void *cls, | |||
337 | static int | 337 | static int |
338 | test_plugin (const char *cfg_name) | 338 | test_plugin (const char *cfg_name) |
339 | { | 339 | { |
340 | char libname[128]; | 340 | char libname[PATH_MAX]; |
341 | struct GNUNET_CONFIGURATION_Handle *cfg; | 341 | struct GNUNET_CONFIGURATION_Handle *cfg; |
342 | struct GNUNET_DATASTORE_PluginFunctions *api; | 342 | struct GNUNET_DATASTORE_PluginFunctions *api; |
343 | struct GNUNET_DATASTORE_PluginEnvironment env; | 343 | struct GNUNET_DATASTORE_PluginEnvironment env; |
@@ -378,7 +378,7 @@ test_plugin (const char *cfg_name) | |||
378 | int | 378 | int |
379 | main (int argc, char *argv[]) | 379 | main (int argc, char *argv[]) |
380 | { | 380 | { |
381 | char cfg_name[128]; | 381 | char cfg_name[PATH_MAX]; |
382 | int ret; | 382 | int ret; |
383 | 383 | ||
384 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); | 384 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); |
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index 4b054314c..c37b8ddb9 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -436,8 +436,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
436 | int | 436 | int |
437 | main (int argc, char *argv[]) | 437 | main (int argc, char *argv[]) |
438 | { | 438 | { |
439 | char dir_name[128]; | 439 | char dir_name[PATH_MAX]; |
440 | char cfg_name[128]; | 440 | char cfg_name[PATH_MAX]; |
441 | char *const xargv[] = { | 441 | char *const xargv[] = { |
442 | "test-plugin-datastore", | 442 | "test-plugin-datastore", |
443 | "-c", | 443 | "-c", |