Changeset: 65e858d0bf42 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65e858d0bf42
Modified Files:
        gdk/gdk.h
        gdk/gdk_firstn.c
        sql/storage/store.c
Branch: Sep2022
Log Message:

merge with Jan2022


diffs (truncated from 715 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2322,7 +2322,7 @@ gdk_export BAT *BATsample_with_seed(BAT 
  */
 #define MAXPARAMS      32
 
-#define CHECK_QRY_TIMEOUT_SHIFT        14
+#define CHECK_QRY_TIMEOUT_SHIFT        16
 #define CHECK_QRY_TIMEOUT_STEP (1 << CHECK_QRY_TIMEOUT_SHIFT)
 #define CHECK_QRY_TIMEOUT_MASK (CHECK_QRY_TIMEOUT_STEP - 1)
 
diff --git a/gdk/gdk_firstn.c b/gdk/gdk_firstn.c
--- a/gdk/gdk_firstn.c
+++ b/gdk/gdk_firstn.c
@@ -94,11 +94,11 @@
 
 /* we inherit LT and GT from gdk_calc_private.h */
 
-#define nLTbte(a, b)   (!is_bte_nil(b) && (is_bte_nil(a) || (a) < (b)))
-#define nLTsht(a, b)   (!is_sht_nil(b) && (is_sht_nil(a) || (a) < (b)))
-#define nLTint(a, b)   (!is_int_nil(b) && (is_int_nil(a) || (a) < (b)))
-#define nLTlng(a, b)   (!is_lng_nil(b) && (is_lng_nil(a) || (a) < (b)))
-#define nLThge(a, b)   (!is_hge_nil(b) && (is_hge_nil(a) || (a) < (b)))
+#define nLTbte(a, b)   (!is_bte_nil(a) && (is_bte_nil(b) || (a) < (b)))
+#define nLTsht(a, b)   (!is_sht_nil(a) && (is_sht_nil(b) || (a) < (b)))
+#define nLTint(a, b)   (!is_int_nil(a) && (is_int_nil(b) || (a) < (b)))
+#define nLTlng(a, b)   (!is_lng_nil(a) && (is_lng_nil(b) || (a) < (b)))
+#define nLThge(a, b)   (!is_hge_nil(a) && (is_hge_nil(b) || (a) < (b)))
 
 #define nGTbte(a, b)   (!is_bte_nil(b) && (is_bte_nil(a) || (a) > (b)))
 #define nGTsht(a, b)   (!is_sht_nil(b) && (is_sht_nil(a) || (a) > (b)))
diff --git a/sql/test/Tests/orderby-nulls-first-last.test 
b/sql/test/Tests/orderby-nulls-first-last.test
--- a/sql/test/Tests/orderby-nulls-first-last.test
+++ b/sql/test/Tests/orderby-nulls-first-last.test
@@ -1,4 +1,4 @@
--- tests voor ORDER BY x [ ASC | DESC ] NULLS { FIRST | LAST }
+-- tests voor ORDER BY x [ ASC | DESC ] NULLS { FIRST | LAST }  [ LIMIT n ]  [ 
OFFSET n ]
 
 -- FYI: other scripts where NULLS [ FIRST | LAST ] are tested:
 -- sql/test/analytics/Tests/analytics13.test
@@ -204,6 +204,32 @@ NULL
 NULL
 
 query I nosort
+select cti from obn order by cti nulls last limit 6;
+----
+2
+3
+4
+9
+12
+NULL
+
+query I nosort
+select cti from obn order by cti nulls last limit 4 offset 2;
+----
+4
+9
+12
+NULL
+
+query I nosort
+select cti from obn order by cti nulls last offset 3;
+----
+9
+12
+NULL
+NULL
+
+query I nosort
 select cti from obn order by cti desc;
 ----
 12
@@ -236,6 +262,25 @@ 4
 3
 2
 
+query I nosort
+select cti from obn order by cti desc nulls first limit 5;
+----
+NULL
+NULL
+12
+9
+4
+
+query I nosort
+select cti from obn order by cti desc nulls first offset 1;
+----
+NULL
+12
+9
+4
+3
+2
+
 
 query I nosort
 select cbi from obn order by cbi;
@@ -271,6 +316,32 @@ NULL
 NULL
 
 query I nosort
+select cbi from obn order by cbi nulls last limit 5;
+----
+2
+3
+4
+9
+12
+
+query I nosort
+select cbi from obn order by cbi nulls last limit 4 offset 2;
+----
+4
+9
+12
+NULL
+
+query I nosort
+select cbi from obn order by cbi nulls last offset 2;
+----
+4
+9
+12
+NULL
+NULL
+
+query I nosort
 select cbi from obn order by cbi desc;
 ----
 12
@@ -303,6 +374,35 @@ 4
 3
 2
 
+query I nosort
+select cbi from obn order by cbi desc nulls first limit 6;
+----
+NULL
+NULL
+12
+9
+4
+3
+
+query I nosort
+select cbi from obn order by cbi desc nulls first limit 5 offset 1;
+----
+NULL
+12
+9
+4
+3
+
+query I nosort
+select cbi from obn order by cbi desc nulls first offset 1;
+----
+NULL
+12
+9
+4
+3
+2
+
 
 query R nosort
 select crl from obn order by crl;
@@ -338,6 +438,22 @@ NULL
 NULL
 
 query R nosort
+select crl from obn order by crl nulls last limit 4;
+----
+2.000
+3.000
+4.000
+9.000
+
+query R nosort
+select crl from obn order by crl nulls last limit 4 offset 2;
+----
+4.000
+9.000
+12.000
+NULL
+
+query R nosort
 select crl from obn order by crl desc;
 ----
 12.000
@@ -370,6 +486,33 @@ 4.000
 3.000
 2.000
 
+query R nosort
+select crl from obn order by crl desc nulls first limit 5;
+----
+NULL
+NULL
+12.000
+9.000
+4.000
+
+query R nosort
+select crl from obn order by crl desc nulls first limit 4 offset 1;
+----
+NULL
+12.000
+9.000
+4.000
+
+query R nosort
+select crl from obn order by crl desc nulls first offset 1;
+----
+NULL
+12.000
+9.000
+4.000
+3.000
+2.000
+
 
 query R nosort
 select cdl from obn order by cdl;
@@ -394,6 +537,15 @@ 9.000
 12.000
 
 query R nosort
+select cdl from obn order by cdl nulls first limit 5;
+----
+NULL
+NULL
+2.000
+3.000
+4.000
+
+query R nosort
 select cdl from obn order by cdl nulls last;
 ----
 2.000
@@ -405,6 +557,14 @@ NULL
 NULL
 
 query R nosort
+select cdl from obn order by cdl nulls last offset 3;
+----
+9.000
+12.000
+NULL
+NULL
+
+query R nosort
 select cdl from obn order by cdl desc;
 ----
 12.000
@@ -427,6 +587,31 @@ NULL
 NULL
 
 query R nosort
+select cdl from obn order by cdl desc nulls last limit 6;
+----
+12.000
+9.000
+4.000
+3.000
+2.000
+NULL
+
+query R nosort
+select cdl from obn order by cdl desc nulls last limit 3 offset 3;
+----
+3.000
+2.000
+NULL
+
+query R nosort
+select cdl from obn order by cdl desc nulls last offset 3;
+----
+3.000
+2.000
+NULL
+NULL
+
+query R nosort
 select cdl from obn order by cdl desc nulls first;
 ----
 NULL
@@ -437,6 +622,24 @@ 4.000
 3.000
 2.000
 
+query R nosort
+select cdl from obn order by cdl desc nulls first limit 5;
+----
+NULL
+NULL
+12.000
+9.000
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to