gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: Fixed some errors


From: gnunet
Subject: [taler-anastasis] branch master updated: Fixed some errors
Date: Tue, 05 Nov 2019 13:51:39 +0100

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 94f73f4  Fixed some errors
94f73f4 is described below

commit 94f73f4927df8924c4fbe680a2c420210206a5c3
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue Nov 5 12:51:30 2019 +0000

    Fixed some errors
---
 src/backup-db/plugin_anastasis_postgres.c |  26 +++++++++++++-------------
 src/backup-db/test_anastasis_db.c         |   2 +-
 src/backup/anastasis-httpd                | Bin 0 -> 129296 bytes
 src/include/anastasis_database_plugin.h   |   1 +
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/backup-db/plugin_anastasis_postgres.c 
b/src/backup-db/plugin_anastasis_postgres.c
index f245244..21e3a0e 100644
--- a/src/backup-db/plugin_anastasis_postgres.c
+++ b/src/backup-db/plugin_anastasis_postgres.c
@@ -835,25 +835,25 @@ libanastasis_plugin_db_postgres_init (void *cls)
     /* Orders created by the frontend, not signed or given a nonce yet.
        The contract terms will change (nonce will be added) when moved to the
        contract terms table */
-    GNUNET_PQ_make_execute ("CREATE TABLE anastasis_truth"
+    GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS anastasis_truth"
                             "( truth_id UUID PRIMARY KEY NOT NULL,"
                             "truth BYTEA NOT NULL,"
-                            "truth_mime VARCHAR,"
+                            "mime_type VARCHAR,"
                             "key_share BYTEA NOT NULL,"
                             "expiration TIMESTAMP NOT NULL"
                             ");"),
-    GNUNET_PQ_make_execute ("CREATE TABLE anastasis_user"
+    GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS anastasis_user"
                             "( user_id BYTEA PRIMARY KEY 
CHECK(LENGTH(user_id)=32),"
                             "  paid_until TIMESTAMP NOT NULL"
                             ");"),
-    GNUNET_PQ_make_execute ("CREATE TABLE anastasis_payments"
+    GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS anastasis_payment"
                             "( payment_id BIGSERIAL PRIMARY KEY,"
                             "  user_id BYTEA NOT NULL REFERENCES 
anastasis_user(user_id),"
                             "  post_counter INTEGER,"
                             "  payment_identifier BYTEA NOT NULL 
CHECK(LENGTH(payment_identifier)=32),"
                             "  transaction_time TIMESTAMP NOT NULL DEFAULT 
NOW()"
                             ");"),
-    GNUNET_PQ_make_execute ("CREATE TABLE anastasis_recoverydocument"
+    GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS 
anastasis_recoverydocument"
                             "( user_id BYTEA NOT NULL REFERENCES 
anastasis_user(user_id),"
                             "  version INTEGER NOT NULL,"
                             "  recovery_data BYTEA NOT NULL,"
@@ -886,7 +886,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             " WHERE user_id=$2;",
                             2),
     GNUNET_PQ_make_prepare ("payment_insert",
-                            "INSERT INTO anastasis_recoverydocument "
+                            "INSERT INTO anastasis_payment "
                             "(user_id"
                             ",post_counter"
                             ",payment_identifier"
@@ -914,9 +914,9 @@ libanastasis_plugin_db_postgres_init (void *cls)
     GNUNET_PQ_make_prepare ("truth_select",
                             "SELECT "
                             "truth,"
-                            "truth_mime"
-                            "FROM anastasis_truth "
-                            "WHERE truth_id =$1;",
+                            "mime_type"
+                            " FROM anastasis_truth"
+                            " WHERE truth_id =$1;",
                             1),
     GNUNET_PQ_make_prepare ("latest_recoverydocument_select",
                             "SELECT "
@@ -944,13 +944,13 @@ libanastasis_plugin_db_postgres_init (void *cls)
     GNUNET_PQ_make_prepare ("postcounter_select",
                             "SELECT "
                             "post_counter "
-                            "FROM anastasis_payments "
+                            "FROM anastasis_payment "
                             "WHERE user_id =$1 "
                             "AND payment_identifier=$2;",
                             2),
     GNUNET_PQ_make_prepare ("postcounter_update",
                             "UPDATE "
-                            "anastasis_payments "
+                            "anastasis_payment "
                             "SET "
                             "post_counter=$1 "
                             "WHERE user_id =$2 "
@@ -969,7 +969,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
   pg = GNUNET_new (struct PostgresClosure);
   pg->cfg = cfg;
   pg->conn = GNUNET_PQ_connect_with_cfg (cfg,
-                                         "anastasis-db",
+                                         "anastasisdb-postgres",
                                          es,
                                          ps);
   if (NULL == pg->conn)
@@ -1004,7 +1004,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
  * @return NULL (always)
  */
 void *
-plugin_anastasis_db_postgres_done (void *cls)
+libanastasis_plugin_db_postgres_done (void *cls)
 {
   struct ANASTASIS_DatabasePlugin *plugin = cls;
   struct PostgresClosure *pg = plugin->cls;
diff --git a/src/backup-db/test_anastasis_db.c 
b/src/backup-db/test_anastasis_db.c
index 6e15215..ce6998f 100644
--- a/src/backup-db/test_anastasis_db.c
+++ b/src/backup-db/test_anastasis_db.c
@@ -255,7 +255,7 @@ main (int argc,
   GNUNET_log_setup (argv[0], "DEBUG", NULL);
   plugin_name++;
   (void) GNUNET_asprintf (&testname,
-                          "test_anastasis_db_%s",
+                          "%s",
                           plugin_name);
   (void) GNUNET_asprintf (&config_filename,
                           "%s.conf",
diff --git a/src/backup/anastasis-httpd b/src/backup/anastasis-httpd
new file mode 100755
index 0000000..14924b5
Binary files /dev/null and b/src/backup/anastasis-httpd differ
diff --git a/src/include/anastasis_database_plugin.h 
b/src/include/anastasis_database_plugin.h
index 9ddb921..843d324 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -259,6 +259,7 @@ struct ANASTASIS_DatabasePlugin
                           void **truth,
                           size_t *truth_size,
                           char **truth_mime);
+                          
   /**
   * @param cls closure
   * @param uuid the identifier for the Truth

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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