From 056d794fe4292f59344b01788ca809f4b287781f Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 16 Oct 2020 13:56:04 +0300 Subject: [PATCH] One more test case --- .../01516_create_table_primary_key.reference | 2 ++ .../0_stateless/01516_create_table_primary_key.sql | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/01516_create_table_primary_key.reference b/tests/queries/0_stateless/01516_create_table_primary_key.reference index 07e39214354..eeef902be80 100644 --- a/tests/queries/0_stateless/01516_create_table_primary_key.reference +++ b/tests/queries/0_stateless/01516_create_table_primary_key.reference @@ -2,3 +2,5 @@ 1 1 1 1 1 +2 2 +7 14 diff --git a/tests/queries/0_stateless/01516_create_table_primary_key.sql b/tests/queries/0_stateless/01516_create_table_primary_key.sql index 0f7384ca1b3..7398957f998 100644 --- a/tests/queries/0_stateless/01516_create_table_primary_key.sql +++ b/tests/queries/0_stateless/01516_create_table_primary_key.sql @@ -40,4 +40,12 @@ CREATE TABLE primary_key_test(v1 Int32, v2 Int32, PRIMARY KEY(v1, v2), PRIMARY K CREATE TABLE primary_key_test(v1 Int32, v2 Int32, PRIMARY KEY(v1, v2)) ENGINE=ReplacingMergeTree ORDER BY (v1, v2) PRIMARY KEY(v1, v2); -- { clientError 36; } -DROP DATABASE test_01516; \ No newline at end of file +CREATE TABLE primary_key_test(v1 Int64, v2 Int32, v3 String, PRIMARY KEY(v1, gcd(v1, v2))) ENGINE=ReplacingMergeTree ORDER BY (v1, gcd(v1, v2)); + +INSERT INTO primary_key_test VALUES(7, 14, 'hello'), (2, 2, 'world'), (7, 14, 'duplicate'); + +SELECT v1, v2 FROM primary_key_test FINAL ORDER BY v1, v2; + +DROP TABLE primary_key_test; + +DROP DATABASE test_01516;