[libgda] postgres: fixes for types schemas



commit 155d0c3d423ae67c9cc827181d7dfe435fffcba9
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date:   Mon Dec 24 21:31:15 2018 -0600

    postgres: fixes for types schemas

 tests/providers/TYPES_SCHEMA_PostgreSQL.xml | 68 +++++++++++++++++++++++++++--
 tests/providers/prov-test-common.c          |  1 +
 tests/providers/prov-test-util.c            |  7 ++-
 tests/test-cnc-utils.c                      | 11 +++--
 4 files changed, 79 insertions(+), 8 deletions(-)
---
diff --git a/tests/providers/TYPES_SCHEMA_PostgreSQL.xml b/tests/providers/TYPES_SCHEMA_PostgreSQL.xml
index ce806a970..d07d45f25 100644
--- a/tests/providers/TYPES_SCHEMA_PostgreSQL.xml
+++ b/tests/providers/TYPES_SCHEMA_PostgreSQL.xml
@@ -107,6 +107,12 @@
       <gda_value isnull="t"/>
       <gda_value isnull="t"/>
     </gda_array_row>
+    <gda_array_row>
+      <gda_value>information_schema.yes_or_no</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value isnull="t"/>
+      <gda_value isnull="t"/>
+    </gda_array_row>
     <gda_array_row>
       <gda_value>int2</gda_value>
       <gda_value>GdaShort</gda_value>
@@ -131,12 +137,30 @@
       <gda_value>@ &lt;number&gt; &lt;units&gt;, time interval</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
+    <gda_array_row>
+      <gda_value>json</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value isnull="t"/>
+      <gda_value isnull="t"/>
+    </gda_array_row>
+    <gda_array_row>
+      <gda_value>jsonb</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>Binary JSON</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
     <gda_array_row>
       <gda_value>macaddr</gda_value>
       <gda_value>gchararray</gda_value>
       <gda_value>XX:XX:XX:XX:XX:XX, MAC address</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
+    <gda_array_row>
+      <gda_value>macaddr8</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>XX:XX:XX:XX:XX:XX:XX:XX, MAC address</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
     <gda_array_row>
       <gda_value>money</gda_value>
       <gda_value>gchararray</gda_value>
@@ -155,6 +179,30 @@
       <gda_value>geometric path '(pt1,...)'</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
+    <gda_array_row>
+      <gda_value>pg_dependencies</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>multivariate dependencies</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
+    <gda_array_row>
+      <gda_value>pg_lsn</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>PostgreSQL LSN datatype</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
+    <gda_array_row>
+      <gda_value>pg_ndistinct</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>multivariate ndistinct coefficients</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
+    <gda_array_row>
+      <gda_value>pg_node_tree</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>string representing an internal node tree</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
     <gda_array_row>
       <gda_value>polygon</gda_value>
       <gda_value>gchararray</gda_value>
@@ -173,6 +221,18 @@
       <gda_value>registered text search dictionary</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
+    <gda_array_row>
+      <gda_value>regnamespace</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>registered namespace</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
+    <gda_array_row>
+      <gda_value>regrole</gda_value>
+      <gda_value>gchararray</gda_value>
+      <gda_value>registered role</gda_value>
+      <gda_value isnull="t"/>
+    </gda_array_row>
     <gda_array_row>
       <gda_value>reltime</gda_value>
       <gda_value>gchararray</gda_value>
@@ -188,25 +248,25 @@
     <gda_array_row>
       <gda_value>time</gda_value>
       <gda_value>GdaTime</gda_value>
-      <gda_value>hh:mm:ss, ANSI SQL time</gda_value>
+      <gda_value>time of day</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
     <gda_array_row>
       <gda_value>timestamp</gda_value>
-      <gda_value>GdaTimestamp</gda_value>
+      <gda_value>GDateTime</gda_value>
       <gda_value>date and time</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
     <gda_array_row>
       <gda_value>timestamptz</gda_value>
-      <gda_value>GdaTimestamp</gda_value>
+      <gda_value>GDateTime</gda_value>
       <gda_value>date and time with time zone</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
     <gda_array_row>
       <gda_value>timetz</gda_value>
       <gda_value>GdaTime</gda_value>
-      <gda_value>hh:mm:ss, ANSI SQL time</gda_value>
+      <gda_value>time of day with time zone</gda_value>
       <gda_value isnull="t"/>
     </gda_array_row>
     <gda_array_row>
diff --git a/tests/providers/prov-test-common.c b/tests/providers/prov-test-common.c
index deadc3ca3..a3d0432d1 100644
--- a/tests/providers/prov-test-common.c
+++ b/tests/providers/prov-test-common.c
@@ -334,6 +334,7 @@ prov_test_common_check_meta_identifiers (gboolean case_sensitive, gboolean updat
                                                          GDA_SERVER_OPERATION_CREATE_TABLE, NULL, &error);
         g_assert (operation);
         gda_server_operation_set_value_at (operation, table_name, NULL, "/TABLE_DEF_P/TABLE_NAME");
+        gda_server_operation_set_value_at (operation, "TRUE", NULL, "/TABLE_DEF_P/TABLE_IFNOTEXISTS");
         gda_server_operation_set_value_at (operation, "id", NULL, "/FIELDS_A/@COLUMN_NAME/0");
         gda_server_operation_set_value_at (operation, "int", NULL, "/FIELDS_A/@COLUMN_TYPE/0");
         gda_server_operation_set_value_at (operation, "TRUE", NULL, "/FIELDS_A/@COLUMN_PKEY/0");
diff --git a/tests/providers/prov-test-util.c b/tests/providers/prov-test-util.c
index 1104b51fe..e0af1198a 100644
--- a/tests/providers/prov-test-util.c
+++ b/tests/providers/prov-test-util.c
@@ -53,7 +53,9 @@ compare_data_model_with_expected (GdaDataModel *model, const gchar *expected_fil
                g_object_unref (compare_m);
                return FALSE;
        }
-       
+       gchar *dmodel = gda_data_model_dump_as_string (compare_m);
+       g_message ("Expected file: %s\nExpected schema:\n%s", expected_file, dmodel);
+       g_free (dmodel);
        /* compare number of rows and columns */
        gint ncols, nrows, row, col;
        ncols = gda_data_model_get_n_columns (model);
@@ -183,6 +185,9 @@ prov_test_check_types_schema (GdaConnection *cnc)
 #endif
                return FALSE;
        }
+       gchar *dmod = gda_data_model_dump_as_string (schema_m);
+       g_message ("Meta Types from connection:\n%s", dmod);
+       g_free (dmod);
 
        str = g_strdup_printf ("TYPES_SCHEMA_%s.xml", gda_connection_get_provider_name (cnc));
        if (CREATE_FILES) {
diff --git a/tests/test-cnc-utils.c b/tests/test-cnc-utils.c
index a6b9c4828..d3dd5a763 100644
--- a/tests/test-cnc-utils.c
+++ b/tests/test-cnc-utils.c
@@ -310,7 +310,7 @@ test_cnc_clean_connection (GdaConnection *cnc, GError **error)
        if (destroy_db) {
                GdaServerOperation *op;
                gchar *dbname;
-               
+
                const gchar *db_params;
                GdaQuarkList *db_quark_list = NULL;
 
@@ -330,13 +330,18 @@ test_cnc_clean_connection (GdaConnection *cnc, GError **error)
                g_free (str);
                g_assert (db_params);
 
-               op = gda_server_operation_prepare_drop_database (prov_id, dbname, NULL);
+               op = gda_server_operation_prepare_drop_database (prov_id, dbname, error);
+               if (op == NULL) {
+                       g_warning ("Error Dropping Database: %s", (*error)->message ? (*error)->message : "No 
Datails");
+                       g_free (dbname);
+                       return FALSE;
+               }
                g_free (dbname);
                db_quark_list = gda_quark_list_new_from_string (db_params);
                gda_quark_list_foreach (db_quark_list, (GHFunc) db_drop_quark_foreach_func, op);
                gda_quark_list_free (db_quark_list);
 
-               if (!gda_server_operation_perform_drop_database (op, NULL, error))
+               if (!gda_server_operation_perform_drop_database (op, prov_id, error))
                        retval = FALSE;
                g_object_unref (op);
        }


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