mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
Revert "Add integration tests for create_table_empty_primary_key_by_default"
This reverts commit 754cfdc68c
.
This commit is contained in:
parent
754cfdc68c
commit
eb959a1e08
@ -1,64 +0,0 @@
|
|||||||
import pytest
|
|
||||||
from helpers.client import QueryRuntimeException
|
|
||||||
from helpers.cluster import ClickHouseCluster
|
|
||||||
|
|
||||||
cluster = ClickHouseCluster(__file__)
|
|
||||||
node = cluster.add_instance("node", stay_alive=True)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module", autouse=True)
|
|
||||||
def start_cluster():
|
|
||||||
try:
|
|
||||||
cluster.start()
|
|
||||||
yield cluster
|
|
||||||
finally:
|
|
||||||
cluster.shutdown()
|
|
||||||
|
|
||||||
|
|
||||||
def test_create_table_without_order_by():
|
|
||||||
with pytest.raises(QueryRuntimeException):
|
|
||||||
node.query("CREATE DATABASE IF NOT EXISTS test;")
|
|
||||||
node.query("DROP TABLE IF EXISTS test.test_empty_order_by;")
|
|
||||||
node.query(
|
|
||||||
"""
|
|
||||||
CREATE TABLE test.test_empty_order_by
|
|
||||||
(
|
|
||||||
`a` UInt8,
|
|
||||||
)
|
|
||||||
ENGINE = MergeTree()
|
|
||||||
SETTINGS index_granularity = 8192;
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_create_table_without_order_by_and_setting_enabled():
|
|
||||||
node.query("CREATE DATABASE IF NOT EXISTS test;")
|
|
||||||
node.query("DROP TABLE IF EXISTS test.test_empty_order_by;")
|
|
||||||
node.query("SET create_table_empty_primary_key_by_default = true;")
|
|
||||||
node.query(
|
|
||||||
"""
|
|
||||||
CREATE TABLE test.test_empty_order_by
|
|
||||||
(
|
|
||||||
`a` UInt8,
|
|
||||||
)
|
|
||||||
ENGINE = MergeTree()
|
|
||||||
SETTINGS index_granularity = 8192;
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
assert "ORDER BY tuple()" in node.query(f"SHOW CREATE TABLE test.test_empty_order_by;")
|
|
||||||
|
|
||||||
def test_create_table_without_order_by_and_setting_enabled_columwise_primary_key():
|
|
||||||
node.query("CREATE DATABASE IF NOT EXISTS test;")
|
|
||||||
node.query("DROP TABLE IF EXISTS test.test_empty_order_by;")
|
|
||||||
node.query("SET create_table_empty_primary_key_by_default = true;")
|
|
||||||
node.query(
|
|
||||||
"""
|
|
||||||
CREATE TABLE test.test_empty_order_by
|
|
||||||
(
|
|
||||||
`a` UInt8 PRIMARY KEY,
|
|
||||||
`b` String PRIMARY KEY
|
|
||||||
)
|
|
||||||
ENGINE = MergeTree()
|
|
||||||
SETTINGS index_granularity = 8192;
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
assert "ORDER BY (a, b)" in node.query(f"SHOW CREATE TABLE test.test_empty_order_by")
|
|
Loading…
Reference in New Issue
Block a user