Changeset: 6d318dd4a719 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d318dd4a719
Modified Files:
        sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.sql
        
sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out
Branch: Aug2018
Log Message:

The test originally queried all rows of sys.columns which gives different 
outputs on different platforms.
Adapted the query such that it only uses the sys.columns rows of tmp tables, 
which is stable across platforms.
This reduces the need for muliple output files (.Windows, .int128) and future 
maintenance when system tables are added/changed.


diffs (85 lines):

diff --git 
a/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.sql 
b/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.sql
--- a/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.sql
+++ b/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.sql
@@ -1,3 +1,9 @@
-SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 ORDER 
BY COUNT(id) DESC;
-SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 ORDER 
BY 2 DESC;
-SELECT type,COUNT(id) as cnt FROM sys.columns GROUP BY type HAVING 
COUNT(id)>10 ORDER BY cnt DESC;
+CREATE TABLE cols_6624 as
+ SELECT id, type FROM sys.columns WHERE table_id IN (SELECT id FROM sys.tables 
WHERE schema_id IN (SELECT id FROM sys.schemas WHERE name = 'tmp')) WITH DATA;
+
+SELECT type,COUNT(id) FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 ORDER BY 
COUNT(id) DESC;
+SELECT type,COUNT(id) FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 ORDER BY 
2 DESC;
+SELECT type,COUNT(id) as cnt FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 
ORDER BY cnt DESC;
+
+DROP TABLE cols_6624;
+
diff --git 
a/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out
 
b/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out
@@ -24,42 +24,33 @@ Ready.
 # 18:32:54 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-8372" "--port=30905"
 # 18:32:54 >  
 
-#SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 
ORDER BY COUNT(id) DESC;
-% .columns,    .L16 # table_name
-% type,        L16 # name
+#CREATE TABLE cols_6624 as
+# SELECT id, type FROM sys.columns WHERE table_id IN (SELECT id FROM 
sys.tables WHERE schema_id IN (SELECT id FROM sys.schemas WHERE name = 'tmp')) 
WITH DATA;
+#SELECT type,COUNT(id) FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 ORDER 
BY COUNT(id) DESC;
+% sys.cols_6624,       sys.L3 # table_name
+% type,        L3 # name
 % varchar,     bigint # type
-% 9,   3 # length
-[ "int",       223     ]
-[ "varchar",   142     ]
-[ "clob",      68      ]
-[ "smallint",  55      ]
-[ "bigint",    53      ]
-[ "boolean",   25      ]
-[ "timestamp", 12      ]
-#SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 
ORDER BY 2 DESC;
-% .columns,    .L16 # table_name
-% type,        L16 # name
+% 8,   2 # length
+[ "int",       19      ]
+[ "varchar",   14      ]
+[ "smallint",  6       ]
+#SELECT type,COUNT(id) FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 ORDER 
BY 2 DESC;
+% sys.cols_6624,       sys.L3 # table_name
+% type,        L3 # name
 % varchar,     bigint # type
-% 9,   3 # length
-[ "int",       223     ]
-[ "varchar",   142     ]
-[ "clob",      68      ]
-[ "smallint",  55      ]
-[ "bigint",    53      ]
-[ "boolean",   25      ]
-[ "timestamp", 12      ]
-#SELECT type,COUNT(id) as cnt FROM sys.columns GROUP BY type HAVING 
COUNT(id)>10 ORDER BY cnt DESC;
-% .columns,    .L17 # table_name
+% 8,   2 # length
+[ "int",       19      ]
+[ "varchar",   14      ]
+[ "smallint",  6       ]
+#SELECT type,COUNT(id) as cnt FROM cols_6624 GROUP BY type HAVING COUNT(id)>5 
ORDER BY cnt DESC;
+% sys.cols_6624,       sys.L4 # table_name
 % type,        cnt # name
 % varchar,     bigint # type
-% 9,   3 # length
-[ "int",       223     ]
-[ "varchar",   142     ]
-[ "clob",      68      ]
-[ "smallint",  55      ]
-[ "bigint",    53      ]
-[ "boolean",   25      ]
-[ "timestamp", 12      ]
+% 8,   2 # length
+[ "int",       19      ]
+[ "varchar",   14      ]
+[ "smallint",  6       ]
+#DROP TABLE cols_6624;
 
 # 18:32:54 >  
 # 18:32:54 >  "Done."
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to