Changeset: 6848edc4db8d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6848edc4db8d
Modified Files:
        monetdb5/modules/atoms/str.c
        sql/test/SQLancer/Tests/sqlancer01.sql
Branch: Jun2020
Log Message:

SQLancer query with algebra.select undefined error.

Also throw a better error message at str.insert function if the number of 
characters is negative.


diffs (33 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
@@ -4133,7 +4133,7 @@ STRinsert(str *ret, const str *s, const 
                if (l1 + l2 + 1 >= INT_MAX)
                        throw(MAL, "str.insert", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                if (*l < 0)
-                       throw(MAL, "str.insert", SQLSTATE(42000) 
ILLEGAL_ARGUMENT);
+                       throw(MAL, "str.insert", SQLSTATE(42000) "The number of 
characters for insert function must be non negative");
                if (strt < 0) {
                        if ((size_t) -strt <= l1)
                                strt = (int) (l1 + strt);
diff --git a/sql/test/SQLancer/Tests/sqlancer01.sql 
b/sql/test/SQLancer/Tests/sqlancer01.sql
--- a/sql/test/SQLancer/Tests/sqlancer01.sql
+++ b/sql/test/SQLancer/Tests/sqlancer01.sql
@@ -83,6 +83,17 @@ ROLLBACK;
 SELECT another_t.col1 FROM tbl_productsales CROSS JOIN another_t WHERE 
((tbl_productsales.product_category) NOT IN (tbl_productsales.product_category, 
tbl_productsales.product_category)) IS NULL;
        -- empty
 
+START TRANSACTION; --Bug 6896
+CREATE TABLE t0 (c0 int, c1 int);
+insert into t0 values (1, 1);
+select all t0.c0 from t0 where (sql_min("locate"(reverse('qﺛ}(C.0D?\r'), 
cast(t0.c1 as string), cast(-1483214882 as int)), ((cast('1186727519' as 
int))||(abs(785610124))))) not in (1.52414541E9, 0.13482326) 
+union all select all t0.c0 from t0 where not 
((sql_min("locate"(reverse('qﺛ}(C.0D?\r'), cast(t0.c1 as string), 
cast(-1483214882 as int)), ((cast('1186727519' as int))||(abs(785610124))))) 
not in (1.52414541E9, 0.13482326)) 
+union all select t0.c0 from t0 where 
((sql_min("locate"(reverse('qﺛ}(C.0D?\r'), cast(t0.c1 as string), 
cast(-1483214882 as int)), ((cast('1186727519' as int))||(abs(785610124))))) 
not in (1.52414541E9, 0.13482326)) is null;
+
+select 1 from t0 where (3 in (1, 2)) is null; --simplified
+       -- empty
+ROLLBACK;
+
 DROP TABLE tbl_ProductSales;
 DROP TABLE another_T;
 DROP TABLE integers;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to