Changeset: ec24bba60912 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ec24bba60912
Modified Files:
        sql/backends/monet5/sql.c
        sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (81 lines):

diff --git a/clients/mapiclient/msqldump.1 b/clients/mapiclient/msqldump.1
--- a/clients/mapiclient/msqldump.1
+++ b/clients/mapiclient/msqldump.1
@@ -90,13 +90,15 @@ When dumping the table data, use INSERT 
 COPY INTO + CSV values.
 INSERT INTO statements are more portable, and necessary when the
 load of the dump is processed by e.g. a JDBC application.
+When the dump is to be used to feed back into MonetDB, COPY
+INTO is preferred since that is processed more efficiently.
 .TP
 \fB\-\-noescape\fP (\fB\-e\fP)
 When dumping the table data, use the NO ESCAPE option on the COPY INTO
 query.
 .TP
 \fB\-\-functions\fP (\fB\-f\fP)
-Only dump functions definitions.
+Only dump function definitions.
 .TP
 \fB\-\-table=[\fIschema\fP\fB.\fP]\fItable\fP (\fB\-t\fP 
[\fIschema\fP\fB.\fP]\fItable\fP)
 Only dump the specified table.
diff --git a/documentation/source/manual_pages/msqldump.rst 
b/documentation/source/manual_pages/msqldump.rst
--- a/documentation/source/manual_pages/msqldump.rst
+++ b/documentation/source/manual_pages/msqldump.rst
@@ -64,14 +64,15 @@ OPTIONS
    When dumping the table data, use INSERT INTO statements, rather than
    COPY INTO + CSV values. INSERT INTO statements are more portable, and
    necessary when the load of the dump is processed by e.g. a JDBC
-   application.
+   application. When the dump is to be used to feed back into MonetDB,
+   COPY INTO is preferred since that is processed more efficiently.
 
 **--noescape** (**-e**)
    When dumping the table data, use the NO ESCAPE option on the COPY
    INTO query.
 
 **--functions** (**-f**)
-   Only dump functions definitions.
+   Only dump function definitions.
 
 **--table=**\ [\ *schema*\ **.**\ ]\ *table* (**-t** [\ *schema*\ **.**]\ 
*table*\ )
    Only dump the specified table. If *schema* is not specified, the
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5524,7 +5524,11 @@ SQLcheck(Client cntxt, MalBlkPtr mb, Mal
                        int pos = 0;
                        sql_rel *rel = rel_basetable(m, k->t, k->t->base.name);
                        sql_exp *exp = exp_read(m, rel, NULL, NULL, 
sa_strdup(m->sa, k->check), &pos, 0);
-                       if (!(*r = GDKstrdup(exp2sql(m, exp))))
+                       if (exp->comment)
+                               *r = GDKstrdup(exp->comment);
+                       else
+                               *r = GDKstrdup(exp2sql(m, exp));
+                       if (*r == NULL)
                                throw(SQL, "SQLcheck", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                        return MAL_SUCCEED;
                }
diff --git a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out 
b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
@@ -101198,7 +101198,7 @@ CREATE TABLE "testschema"."nulls_not_dis
        CONSTRAINT "nulls_not_distinct_id_pkey" PRIMARY KEY ("id"),
        CONSTRAINT "nulls_not_distinct_unique1_unique" UNIQUE ("unique1"),
        CONSTRAINT "nulls_not_distinct_unique2_nndunique" UNIQUE NULLS NOT 
DISTINCT ("unique2"),
-       CONSTRAINT "nulls_not_distinct_check1_check" CHECK (check1 > 0)
+       CONSTRAINT "nulls_not_distinct_check1_check" CHECK ("check1" > 0)
 );
 COPY 1 RECORDS INTO "testschema"."nulls_not_distinct" FROM stdin USING 
DELIMITERS E'\t',E'\n','"';
 1      1       1       1
diff --git a/sql/test/testdb-upgrade/Tests/dump.stable.out 
b/sql/test/testdb-upgrade/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade/Tests/dump.stable.out
@@ -101198,7 +101198,7 @@ CREATE TABLE "testschema"."nulls_not_dis
        CONSTRAINT "nulls_not_distinct_id_pkey" PRIMARY KEY ("id"),
        CONSTRAINT "nulls_not_distinct_unique1_unique" UNIQUE ("unique1"),
        CONSTRAINT "nulls_not_distinct_unique2_nndunique" UNIQUE NULLS NOT 
DISTINCT ("unique2"),
-       CONSTRAINT "nulls_not_distinct_check1_check" CHECK (check1 > 0)
+       CONSTRAINT "nulls_not_distinct_check1_check" CHECK ("check1" > 0)
 );
 COPY 1 RECORDS INTO "testschema"."nulls_not_distinct" FROM stdin USING 
DELIMITERS E'\t',E'\n','"';
 1      1       1       1
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to