Changeset: bbfd807f1568 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bbfd807f1568
Modified Files:
        MonetDB.spec
        sql/backends/monet5/rel_bin.c
        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
        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
        sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
        
sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-previous-upgrade-chain/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
        sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Dec2025 branch.


diffs (truncated from 390 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -456,6 +456,7 @@ developer.
 %{_bindir}/smack01
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
+%{_bindir}/sqlsample.py
 %{_bindir}/streamcat
 %{_bindir}/testcondvar
 %endif
@@ -1068,6 +1069,7 @@ rm "${RPM_BUILD_ROOT}"%{_bindir}/smack01
 rm "${RPM_BUILD_ROOT}"%{_bindir}/sqllogictest.py
 rm "${RPM_BUILD_ROOT}"%{_bindir}/sqlsample.php
 rm "${RPM_BUILD_ROOT}"%{_bindir}/sqlsample.pl
+rm "${RPM_BUILD_ROOT}"%{_bindir}/sqlsample.py
 rm "${RPM_BUILD_ROOT}"%{_bindir}/streamcat
 rm "${RPM_BUILD_ROOT}"%{_bindir}/testcondvar
 rm -r "${RPM_BUILD_ROOT}"%{_datadir}/doc/MonetDB*
diff --git a/clients/Tests/All b/clients/Tests/All
--- a/clients/Tests/All
+++ b/clients/Tests/All
@@ -1,4 +1,4 @@
-exports
+MERCURIAL?exports
 
HAVE_HGE&HAVE_FITS&HAVE_GEOM&HAVE_LIBR&HAVE_LIBPY3&HAVE_NETCDF&HAVE_SHP&HAVE_CUDF?MAL-signatures-hge
 
!HAVE_HGE&HAVE_FITS&HAVE_GEOM&HAVE_LIBR&HAVE_LIBPY3&HAVE_NETCDF&HAVE_SHP&HAVE_CUDF?MAL-signatures
 NOT_WIN32?melcheck
diff --git a/clients/examples/CMakeLists.txt b/clients/examples/CMakeLists.txt
--- a/clients/examples/CMakeLists.txt
+++ b/clients/examples/CMakeLists.txt
@@ -11,3 +11,4 @@
 add_subdirectory(C)
 add_subdirectory(perl)
 add_subdirectory(php)
+add_subdirectory(python)
diff --git a/clients/examples/python/CMakeLists.txt 
b/clients/examples/python/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/clients/examples/python/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# For copyright information, see the file debian/copyright.
+#]]
+
+install(FILES
+  sqlsample.py
+  PERMISSIONS ${PROGRAM_PERMISSIONS_DEFAULT}
+  DESTINATION ${CMAKE_INSTALL_BINDIR}
+  COMPONENT clienttest)
diff --git a/debian/monetdb-client-testing.install 
b/debian/monetdb-client-testing.install
--- a/debian/monetdb-client-testing.install
+++ b/debian/monetdb-client-testing.install
@@ -17,5 +17,6 @@ debian/tmp/usr/bin/smack00 usr/bin
 debian/tmp/usr/bin/smack01 usr/bin
 debian/tmp/usr/bin/sqlsample.php usr/bin
 debian/tmp/usr/bin/sqlsample.pl usr/bin
+debian/tmp/usr/bin/sqlsample.py usr/bin
 debian/tmp/usr/bin/streamcat usr/bin
 debian/tmp/usr/bin/testcondvar usr/bin
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1841,7 +1841,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
                        if (r) { /* check new ordered aggregation */
                                list *obe = r->h->data;
                                if (obe && obe->h) {
-                                       stmt *orderby = NULL, *orderby_ids, 
*orderby_grp;
+                                       stmt *orderby = NULL, *orderby_ids = 
NULL, *orderby_grp = NULL;
                                        /* order by */
                                        if (grp) {
                                                orderby = stmt_order(be, grp, 
true, true);
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
@@ -19,6 +19,7 @@
 #include "gdk_time.h"
 #include <unistd.h>
 #include "sql_upgrades.h"
+#include "sql_scenario.h"
 #include "rel_rel.h"
 #include "rel_semantic.h"
 
@@ -2201,12 +2202,13 @@ sql_update_sep2022(Client c, mvc *sql, s
        if ((b = BBPquickdesc(output->cols[0].b)) && BATcount(b) > 0) {
                pos = snprintf(buf, bufsize,
                        "ALTER TABLE sys.keywords SET READ WRITE;\n"
-                       "DELETE FROM sys.keywords WHERE keyword IN 
('LOCKED');\n");
+                       "DELETE FROM sys.keywords WHERE keyword IN 
('LOCKED');\n"
+                       "COMMIT;\n");
                assert(pos < bufsize);
                printf("Running database upgrade commands:\n%s\n", buf);
                fflush(stdout);
                err = SQLstatementIntern(c, buf, "update", true, false, NULL);
-               if (err == MAL_SUCCEED) {
+               if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == MAL_SUCCEED) 
{
                        pos = snprintf(buf, bufsize, "ALTER TABLE sys.keywords 
SET READ ONLY;\n");
                        assert(pos < bufsize);
                        printf("Running database upgrade commands:\n%s\n", buf);
@@ -2230,12 +2232,13 @@ sql_update_sep2022(Client c, mvc *sql, s
        if ((b = BBPquickdesc(output->cols[0].b)) && BATcount(b) == 0) {
                pos = snprintf(buf, bufsize,
                                "ALTER TABLE sys.table_types SET READ WRITE;\n"
-                               "INSERT INTO sys.table_types VALUES (7, 
'UNLOGGED TABLE');\n");
+                               "INSERT INTO sys.table_types VALUES (7, 
'UNLOGGED TABLE');\n"
+                               "COMMIT;\n");
                assert(pos < bufsize);
                printf("Running database upgrade commands:\n%s\n", buf);
                fflush(stdout);
                err = SQLstatementIntern(c, buf, "update", true, false, NULL);
-               if (err == MAL_SUCCEED) {
+               if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == MAL_SUCCEED) 
{
                        pos = snprintf(buf, bufsize, "ALTER TABLE 
sys.table_types SET READ ONLY;\n");
                        assert(pos < bufsize);
                        printf("Running database upgrade commands:\n%s\n", buf);
@@ -3072,7 +3075,7 @@ sql_update_dec2023(Client c, mvc *sql, s
                printf("Running database upgrade commands:\n%s\n", query);
                fflush(stdout);
                err = SQLstatementIntern(c, query, "update", true, false, NULL);
-               if (err == MAL_SUCCEED) {
+               if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == MAL_SUCCEED) 
{
                        static const char query2[] = "alter table 
sys.function_languages set read only;\n";
                        printf("Running database upgrade commands:\n%s\n", 
query2);
                        fflush(stdout);
@@ -3744,7 +3747,7 @@ sql_update_dec2023_sp4(Client c, mvc *sq
                        printf("Running database upgrade commands:\n%s\n", 
query);
                        fflush(stdout);
                        err = SQLstatementIntern(c, query, "update", true, 
false, NULL);
-                       if (err == MAL_SUCCEED) {
+                       if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == 
MAL_SUCCEED) {
                                static const char query2[] =
                                        "create temporary table d as (select 
distinct * from sys.dependencies);\n"
                                        "delete from sys.dependencies;\n"
@@ -4274,7 +4277,8 @@ sql_update_aug2024(Client c, mvc *sql, s
                                        " ('ClientRemark', 'remark');\n"
                                        "grant select on 
sys.clientinfo_properties to public;\n"
                                        "update sys.functions set system = true 
where schema_id = 2000 and name in ('setclientinfo', 'sessions');\n"
-                                       "update sys._tables set system = true 
where schema_id = 2000 and name in ('clientinfo_properties', 'sessions');\n";
+                                       "update sys._tables set system = true 
where schema_id = 2000 and name in ('clientinfo_properties', 'sessions');\n"
+                                       "commit;\n";
 
                                t = mvc_bind_table(sql, s, "sessions");
                                t->system = 0; /* make it non-system else the 
drop view will fail */
@@ -4282,7 +4286,7 @@ sql_update_aug2024(Client c, mvc *sql, s
                                fflush(stdout);
                                err = SQLstatementIntern(c, query, "update", 
true, false, NULL);
                        }
-                       if (err == MAL_SUCCEED) {
+                       if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == 
MAL_SUCCEED) {
                                static const char query[] = "alter table 
sys.clientinfo_properties SET READ ONLY;\n";
                                printf("Running database upgrade 
commands:\n%s\n", query);
                                fflush(stdout);
@@ -4301,14 +4305,15 @@ sql_update_aug2024(Client c, mvc *sql, s
                                        "(3, 'Unique Key With Nulls Not 
Distinct'),\n"
                                        "(4, 'Check Constraint');\n"
                                        "GRANT SELECT ON sys.key_types TO 
PUBLIC;\n"
-                                       "UPDATE sys._tables SET system = true 
WHERE schema_id = 2000 AND name = 'key_types';\n";
+                                       "UPDATE sys._tables SET system = true 
WHERE schema_id = 2000 AND name = 'key_types';\n"
+                                       "COMMIT;\n";
                                if ((t = mvc_bind_table(sql, s, "key_types")) 
!= NULL)
                                        t->system = 0;
                                printf("Running database upgrade 
commands:\n%s\n", query);
                                fflush(stdout);
                                err = SQLstatementIntern(c, query, "update", 
true, false, NULL);
                        }
-                       if (err == MAL_SUCCEED) {
+                       if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == 
MAL_SUCCEED) {
                                static const char query[] = "ALTER TABLE 
sys.key_types SET READ ONLY;\n";
                                printf("Running database upgrade 
commands:\n%s\n", query);
                                fflush(stdout);
@@ -4814,14 +4819,14 @@ sql_update_mar2025_sp1(Client c, mvc *sq
                printf("Running database upgrade commands:\n%s\n", stmt2a);
                fflush(stdout);
                err = SQLstatementIntern(c, stmt2a, "update", true, false, 
NULL);
-               if (err == MAL_SUCCEED) {
+               if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == MAL_SUCCEED) 
{
                        static const char stmt2b[] =
                                "INSERT INTO sys.table_types VALUES (31, 'LOCAL 
TEMPORARY VIEW');\n"
                                "COMMIT;\n";
                        printf("Running database upgrade commands:\n%s\n", 
stmt2b);
                        fflush(stdout);
                        err = SQLstatementIntern(c, stmt2b, "update", true, 
false, NULL);
-                       if (err == MAL_SUCCEED) {
+                       if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == 
MAL_SUCCEED) {
                                static const char stmt3[] = "ALTER TABLE 
sys.table_types SET READ ONLY;\n";
                                printf("Running database upgrade 
commands:\n%s\n", stmt3);
                                fflush(stdout);
@@ -5250,11 +5255,12 @@ sql_update_dec2025(Client c, mvc *sql, s
        if ((b = BBPquickdesc(output->cols[0].b)) && BATcount(b) > 0) {
                const char query[] =
                        "ALTER TABLE sys.keywords SET READ WRITE;\n"
-                       "DELETE FROM sys.keywords WHERE keyword = 'PLAN';\n";
+                       "DELETE FROM sys.keywords WHERE keyword = 'PLAN';\n"
+                       "COMMIT;\n";
                printf("Running database upgrade commands:\n%s\n", query);
                fflush(stdout);
                err = SQLstatementIntern(c, query, "update", true, false, NULL);
-               if (err == MAL_SUCCEED) {
+               if (err == MAL_SUCCEED && (err = SQLtrans(sql)) == MAL_SUCCEED) 
{
                        static const char query2[] = "ALTER TABLE sys.keywords 
SET READ ONLY;\n";
                        printf("Running database upgrade commands:\n%s\n", 
query2);
                        fflush(stdout);
diff --git a/sql/test/Tests/keys.test b/sql/test/Tests/keys.test
--- a/sql/test/Tests/keys.test
+++ b/sql/test/Tests/keys.test
@@ -18,6 +18,7 @@ CREATE INDEX allnewtriples_object_idx ON
 query TITI nosort
 SELECT idxs.name, idxs."type", keys.name, keys."type"
 FROM sys.idxs LEFT JOIN sys.keys on idxs.name = keys.name
+WHERE idxs.name NOT LIKE '%srid%' -- skip geom keys
 ORDER BY idxs.name, keys.name
 ----
 allnewtriples_object_idx
@@ -92,10 +93,6 @@ privilege_codes_privilege_code_name_uniq
 0
 privilege_codes_privilege_code_name_unique
 1
-spatial_ref_sys_srid_pkey
-0
-spatial_ref_sys_srid_pkey
-0
 table_types_table_type_id_pkey
 0
 table_types_table_type_id_pkey
@@ -112,6 +109,7 @@ unique_key
 query TITI nosort
 SELECT idxs.name, idxs."type", keys.name, keys."type"
 FROM sys.idxs JOIN sys.keys on idxs.name = keys.name
+WHERE idxs.name NOT LIKE '%srid%' -- skip geom keys
 ORDER BY idxs.name, keys.name
 ----
 comments_id_pkey
@@ -174,10 +172,6 @@ privilege_codes_privilege_code_name_uniq
 0
 privilege_codes_privilege_code_name_unique
 1
-spatial_ref_sys_srid_pkey
-0
-spatial_ref_sys_srid_pkey
-0
 table_types_table_type_id_pkey
 0
 table_types_table_type_id_pkey
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
@@ -240,6 +240,7 @@ update sys.functions set system = true w
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ WRITE;
 DELETE FROM sys.keywords WHERE keyword = 'PLAN';
+COMMIT;
 
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ ONLY;
diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
@@ -240,6 +240,7 @@ update sys.functions set system = true w
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ WRITE;
 DELETE FROM sys.keywords WHERE keyword = 'PLAN';
+COMMIT;
 
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ ONLY;
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
@@ -325,6 +325,7 @@ update sys.functions set system = true w
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ WRITE;
 DELETE FROM sys.keywords WHERE keyword = 'PLAN';
+COMMIT;
 
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ ONLY;
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
@@ -242,6 +242,7 @@ update sys.functions set system = true w
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ WRITE;
 DELETE FROM sys.keywords WHERE keyword = 'PLAN';
+COMMIT;
 
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ ONLY;
diff --git a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out 
b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
--- a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
@@ -242,6 +242,7 @@ update sys.functions set system = true w
 Running database upgrade commands:
 ALTER TABLE sys.keywords SET READ WRITE;
 DELETE FROM sys.keywords WHERE keyword = 'PLAN';
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to