Changeset: db05429c8a8e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db05429c8a8e
Modified Files:
        clients/mapiclient/dump.c
        sql/server/sql_partition.c
        sql/test/testdb/Tests/dump.stable.out
        sql/test/testdb/Tests/load.sql
Branch: Jun2020
Log Message:

Fixed dump with recent partitions by range changes and remove assertion which 
is no longer always valid


diffs (90 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -2916,7 +2916,7 @@ dump_database(Mapi mid, stream *toConsol
                                        maxv = mapi_fetch_field(shdl, 1);
                                        wnulls = mapi_fetch_field(shdl, 2);
                                }
-                               if (minv || maxv || !wnulls) {
+                               if (minv || maxv || !wnulls || (!minv && !maxv 
&& wnulls && strcmp(wnulls, "false") == 0)) {
                                        mnstr_printf(toConsole, " FROM ");
                                        if (minv)
                                                squoted_print(toConsole, minv, 
'\'');
@@ -2928,7 +2928,7 @@ dump_database(Mapi mid, stream *toConsol
                                        else
                                                mnstr_printf(toConsole, "RANGE 
MAXVALUE");
                                }
-                               if (!wnulls || strcmp(wnulls, "1") == 0)
+                               if (!wnulls || strcmp(wnulls, "true") == 0)
                                        mnstr_printf(toConsole, " %s NULL 
VALUES", (minv || maxv || !wnulls) ? "WITH" : "FOR");
                                mapi_close_handle(shdl);
                        }
diff --git a/sql/server/sql_partition.c b/sql/server/sql_partition.c
--- a/sql/server/sql_partition.c
+++ b/sql/server/sql_partition.c
@@ -404,7 +404,6 @@ initialize_sql_parts(mvc* sql, sql_table
                                                const void *nil_ptr = 
ATOMnilptr(tpe);
                                                size_t nil_len = ATOMlen(tpe, 
nil_ptr);
 
-                                               assert(p->with_nills && 
next->with_nills);
                                                p->part.range.minvalue = 
sa_alloc(sql->session->tr->sa, nil_len);
                                                p->part.range.maxvalue = 
sa_alloc(sql->session->tr->sa, nil_len);
                                                memcpy(p->part.range.minvalue, 
nil_ptr, nil_len);
diff --git a/sql/test/testdb/Tests/dump.stable.out 
b/sql/test/testdb/Tests/dump.stable.out
--- a/sql/test/testdb/Tests/dump.stable.out
+++ b/sql/test/testdb/Tests/dump.stable.out
@@ -101314,6 +101314,26 @@ CREATE TABLE "testschema"."subtable3" (
        "a" INTEGER,
        "b" VARCHAR(32)
 );
+CREATE MERGE TABLE "testschema"."testme2" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+) PARTITION BY RANGE ON (a);
+CREATE TABLE "testschema"."subtable4" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
+CREATE TABLE "testschema"."subtable5" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
+CREATE MERGE TABLE "testschema"."testme3" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+) PARTITION BY RANGE ON (a);
+CREATE TABLE "testschema"."subtable6" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
 CREATE MERGE TABLE "testschema"."testvaluespartitions" (
        "a" INTEGER,
        "b" VARCHAR(32)
@@ -101370,6 +101390,9 @@ NULL  NULL    NULL    NULL    NULL    NULL    NULL    
NULL    
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION FROM RANGE MINVALUE TO '11' WITH NULL VALUES;
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION FROM '11' TO '20';
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable3" AS 
PARTITION FROM '21' TO RANGE MAXVALUE;
+ALTER TABLE "testschema"."testme2" ADD TABLE "testschema"."subtable4" AS 
PARTITION FROM RANGE MINVALUE TO RANGE MAXVALUE;
+ALTER TABLE "testschema"."testme2" ADD TABLE "testschema"."subtable5" AS 
PARTITION FOR NULL VALUES;
+ALTER TABLE "testschema"."testme3" ADD TABLE "testschema"."subtable6" AS 
PARTITION FROM RANGE MINVALUE TO RANGE MAXVALUE WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits1" AS PARTITION IN ('1', '2', '3');
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits3" AS PARTITION IN ('7', '8', '9');
diff --git a/sql/test/testdb/Tests/load.sql b/sql/test/testdb/Tests/load.sql
--- a/sql/test/testdb/Tests/load.sql
+++ b/sql/test/testdb/Tests/load.sql
@@ -101256,6 +101256,14 @@ INSERT INTO testschema.subtable2 VALUES 
 ALTER TABLE testschema.testme ADD TABLE testschema.subtable1 AS PARTITION FROM 
RANGE MINVALUE TO 11 WITH NULL VALUES;
 ALTER TABLE testschema.testme ADD TABLE testschema.subtable2 AS PARTITION FROM 
11 TO 20;
 ALTER TABLE testschema.testme ADD TABLE testschema.subtable3 AS PARTITION FROM 
21 TO RANGE MAXVALUE;
+CREATE MERGE TABLE testschema.testme2 (a int, b varchar(32)) PARTITION BY 
RANGE ON (a);
+CREATE TABLE testschema.subtable4 (a int, b varchar(32));
+CREATE TABLE testschema.subtable5 (a int, b varchar(32));
+ALTER TABLE testschema.testme2 ADD TABLE testschema.subtable4 AS PARTITION 
FROM RANGE MINVALUE TO RANGE MAXVALUE;
+ALTER TABLE testschema.testme2 ADD TABLE testschema.subtable5 AS PARTITION FOR 
NULL VALUES;
+CREATE MERGE TABLE testschema.testme3 (a int, b varchar(32)) PARTITION BY 
RANGE ON (a);
+CREATE TABLE testschema.subtable6 (a int, b varchar(32));
+ALTER TABLE testschema.testme3 ADD TABLE testschema.subtable6 AS PARTITION 
FROM RANGE MINVALUE TO RANGE MAXVALUE WITH NULL VALUES;
 CREATE MERGE TABLE testschema.testvaluespartitions (a int, b varchar(32)) 
PARTITION BY VALUES ON (a);
 CREATE TABLE testschema.sublimits1 (a int, b varchar(32));
 CREATE TABLE testschema.sublimits2 (a int, b varchar(32));
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to