2022-06-07 06:18:54 +00:00
|
|
|
# pylint: disable=line-too-long
|
|
|
|
# pylint: disable=unused-argument
|
|
|
|
# pylint: disable=redefined-outer-name
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2024-02-26 15:00:40 +00:00
|
|
|
from helpers.cluster import ClickHouseCluster, CLICKHOUSE_CI_MIN_TESTED_VERSION
|
2022-06-07 06:18:54 +00:00
|
|
|
|
2022-07-18 12:25:14 +00:00
|
|
|
cluster = ClickHouseCluster(__file__)
|
2023-07-20 15:05:07 +00:00
|
|
|
upstream_node = cluster.add_instance("upstream_node", allow_analyzer=False)
|
2022-06-07 06:18:54 +00:00
|
|
|
old_node = cluster.add_instance(
|
|
|
|
"old_node",
|
|
|
|
image="clickhouse/clickhouse-server",
|
2024-02-26 12:45:20 +00:00
|
|
|
tag=CLICKHOUSE_CI_MIN_TESTED_VERSION,
|
2022-06-07 06:18:54 +00:00
|
|
|
with_installed_binary=True,
|
2023-07-20 15:05:07 +00:00
|
|
|
allow_analyzer=False,
|
2022-06-07 06:18:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
|
|
def start_cluster():
|
|
|
|
try:
|
|
|
|
cluster.start()
|
|
|
|
yield cluster
|
|
|
|
|
|
|
|
finally:
|
|
|
|
cluster.shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
def test_old_client_compatible(start_cluster):
|
|
|
|
old_node.query("INSERT INTO FUNCTION null('foo String') VALUES ('foo')('bar')")
|
|
|
|
old_node.query(
|
|
|
|
"INSERT INTO FUNCTION null('foo String') VALUES ('foo')('bar')",
|
|
|
|
host=upstream_node.ip_address,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_new_client_compatible(start_cluster):
|
|
|
|
upstream_node.query(
|
|
|
|
"INSERT INTO FUNCTION null('foo String') VALUES ('foo')('bar')",
|
|
|
|
host=old_node.ip_address,
|
|
|
|
)
|
|
|
|
upstream_node.query("INSERT INTO FUNCTION null('foo String') VALUES ('foo')('bar')")
|