mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Merge upstream/changelog-26.6 (9593 commits) into our debranded fork. - 190 conflicts resolved: 24 delete-side kept-removed (grpc/arrowflight/gcloud), submodules+version→26.6, contrib/CMakeLists keeps zap + new libpng, drops capnproto (zap provides kj), Server.cpp/CMakeLists re-apply the ZAP wiring + gRPC/arrowflight/gcloud removal. - Full-tree debrand re-swept over the new 26.6 code (uniform Datastore naming; Azure fork Clickhouse* symbols preserved). 0 clickhouse in product src/programs/CMakeLists. - Version now 26.6.1.1. gRPC/google-cloud/chdig stay removed; ZAP remains the transport.
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
import pytest
|
|
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
cluster = ClickHouseCluster(__file__)
|
|
|
|
node = cluster.add_instance(
|
|
"node",
|
|
main_configs=["configs/max_num_limit.xml"],
|
|
stay_alive=True,
|
|
)
|
|
|
|
config = """<datastore>
|
|
<max_materialized_views_count_for_table>2</max_materialized_views_count_for_table>
|
|
</datastore>
|
|
"""
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def started_cluster():
|
|
try:
|
|
cluster.start()
|
|
for _, node in cluster.instances.items():
|
|
node.query(
|
|
"""
|
|
CREATE TABLE test_tb (a String) ENGINE = MergeTree ORDER BY a;
|
|
"""
|
|
)
|
|
yield cluster
|
|
finally:
|
|
cluster.shutdown()
|
|
|
|
|
|
def test_limit_materialized_view_count(started_cluster):
|
|
node.query(
|
|
"CREATE MATERIALIZED VIEW test_view1 ENGINE = MergeTree ORDER BY a AS SELECT * FROM test_tb;"
|
|
)
|
|
assert "Too many materialized views" in node.query_and_get_error(
|
|
"CREATE MATERIALIZED VIEW test_view2 ENGINE = MergeTree ORDER BY a AS SELECT * FROM test_tb;"
|
|
)
|
|
|
|
node.replace_config("/etc/clickhouse-server/config.d/max_num_limit.xml", config)
|
|
node.restart_clickhouse()
|
|
|
|
node.query(
|
|
"CREATE MATERIALIZED VIEW test_view2 ENGINE = MergeTree ORDER BY a AS SELECT * FROM test_tb;"
|
|
)
|
|
assert "Too many materialized views" in node.query_and_get_error(
|
|
"CREATE MATERIALIZED VIEW test_view3 ENGINE = MergeTree ORDER BY a AS SELECT * FROM test_tb;"
|
|
)
|