diff --git a/dbms/tests/queries/0_stateless/00612_count.reference b/dbms/tests/queries/0_stateless/00612_count.reference new file mode 100644 index 00000000000..2e519138d9f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00612_count.reference @@ -0,0 +1,14 @@ +1234567 +2469134 +2469134 +1234567 + +1234567 +1234567 +1234567 +1234567 +1234567 +1234567 +1234567 +1234568 +1234567 diff --git a/dbms/tests/queries/0_stateless/00612_count.sql b/dbms/tests/queries/0_stateless/00612_count.sql new file mode 100644 index 00000000000..e701fa1cc73 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00612_count.sql @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS test.count; + +CREATE TABLE test.count (x UInt64) ENGINE = MergeTree ORDER BY tuple(); +INSERT INTO test.count SELECT * FROM numbers(1234567); + +SELECT count() FROM test.count; +SELECT count() * 2 FROM test.count; +SELECT count() FROM (SELECT * FROM test.count UNION ALL SELECT * FROM test.count); +SELECT count() FROM test.count WITH TOTALS; +SELECT arrayJoin([count(), count()]) FROM test.count; +SELECT arrayJoin([count(), count()]) FROM test.count LIMIT 1; +SELECT arrayJoin([count(), count()]) FROM test.count LIMIT 1, 1; +SELECT arrayJoin([count(), count()]) AS x FROM test.count LIMIT 1 BY x; +SELECT arrayJoin([count(), count() + 1]) AS x FROM test.count LIMIT 1 BY x; +SELECT count() FROM test.count HAVING count() = 1234567; +SELECT count() FROM test.count HAVING count() != 1234567; + +DROP TABLE test.count; diff --git a/dbms/tests/queries/0_stateless/00612_shard_count.reference b/dbms/tests/queries/0_stateless/00612_shard_count.reference new file mode 100644 index 00000000000..094f191d24b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00612_shard_count.reference @@ -0,0 +1,2 @@ +2469134 +1234567 diff --git a/dbms/tests/queries/0_stateless/00612_shard_count.sql b/dbms/tests/queries/0_stateless/00612_shard_count.sql new file mode 100644 index 00000000000..b59ba029351 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00612_shard_count.sql @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS test.count; + +CREATE TABLE test.count (x UInt64) ENGINE = MergeTree ORDER BY tuple(); +INSERT INTO test.count SELECT * FROM numbers(1234567); + +SELECT count() FROM remote('127.0.0.{1,2}', test.count); +SELECT count() / 2 FROM remote('127.0.0.{1,2}', test.count); + +DROP TABLE test.count;