Changeset: b4191c510cf2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4191c510cf2 Modified Files: sql/backends/monet5/sql_round_impl.h sql/test/SQLancer/Tests/sqlancer01.stable.err sql/test/SQLancer/Tests/sqlancer01.stable.out Branch: Jun2020 Log Message:
Fix for SQLancer query by disabling non positive values for the precision number diffs (87 lines): diff --git a/sql/backends/monet5/sql_round_impl.h b/sql/backends/monet5/sql_round_impl.h --- a/sql/backends/monet5/sql_round_impl.h +++ b/sql/backends/monet5/sql_round_impl.h @@ -52,6 +52,8 @@ dec_round_wrap(TYPE *res, const TYPE *v, /* basic sanity checks */ assert(res && v && r); + if (*r <= 0) + throw(MAL, "round", SQLSTATE(42000) "Argument 2 to round function must be positive"); *res = dec_round_body(*v, *r); return MAL_SUCCEED; } @@ -67,6 +69,8 @@ bat_dec_round_wrap(bat *_res, const bat /* basic sanity checks */ assert(_res && _v && r); + if (*r <= 0) + throw(MAL, "round", SQLSTATE(42000) "Argument 2 to round function must be positive"); /* get argument BAT descriptor */ if ((v = BATdescriptor(*_v)) == NULL) throw(MAL, "round", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.err b/sql/test/SQLancer/Tests/sqlancer01.stable.err --- a/sql/test/SQLancer/Tests/sqlancer01.stable.err +++ b/sql/test/SQLancer/Tests/sqlancer01.stable.err @@ -9,6 +9,16 @@ MAPI = (monetdb) /var/tmp/mtest-328612/ QUERY = ALTER TABLE t0 ALTER c0 SET DEFAULT (0.1) IS NULL; ERROR = !incorrect default value 'SQL feature not yet available for expressions and default values: IS_NULL' CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-337778/.s.monetdb.34155 +QUERY = select max(agg0) from (select max(all cast(0.18525435 as string)) as agg0 from t0 where cast(scale_down(- (greatest(greatest(631218936, -562663513), cast(-265902058 as int))), cast(0.41370374 as int)) as boolean) + union all select all max(all cast(0.18525435 as string)) as agg0 from t0 where not (cast(scale_down(- (greatest(greatest(631218936, -562663513), cast(-265902058 as int))), cast(0.41370374 as int)) as boolean)) + union all select all max(all cast(0.18525435 as string)) as agg0 from t0 where (cast(scale_down(- (greatest(greatest(631218936, -562663513), cast(-265902058 as int))), cast(0.41370374 as int)) as boolean)) is null) as asdf; +ERROR = !Argument 2 to round function must be positive +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-337778/.s.monetdb.34155 +QUERY = select scale_down(-631218936, cast(0.41370374 as int)); --simplified +ERROR = !Current transaction is aborted (please ROLLBACK) +CODE = 25005 # 11:08:12 > # 11:08:12 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-117725" "--port=30085" diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out b/sql/test/SQLancer/Tests/sqlancer01.stable.out --- a/sql/test/SQLancer/Tests/sqlancer01.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out @@ -392,6 +392,42 @@ stdout of test 'sqlancer01` in directory % 1 # length [ 0 ] #ROLLBACK; +#START TRANSACTION; +#CREATE TABLE t0 (c0 boolean); +#ROLLBACK; +#START TRANSACTION; --Bug 6900 +#CREATE TABLE "sys"."t0" ( +# "c0" DOUBLE +#); +#COPY 29 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#0.17813417838107104 +#0.9549819803006688 +#0.9780564272521242 +#0.10974679657112596 +#0.14469007311670268 +#0.40657910792795704 +#767899608 +#1305867053 +#50 +#0.4710730955889548 +#0.052675133884161784 +#0.196080224553812 +#0.7984139684271494 +#-160886149 +#0.55847644848666 +#0.2139700012938821 +#0.6006984400193495 +#0.14469007311670268 +#0.8294571584056999 +#0.857353880253944 +#0.13593948125817867 +#0.39845038529139776 +#1589184525 +#0.549119773445742 +#1039732501 +#0.17914678733737166 +[ 29 ] +#ROLLBACK; #DROP TABLE tbl_ProductSales; #DROP TABLE another_T; #DROP TABLE integers; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list