Changeset: 83ec09dc7d45 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/83ec09dc7d45
Added Files:
        sql/test/BugTracker-2024/Tests/7556-missing-ignore-case.test
Modified Files:
        monetdb5/modules/atoms/str.c
        sql/test/BugTracker-2024/Tests/All
Branch: Aug2024
Log Message:

added test for bug #7556
fixed #7556, don't assert but give errors.


diffs (46 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -2875,7 +2875,14 @@ ignorecase(const bat *ic_id, bool *icase
        if ((c = BATdescriptor(*ic_id)) == NULL)
                throw(MAL, fname, SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
 
-       assert(BATcount(c) >= 1);
+       if (BATcount(c) != 1) {
+               BUN cnt = BATcount(c);
+               BBPreclaim(c);
+               if (cnt == 0)
+                       throw(MAL, fname, SQLSTATE(42000) "Missing ignore case 
value\n");
+               else
+                       throw(MAL, fname, SQLSTATE(42000) "Multiple ignore case 
values passed, only one expected\n");
+       }
 
        BATiter bi = bat_iterator(c);
        *icase = *(bit *) BUNtloc(bi, 0);
diff --git a/sql/test/BugTracker-2024/Tests/7556-missing-ignore-case.test 
b/sql/test/BugTracker-2024/Tests/7556-missing-ignore-case.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7556-missing-ignore-case.test
@@ -0,0 +1,14 @@
+statement ok
+CREATE TABLE  t0 ( c1 INTEGER  )
+
+statement ok
+CREATE VIEW v0(c0) AS SELECT NOT('a') FROM t0 ORDER BY (1)
+
+statement error
+SELECT v0.c0 FROM v0, t0 WHERE (STARTSWITH(t0.c1, v0.c0, v0.c0))
+
+statement ok
+DROP VIEW v0
+
+statement ok
+DROP TABLE t0
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -80,3 +80,4 @@ 7553-join-on-startswith-crash
 7045-do-not-push-down-converts
 7554-incorrect-result-between
 7555-incorrect-semijoin-rewrite
+7556-missing-ignore-case
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to