Changeset: dcd983f52b9f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/dcd983f52b9f Added Files: sql/test/miscellaneous/Tests/rel_push_count_down.py sql/test/miscellaneous/Tests/rel_push_count_down.sql sql/test/miscellaneous/Tests/rel_push_count_down.stable.err sql/test/miscellaneous/Tests/rel_push_count_down.stable.out sql/test/miscellaneous/Tests/rel_push_count_down.stable.out.int128 Modified Files: sql/test/BugTracker-2017/Tests/All sql/test/miscellaneous/Tests/All sql/test/miscellaneous/Tests/simple_plans.test Branch: default Log Message:
Approve optimizer changes diffs (116 lines): diff --git a/sql/test/BugTracker-2017/Tests/All b/sql/test/BugTracker-2017/Tests/All --- a/sql/test/BugTracker-2017/Tests/All +++ b/sql/test/BugTracker-2017/Tests/All @@ -80,7 +80,7 @@ exists.Bug-6392 case.Bug-6386 sqllitelogistest_case.Bug-6335 udf_crash_subquery_scalar_paramters.Bug-6399 -side-effect.Bug-6397 +HAVE_HGE?side-effect.Bug-6397 copy_into_crash.Bug-6404 null_matches_in_outer.Bug-6398 corr_coersion.Bug-6287 diff --git a/sql/test/miscellaneous/Tests/All b/sql/test/miscellaneous/Tests/All --- a/sql/test/miscellaneous/Tests/All +++ b/sql/test/miscellaneous/Tests/All @@ -19,3 +19,4 @@ create_func_temp simple_plans vessels prepare +rel_push_count_down diff --git a/sql/test/miscellaneous/Tests/rel_push_count_down.py b/sql/test/miscellaneous/Tests/rel_push_count_down.py new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/rel_push_count_down.py @@ -0,0 +1,20 @@ +from MonetDBtesting.sqltest import SQLTestCase +import pymonetdb, os + +conn1 = pymonetdb.connect(database=os.getenv("TSTDB"), port=int(os.getenv("MAPIPORT")), autocommit=True) +cur1 = conn1.cursor() +try: + cur1.execute('select cast(1 as hugeint)') + suffix = '.int128' +except pymonetdb.DatabaseError as e: + suffix = '' +cur1.close() +conn1.close() + +with SQLTestCase() as tc: + # optional or default connection + tc.connect() + with open('rel_push_count_down.sql') as f: + tc.execute(query=None, client='mclient', stdin=f)\ + .assertMatchStableOut(fout='rel_push_count_down.stable.out%s' % (suffix))\ + .assertMatchStableError(ferr='rel_push_count_down.stable.err') diff --git a/sql/test/miscellaneous/Tests/rel_push_count_down.sql b/sql/test/miscellaneous/Tests/rel_push_count_down.sql new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/rel_push_count_down.sql @@ -0,0 +1,5 @@ +START TRANSACTION; +CREATE TABLE another_T (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 INT, col7 INT, col8 INT); +INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), (111,222,333,444,555,666,777,888), (1111,2222,3333,4444,5555,6666,7777,8888); +plan select count(*) from another_t t1, another_t t2; +ROLLBACK; diff --git a/sql/test/miscellaneous/Tests/rel_push_count_down.stable.err b/sql/test/miscellaneous/Tests/rel_push_count_down.stable.err new file mode 100644 diff --git a/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out b/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out @@ -0,0 +1,13 @@ +[ 4 ] +% .plan # table_name +% rel # name +% clob # type +% 106 # length +project ( +| project ( +| | crossproduct ( +| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%2"."%2" ], +| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%3"."%3" ] +| | ) [ ] +| ) [ "sys"."sql_mul"("%2"."%2" NOT NULL, "%3"."%3" NOT NULL) NOT NULL as "%1"."%1" ] +) [ "%1"."%1" NOT NULL ] diff --git a/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out.int128 b/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out.int128 new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/rel_push_count_down.stable.out.int128 @@ -0,0 +1,13 @@ +[ 4 ] +% .plan # table_name +% rel # name +% clob # type +% 106 # length +project ( +| project ( +| | crossproduct ( +| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%2"."%2" ], +| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%3"."%3" ] +| | ) [ ] +| ) [ bigint(64)["sys"."sql_mul"("%2"."%2" NOT NULL, "%3"."%3" NOT NULL) NOT NULL] NOT NULL as "%1"."%1" ] +) [ "%1"."%1" NOT NULL ] diff --git a/sql/test/miscellaneous/Tests/simple_plans.test b/sql/test/miscellaneous/Tests/simple_plans.test --- a/sql/test/miscellaneous/Tests/simple_plans.test +++ b/sql/test/miscellaneous/Tests/simple_plans.test @@ -467,19 +467,6 @@ project ( | table("sys"."another_t") [ "another_t"."col1" ] ) [ "sys"."sql_mul"("another_t"."col1", "sys"."sql_mul"(tinyint(6) "34", tinyint(2) "3") NOT NULL) ] -# testing rel_push_count_down optimizer -query T nosort -plan select count(*) from another_t t1, another_t t2 ----- -project ( -| project ( -| | crossproduct ( -| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%2"."%2" ], -| | | [ "sys"."cnt"(clob "sys", clob "another_t") NOT NULL as "%3"."%3" ] -| | ) [ ] -| ) [ bigint(64)["sys"."sql_mul"("%2"."%2" NOT NULL, "%3"."%3" NOT NULL) NOT NULL] NOT NULL as "%1"."%1" ] -) [ "%1"."%1" NOT NULL ] - statement ok create table t1 (a int, b string) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list