gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37453 - gnunet/src/my


From: gnunet
Subject: [GNUnet-SVN] r37453 - gnunet/src/my
Date: Sun, 3 Jul 2016 17:01:34 +0200

Author: grothoff
Date: 2016-07-03 17:01:34 +0200 (Sun, 03 Jul 2016)
New Revision: 37453

Modified:
   gnunet/src/my/test_my.c
Log:
report skip if DB does not allow table creation

Modified: gnunet/src/my/test_my.c
===================================================================
--- gnunet/src/my/test_my.c     2016-07-03 13:18:48 UTC (rev 37452)
+++ gnunet/src/my/test_my.c     2016-07-03 15:01:34 UTC (rev 37453)
@@ -225,7 +225,7 @@
 
 
 int
-main (int argc, const char * const argv[])
+main (int argc, const char *const argv[])
 {
   struct GNUNET_CONFIGURATION_Handle *config;
   struct GNUNET_MYSQL_Context *context;
@@ -236,7 +236,8 @@
                     NULL);
 
   config = GNUNET_CONFIGURATION_create ();
-  if (GNUNET_OK != GNUNET_CONFIGURATION_parse (config, "test_my.conf"))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_parse (config, "test_my.conf"))
   {
     fprintf (stderr, "Failed to parse configuaration\n");
     return 1;
@@ -243,7 +244,7 @@
   }
 
   context = GNUNET_MYSQL_context_create (config,
-                                        "datastore-mysql");
+                                         "datastore-mysql");
   if (NULL == context)
   {
     fprintf(stderr, "Failed to connect to database\n");
@@ -251,29 +252,30 @@
   }
 
   (void) GNUNET_MYSQL_statement_run (context,
-                                    "DROP TABLE test_my2;");
+                                     "DROP TABLE test_my2;");
 
-  if (GNUNET_OK != GNUNET_MYSQL_statement_run (context,
-                                              "CREATE TABLE IF NOT EXISTS 
test_my2("
-                                              " pub BLOB NOT NULL"
-                                              ",sig BLOB NOT NULL"
-                                              ",abs_time BIGINT NOT NULL"
-                                              ",forever BIGINT NOT NULL"
-                                              ",abs_time_nbo BIGINT NOT NULL"
-                                              ",hash BLOB NOT NULL 
CHECK(LENGTH(hash)=64)"
-                                              ",vsize BLOB NOT NULL"
-                                              ",str BLOB NOT NULL"
-                                              ",u16 SMALLINT NOT NULL"
-                                              ",u32 INT NOT NULL"
-                                              ",u64 BIGINT NOT NULL"
-                                              ")"))
+  if (GNUNET_OK !=
+      GNUNET_MYSQL_statement_run (context,
+                                  "CREATE TABLE IF NOT EXISTS test_my2("
+                                  " pub BLOB NOT NULL"
+                                  ",sig BLOB NOT NULL"
+                                  ",abs_time BIGINT NOT NULL"
+                                  ",forever BIGINT NOT NULL"
+                                  ",abs_time_nbo BIGINT NOT NULL"
+                                  ",hash BLOB NOT NULL CHECK(LENGTH(hash)=64)"
+                                  ",vsize BLOB NOT NULL"
+                                  ",str BLOB NOT NULL"
+                                  ",u16 SMALLINT NOT NULL"
+                                  ",u32 INT NOT NULL"
+                                  ",u64 BIGINT NOT NULL"
+                                  ")"))
   {
     fprintf (stderr,
-            "Failed to create table \n");
+            "Failed to create table. Database likely not setup correctly.\n");
     GNUNET_MYSQL_statements_invalidate (context);
     GNUNET_MYSQL_context_destroy (context);
 
-    return 1;
+    return 77;
   }
 
   ret = run_queries (context);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]