Changeset: 629b709a8ae1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=629b709a8ae1 Modified Files: monetdb5/modules/kernel/batstr.c sql/test/SQLancer/Tests/sqlancer02.sql sql/test/SQLancer/Tests/sqlancer02.stable.out Branch: clean-candidates Log Message:
Don't propagate sorted properties where they shouldn't. It's still on the TODO list diffs (173 lines): diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c --- a/monetdb5/modules/kernel/batstr.c +++ b/monetdb5/modules/kernel/batstr.c @@ -2937,10 +2937,6 @@ STRbatSubstitutecst_imp(Client cntxt, Ma bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(2, b, bs); return msg; } @@ -3143,10 +3139,6 @@ STRbatsplitpartcst(Client cntxt, MalBlkP bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(2, b, bs); return msg; } @@ -3242,10 +3234,6 @@ STRbatsplitpart_needlecst(Client cntxt, bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(4, b, bs, f, fs); return msg; } @@ -3341,10 +3329,6 @@ STRbatsplitpart_fieldcst(Client cntxt, M bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(4, b, bs, n, ns); return msg; } @@ -3749,10 +3733,6 @@ STRbatInsertcst(Client cntxt, MalBlkPtr bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(2, b, bs); return msg; } @@ -3929,10 +3909,6 @@ STRbatsubstring_1st_2nd_cst(Client cntxt bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(2, b, bs); return msg; } @@ -4017,10 +3993,6 @@ STRbatsubstring_1st_3rd_cst(Client cntxt bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(2, b, bs); return msg; } @@ -4115,10 +4087,6 @@ STRbatsubstring_1st_cst(Client cntxt, Ma bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(4, b, bs, lb, lbs); return msg; } @@ -4214,10 +4182,6 @@ STRbatsubstring_2nd_cst(Client cntxt, Ma bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(4, b, bs, lb, lbs); return msg; } @@ -4313,10 +4277,6 @@ STRbatsubstring_3rd_cst(Client cntxt, Ma bailout: GDKfree(buf); finalize_ouput(res, bn, msg, nils, q); - if (bn && b && !msg) { - bn->tsorted = b->tsorted; - bn->trevsorted = b->trevsorted; - } unfix_inputs(4, b, bs, lb, lbs); return msg; } diff --git a/sql/test/SQLancer/Tests/sqlancer02.sql b/sql/test/SQLancer/Tests/sqlancer02.sql --- a/sql/test/SQLancer/Tests/sqlancer02.sql +++ b/sql/test/SQLancer/Tests/sqlancer02.sql @@ -243,3 +243,19 @@ SELECT CASE 1 WHEN 1 THEN 'rr' WHEN ln(- -- rr SELECT CASE 1 WHEN 3 THEN 'rr' WHEN ln(-2) THEN 'a' END FROM (values (1),(2)) as t0(c0); -- error, ln -2 cannot be computed + +START TRANSACTION; +CREATE TABLE "sys"."t0" ("tc0" TIMESTAMP NOT NULL,CONSTRAINT "t0_tc0_pkey" PRIMARY KEY ("tc0"),CONSTRAINT "t0_tc0_unique" UNIQUE ("tc0")); +COPY 4 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +"1970-01-07 15:47:59.000000" +"1970-01-01 01:00:00.000000" +"1970-01-15 16:36:07.000000" +"1970-01-01 13:45:44.000000" + +CREATE TABLE "sys"."t2" ("tc2" BOOLEAN NOT NULL,CONSTRAINT "t2_tc2_pkey" PRIMARY KEY ("tc2"),CONSTRAINT "t2_tc2_unique" UNIQUE ("tc2")); +COPY 2 RECORDS INTO "sys"."t2" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +false +true + +SELECT substr(ltrim('1Yc',''), CAST(t2.tc2 AS INT), "second"(CAST(t0.tc0 AS TIMESTAMP))) FROM t2, t0; +ROLLBACK; diff --git a/sql/test/SQLancer/Tests/sqlancer02.stable.out b/sql/test/SQLancer/Tests/sqlancer02.stable.out --- a/sql/test/SQLancer/Tests/sqlancer02.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer02.stable.out @@ -343,6 +343,33 @@ stdout of test 'sqlancer02` in directory % 2 # length [ "rr" ] [ "rr" ] +#START TRANSACTION; +#CREATE TABLE "sys"."t0" ("tc0" TIMESTAMP NOT NULL,CONSTRAINT "t0_tc0_pkey" PRIMARY KEY ("tc0"),CONSTRAINT "t0_tc0_unique" UNIQUE ("tc0")); +#COPY 4 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#"1970-01-07 15:47:59.000000" +#"1970-01-01 01:00:00.000000" +#"1970-01-15 16:36:07.000000" +#"1970-01-01 13:45:44.000000" +[ 4 ] +#CREATE TABLE "sys"."t2" ("tc2" BOOLEAN NOT NULL,CONSTRAINT "t2_tc2_pkey" PRIMARY KEY ("tc2"),CONSTRAINT "t2_tc2_unique" UNIQUE ("tc2")); +#COPY 2 RECORDS INTO "sys"."t2" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#false +#true +[ 2 ] +#SELECT substr(ltrim('1Yc',''), CAST(t2.tc2 AS INT), "second"(CAST(t0.tc0 AS TIMESTAMP))) FROM t2, t0; +% .%2 # table_name +% %2 # name +% clob # type +% 3 # length +[ "1Yc" ] +[ "" ] +[ "1Yc" ] +[ "1Yc" ] +[ "1Yc" ] +[ "" ] +[ "1Yc" ] +[ "1Yc" ] +#ROLLBACK; # 17:04:12 > # 17:04:12 > "Done." _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list