Changeset: 194efa151ae6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/194efa151ae6
Modified Files:
        gdk/gdk_join.c
        sql/test/miscellaneous/Tests/simple_plans.test
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 54727 to 300 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -68,7 +68,7 @@ SQLhelp sqlhelp1[] = {
        {"ALTER TABLE",
         "",
         "ALTER TABLE [ IF EXISTS ] qname ADD [ COLUMN ] column_def\n"
-        "ALTER TABLE [ IF EXISTS ] qname ADD table_constraint\n"
+        "ALTER TABLE [ IF EXISTS ] qname ADD [ CONSTRAINT ident ] 
table_constraint\n"
         "ALTER TABLE [ IF EXISTS ] qname ALTER [ COLUMN ] ident SET DEFAULT 
value\n"
         "ALTER TABLE [ IF EXISTS ] qname ALTER [ COLUMN ] ident SET [NOT] 
NULL\n"
         "ALTER TABLE [ IF EXISTS ] qname ALTER [ COLUMN ] ident DROP DEFAULT\n"
@@ -910,9 +910,10 @@ SQLhelp sqlhelp2[] = {
         NULL,},
        {"table_constraint",
         NULL,
-        "[ CONSTRAINT ident ] { PRIMARY KEY column_list | UNIQUE column_list 
|\n"
+        "[ CONSTRAINT ident ] { CHECK '(' search_condition ')' |\n"
+        "    PRIMARY KEY column_list | UNIQUE column_list |\n"
         "    FOREIGN KEY column_list REFERENCES qname [ column_list ] [ 
match_options ] [ reference_action ] }",
-        "column_list,match_options,reference_action",
+        "column_list,search_condition,match_options,reference_action",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-definition/table-elements/"},
        {"table_element",
         NULL,
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -4212,7 +4212,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT **r3p
                /* maybe do a hash join on the swapped operands; if we
                 * do, we need to sort the output, so we take that into
                 * account as well */
-               bool lhash, plhash, lcand;
+               bool lhash, plhash, lcand, rkey = r->tkey;
                double lcost;
 
                lcost = joincost(l, rci.ncand, &lci, &lhash, &plhash, &lcand);
@@ -4220,7 +4220,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT **r3p
                        rc = GDK_FAIL;
                        goto doreturn;
                }
-               if (semi)
+               if (semi && !rkey)
                        lcost += rci.ncand; /* cost of BATunique(r) */
                /* add cost of sorting; obviously we don't know the
                 * size, so we guess that the size of the output is
@@ -4229,7 +4229,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT **r3p
                if (lcost < rcost) {
                        BAT *tmp = sr;
                        BAT *r1, *r2;
-                       if (semi) {
+                       if (semi && !rkey) {
                                sr = BATunique(r, sr);
                                if (sr == NULL) {
                                        rc = GDK_FAIL;
@@ -4240,7 +4240,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT **r3p
                        rc = hashjoin(&r2, &r1, NULL, r, l, &rci, &lci, 
nil_matches,
                                      false, false, false, false, false, false, 
estimate,
                                      t0, true, lhash, plhash, lcand, func);
-                       if (semi)
+                       if (semi && !rkey)
                                BBPunfix(sr->batCacheid);
                        if (rc != GDK_SUCCEED)
                                goto doreturn;
diff --git a/geom/sql/conformance/Tests/T1.test 
b/geom/sql/conformance/Tests/T1.test
--- a/geom/sql/conformance/Tests/T1.test
+++ b/geom/sql/conformance/Tests/T1.test
@@ -1,4 +1,4 @@
-query T rowsort
+query T nosort
 SELECT f_table_name FROM geometry_columns ORDER BY f_table_name
 ----
 bridges
diff --git a/sql/backends/monet5/Tests/rapi05.test 
b/sql/backends/monet5/Tests/rapi05.test
--- a/sql/backends/monet5/Tests/rapi05.test
+++ b/sql/backends/monet5/Tests/rapi05.test
@@ -11,7 +11,7 @@ statement ok
 CREATE FUNCTION kmeans(data float, ncluster integer) returns integer
 language R {kmeans(data,ncluster)$cluster}
 
-query I rowsort
+query I nosort
 SELECT cluster FROM (SELECT MIN(x) AS minx, MAX(x) AS maxx, kmeans(x,5) AS 
cluster FROM xdata
        GROUP BY cluster) as cdata ORDER BY cluster
 ----
diff --git a/sql/backends/monet5/generator/Tests/joins00.test 
b/sql/backends/monet5/generator/Tests/joins00.test
--- a/sql/backends/monet5/generator/Tests/joins00.test
+++ b/sql/backends/monet5/generator/Tests/joins00.test
@@ -98,14 +98,14 @@ create table tmp(i tinyint)
 statement ok
 insert into tmp values(3),(4),(5)
 
-query I rowsort
+query I nosort
 select * from tmp order by i
 ----
 3
 4
 5
 
-query II rowsort
+query II nosort
 select * from generate_series(9,0,-2) X, tmp Y where X.value = Y.i order by 
X.value, Y.i
 ----
 3
@@ -113,7 +113,7 @@ 3
 5
 5
 
-query II rowsort
+query II nosort
 select * from generate_series(9,0,-2) X, tmp Y where Y.i = X.value order by 
X.value, Y.i
 ----
 3
@@ -121,13 +121,13 @@ 3
 5
 5
 
-query II rowsort
+query II nosort
 select * from generate_series(9,0,-2) X, tmp Y where X.value = Y.i and value 
<5 order by X.value, Y.i
 ----
 3
 3
 
-query II rowsort
+query II nosort
 select * from generate_series(9,0,-2) as  X, tmp Y where X.value = Y.i and 
value <7 and value >3 order by X.value, Y.i
 ----
 5
diff --git a/sql/backends/monet5/generator/Tests/joins01.test 
b/sql/backends/monet5/generator/Tests/joins01.test
--- a/sql/backends/monet5/generator/Tests/joins01.test
+++ b/sql/backends/monet5/generator/Tests/joins01.test
@@ -7,14 +7,14 @@ insert into tmp values
 (timestamp '2008-03-01 10:00'),
 (timestamp '2008-03-01 20:00')
 
-query T rowsort
+query T nosort
 select * from tmp order by i
 ----
 2008-03-01 00:00:00
 2008-03-01 10:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) X, tmp Y where X.value = Y.i 
order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -24,7 +24,7 @@ 2008-03-01 10:00:00
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) X, tmp Y where Y.i = X.value 
order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -34,7 +34,7 @@ 2008-03-01 10:00:00
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) X, tmp Y where X.value = Y.i 
and value < timestamp '2008-03-01 20:00' order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -42,7 +42,7 @@ 2008-03-01 00:00:00
 2008-03-01 10:00:00
 2008-03-01 10:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) X, tmp Y where Y.i = X.value  
and value < timestamp '2008-03-01 20:00' order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -50,7 +50,7 @@ 2008-03-01 00:00:00
 2008-03-01 10:00:00
 2008-03-01 10:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) as  X, tmp Y where X.value = 
Y.i and value < timestamp '2008-03-01 20:00' and value > timestamp '200-03-01 
00:00' order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -58,7 +58,7 @@ 2008-03-01 00:00:00
 2008-03-01 10:00:00
 2008-03-01 10:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-01 00:00',timestamp 
'2008-03-04 12:00',cast( '10' as interval hour)) as  X, tmp Y where X.value = 
Y.i and i < timestamp '2008-03-01 20:00' and i > timestamp '200-03-01 00:00' 
order by X.value, Y.i
 ----
 2008-03-01 00:00:00
@@ -66,7 +66,7 @@ 2008-03-01 00:00:00
 2008-03-01 10:00:00
 2008-03-01 10:00:00
 
-query T rowsort
+query T nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X order by X.value
 ----
 2008-03-01 10:00:00
@@ -79,7 +79,7 @@ 2008-03-03 22:00:00
 2008-03-04 08:00:00
 2008-03-04 18:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i 
order by X.value, Y.i
 ----
 2008-03-01 10:00:00
@@ -87,7 +87,7 @@ 2008-03-01 10:00:00
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where Y.i = X.value 
order by X.value, Y.i
 ----
 2008-03-01 10:00:00
@@ -95,26 +95,26 @@ 2008-03-01 10:00:00
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i
 and value > timestamp '2008-03-01 11:00' order by X.value, Y.i
 ----
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i
 and i > timestamp '2008-03-01 11:00' order by X.value, Y.i
 ----
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query T rowsort
+query T nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X where value > timestamp 
'2008-03-01 11:00' and value < timestamp '2008-03-01 21:00' order by X.value
 ----
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i
 and value > timestamp '2008-03-01 11:00'
 and value < timestamp '2008-03-01 21:00' order by X.value, Y.i
@@ -122,7 +122,7 @@ and value < timestamp '2008-03-01 21:00'
 2008-03-01 20:00:00
 2008-03-01 20:00:00
 
-query TT rowsort
+query TT nosort
 select * from generate_series(timestamp '2008-03-04 18:00',timestamp 
'2008-03-01 00:00',cast( '-10' as interval hour)) X, tmp Y where X.value = Y.i
 and i > timestamp '2008-03-01 11:00'
 and i < timestamp '2008-03-01 21:00' order by X.value, Y.i
diff --git a/sql/benchmarks/ATIS/Tests/one.test.in 
b/sql/benchmarks/ATIS/Tests/one.test.in
--- a/sql/benchmarks/ATIS/Tests/one.test.in
+++ b/sql/benchmarks/ATIS/Tests/one.test.in
@@ -179,7 +179,7 @@ ATLANTA
 GEORGIA
 MATL
 
-query TTT rowsort
+query TTT nosort
 select city.city_name,state.state_name,city.city_code from state,city where 
city.state_code=state.state_code order by city.city_name,state.state_name
 ----
 ATLANTA
@@ -216,47 +216,47 @@ WASHINGTON
 DISTRICT OF COLUMBIA
 WWAS
 
-query TT rowsort
+query TT nosort
 select month_name.month_name,day_name.day_name from month_name,day_name where 
month_name.month_number=day_name.day_code order by month_name.month_number
 ----
-APRIL
-THURSDAY
-FEBRUARY
-TUESDAY
 JANUARY
 MONDAY
-JULY
-SUNDAY
+FEBRUARY
+TUESDAY
+MARCH
+WEDNESDAY
+APRIL
+THURSDAY
+MAY
+FRIDAY
 JUNE
 SATURDAY
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to