Skip to content

Commit

Permalink
Revert "Add SHOW [FULL] COLUMNS tests via MySQL client"
Browse files Browse the repository at this point in the history
This reverts commit b9b2b11.
  • Loading branch information
rschu1ze committed Nov 3, 2023
1 parent 7254b4b commit 614a679
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 249 deletions.
61 changes: 0 additions & 61 deletions tests/integration/test_mysql_protocol/show_columns.reference

This file was deleted.

62 changes: 0 additions & 62 deletions tests/integration/test_mysql_protocol/show_columns_test.sql

This file was deleted.

61 changes: 0 additions & 61 deletions tests/integration/test_mysql_protocol/show_full_columns.reference

This file was deleted.

79 changes: 14 additions & 65 deletions tests/integration/test_mysql_protocol/test.py
Expand Up @@ -610,50 +610,6 @@ def test_mysql_boolean_format(started_cluster):
assert stdout.decode() == "a\tb\tc\n" + "0\t1\t0\n" + "1\t0\t1\n"


def test_mysql_show_columns_types(started_cluster):
create_test_tables("show_columns_test.sql")
code, (stdout, stderr) = started_cluster.mysql_client_container.exec_run(
"""
mysql --protocol tcp -h {host} -P {port} default -u user_with_double_sha1 --password=abacaba
-e "SHOW COLUMNS FROM mysql_show_columns_test;"
""".format(
host=started_cluster.get_instance_ip("node"), port=server_port
),
demux=True,
)
logging.debug(
f"test_mysql_show_columns_types code:{code} stdout:{stdout}, stderr:{stderr}"
)

with open(os.path.join(SCRIPT_DIR, "show_columns.reference")) as fp:
reference = fp.read()

assert stdout.decode().replace("\t\n", "\n") == reference
assert code == 0


def test_mysql_show_full_columns_types(started_cluster):
create_test_tables("show_columns_test.sql")
code, (stdout, stderr) = started_cluster.mysql_client_container.exec_run(
"""
mysql --protocol tcp -h {host} -P {port} default -u user_with_double_sha1 --password=abacaba
-e "SHOW FULL COLUMNS FROM mysql_show_columns_test;"
""".format(
host=started_cluster.get_instance_ip("node"), port=server_port
),
demux=True,
)
logging.debug(
f"test_mysql_show_full_columns_types code:{code} stdout:{stdout}, stderr:{stderr}"
)

with open(os.path.join(SCRIPT_DIR, "show_full_columns.reference")) as fp:
reference = fp.read()

assert stdout.decode().replace("\t\t\n", "\n") == reference
assert code == 0


def test_python_client(started_cluster):
client = pymysql.connections.Connection(
host=started_cluster.get_instance_ip("node"),
Expand Down Expand Up @@ -926,22 +882,7 @@ def test_types(started_cluster):


def setup_java_client(started_cluster, binary: Literal["true", "false"]):
create_test_tables("java_client_test.sql")
return (
"java MySQLJavaClientTest "
"--host {host} "
"--port {port} "
"--user user_with_double_sha1 "
"--password abacaba "
"--database default "
"--binary {binary}"
).format(
host=started_cluster.get_instance_ip("node"), port=server_port, binary=binary
)


def create_test_tables(filename):
with open(os.path.join(SCRIPT_DIR, filename)) as sql:
with open(os.path.join(SCRIPT_DIR, "java_client_test.sql")) as sql:
statements = list(
filter(
lambda s: s != "",
Expand All @@ -952,9 +893,17 @@ def create_test_tables(filename):
for statement in statements:
node.query(
statement,
settings={
"password": "123",
"allow_suspicious_low_cardinality_types": 1,
"allow_experimental_object_type": 1,
},
settings={"password": "123", "allow_suspicious_low_cardinality_types": 1},
)

return (
"java MySQLJavaClientTest "
"--host {host} "
"--port {port} "
"--user user_with_double_sha1 "
"--password abacaba "
"--database default "
"--binary {binary}"
).format(
host=started_cluster.get_instance_ip("node"), port=server_port, binary=binary
)

0 comments on commit 614a679

Please sign in to comment.