Changeset: cf1c8e7104b1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cf1c8e7104b1
Modified Files:
        sql/backends/monet5/sql_upgrades.c
        
sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: Aug2024
Log Message:

Fix thinko: cleanup function if it exists, not if it doesn't.


diffs (truncated from 301 to 300 lines):

diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -3293,9 +3293,10 @@ sql_update_jan2022(Client c, mvc *sql)
                                printf("Running database upgrade 
commands:\n%s\n", query);
                                fflush(stdout);
                                err = SQLstatementIntern(c, query, "update", 
true, false, NULL);
+                       } else {
+                               sql->session->status = 0; /* if the function 
was not found clean the error */
+                               sql->errstr[0] = '\0';
                        }
-                       sql->session->status = 0; /* if the function was not 
found clean the error */
-                       sql->errstr[0] = '\0';
                }
                sa_destroy(sql->sa);
                if (err)
@@ -5575,9 +5576,10 @@ sql_update_jun2023(Client c, mvc *sql, s
                printf("Running database upgrade commands:\n%s\n", query);
                fflush(stdout);
                err = SQLstatementIntern(c, query, "update", true, false, NULL);
+       } else {
+               sql->session->status = 0; /* if the function was not found 
clean the error */
+               sql->errstr[0] = '\0';
        }
-       sql->session->status = 0; /* if the function was not found clean the 
error */
-       sql->errstr[0] = '\0';
 
        if (!sql_bind_func(sql, "sys", "jarowinkler", &t2, &t2, F_FUNC, true, 
true)) {
                sql->session->status = 0; /* if the function was not found 
clean the error */
@@ -5828,9 +5830,10 @@ sql_update_dec2023_geom(Client c, mvc *s
        if (sql_bind_func(sql, s->base.name, "shpattach", &tp, NULL, F_PROC, 
true, true)) {
                if ((err = sql_drop_shp(c)) != NULL)
                        return err;
+       } else {
+               sql->session->status = 0; /* if the shpattach function was not 
found clean the error */
+               sql->errstr[0] = '\0';
        }
-       sql->session->status = 0; /* if the shpattach function was not found 
clean the error */
-       sql->errstr[0] = '\0';
 #ifdef HAVE_GEOM
        if (backend_has_module(&(int){0}, "geom")) {
 #ifdef HAVE_SHP
@@ -7246,10 +7249,8 @@ sql_update_aug2024(Client c, mvc *sql, s
                        }
                        if (err == MAL_SUCCEED) {
                                sql_subtype tp;
-                               sql_find_subtype(&tp, "clob", 0, 0);
-                               if (!sql_bind_func(sql, s->base.name, 
"gzcompress", &tp, &tp, F_PROC, true, true)) {
-                                       sql->session->status = 0;
-                                       sql->errstr[0] = '\0';
+                               sql_find_subtype(&tp, "varchar", 0, 0);
+                               if (sql_bind_func(sql, s->base.name, 
"gzcompress", &tp, &tp, F_PROC, true, true)) {
                                        const char query[] =
                                                "drop procedure if exists 
sys.gzcompress(string, string);\n"
                                                "drop procedure if exists 
sys.gzdecompress(string, string);\n"
@@ -7258,14 +7259,15 @@ sql_update_aug2024(Client c, mvc *sql, s
                                        printf("Running database upgrade 
commands:\n%s\n", query);
                                        fflush(stdout);
                                        err = SQLstatementIntern(c, query, 
"update", true, false, NULL);
+                               } else {
+                                       sql->session->status = 0;
+                                       sql->errstr[0] = '\0';
                                }
                        }
                        if (err == MAL_SUCCEED) {
                                sql_subtype tp;
-                               sql_find_subtype(&tp, "clob", 0, 0);
-                               if (!sql_bind_func(sql, s->base.name, 
"newdictionary", &tp, &tp, F_PROC, true, true)) {
-                                       sql->session->status = 0;
-                                       sql->errstr[0] = '\0';
+                               sql_find_subtype(&tp, "varchar", 0, 0);
+                               if (sql_bind_func(sql, s->base.name, 
"newdictionary", &tp, &tp, F_PROC, true, true)) {
                                        const char query[] =
                                                "drop procedure if exists 
sys.newdictionary(string, string);\n"
                                                "drop procedure if exists 
sys.dropdictionary(string, string);\n"
@@ -7273,6 +7275,9 @@ sql_update_aug2024(Client c, mvc *sql, s
                                        printf("Running database upgrade 
commands:\n%s\n", query);
                                        fflush(stdout);
                                        err = SQLstatementIntern(c, query, 
"update", true, false, NULL);
+                               } else {
+                                       sql->session->status = 0;
+                                       sql->errstr[0] = '\0';
                                }
                        }
                }
diff --git 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -1124,14 +1124,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git 
a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -1193,14 +1193,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git 
a/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -1124,14 +1124,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
@@ -1193,14 +1193,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -503,14 +503,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -572,14 +572,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -503,14 +503,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
@@ -572,14 +572,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git 
a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -1124,14 +1124,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
@@ -1193,14 +1193,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
@@ -503,14 +503,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
-
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128 
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
@@ -572,14 +572,3 @@ UPDATE sys._tables SET system = true whe
  and schema_id = (select s.id from sys.schemas s where s.name = 
'information_schema')
  and name in ('check_constraints','table_constraints');
 
-Running database upgrade commands:
-drop procedure if exists sys.gzcompress(string, string);
-drop procedure if exists sys.gzdecompress(string, string);
-drop procedure if exists sys.gztruncate(string, string);
-drop procedure if exists sys.gzexpand(string, string);
-
-Running database upgrade commands:
-drop procedure if exists sys.newdictionary(string, string);
-drop procedure if exists sys.dropdictionary(string, string);
-drop procedure if exists sys.initializedictionary();
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to