mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Merge pull request #68823 from yariks5s/remove_integration_test_datetime
Convert integration test `test_incorrect_datetime_format` to stateless
This commit is contained in:
commit
e7f403a27e
@ -1,11 +0,0 @@
|
||||
<clickhouse>
|
||||
<remote_servers>
|
||||
<test_cluster>
|
||||
<shard>
|
||||
<replica>
|
||||
<host>node</host>
|
||||
</replica>
|
||||
</shard>
|
||||
</test_cluster>
|
||||
</remote_servers>
|
||||
</clickhouse>
|
@ -1,9 +0,0 @@
|
||||
<clickhouse>
|
||||
<logger>
|
||||
<level>information</level>
|
||||
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
|
||||
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
|
||||
<size>1000M</size>
|
||||
<count>10</count>
|
||||
</logger>
|
||||
</clickhouse>
|
@ -1,54 +0,0 @@
|
||||
import logging
|
||||
import pytest
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def cluster():
|
||||
try:
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
cluster.add_instance(
|
||||
"node",
|
||||
main_configs=[
|
||||
"configs/config.d/cluster.xml",
|
||||
],
|
||||
)
|
||||
logging.info("Starting cluster...")
|
||||
cluster.start()
|
||||
logging.info("Cluster started")
|
||||
|
||||
node = cluster.instances["node"]
|
||||
node.query(
|
||||
"""
|
||||
CREATE TABLE tab
|
||||
(
|
||||
a DateTime,
|
||||
pk String
|
||||
) Engine = MergeTree() ORDER BY pk;
|
||||
"""
|
||||
)
|
||||
|
||||
yield cluster
|
||||
finally:
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_incorrect_datetime_format(cluster):
|
||||
"""
|
||||
Test for an MSan issue which is caused by parsing incorrect datetime string
|
||||
"""
|
||||
|
||||
node = cluster.instances["node"]
|
||||
|
||||
res = node.query("SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:09'").strip()
|
||||
assert res == "0"
|
||||
|
||||
error = node.query_and_get_error(
|
||||
"SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:0'"
|
||||
).strip()
|
||||
assert "Cannot parse time component of DateTime 09:58:0" in error
|
||||
|
||||
error = node.query_and_get_error(
|
||||
"SELECT count(*) FROM tab WHERE a = '2024-08-0 09:58:09'"
|
||||
).strip()
|
||||
assert "Cannot convert string '2024-08-0 09:58:09' to type DateTime" in error
|
@ -0,0 +1,3 @@
|
||||
0
|
||||
OK
|
||||
OK
|
20
tests/queries/0_stateless/03231_test_incorrect_datetime_msan.sh
Executable file
20
tests/queries/0_stateless/03231_test_incorrect_datetime_msan.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "
|
||||
CREATE TABLE tab
|
||||
(
|
||||
a DateTime,
|
||||
pk String
|
||||
) Engine = MergeTree() ORDER BY pk;
|
||||
"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:09'"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:0'" 2>&1 | grep -F -q "Cannot parse time component of DateTime 09:58:0" && echo "OK" || echo "FAIL";
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM tab WHERE a = '2024-08-0 09:58:09'" 2>&1 | grep -F -q "Cannot convert string '2024-08-0 09:58:09" && echo "OK" || echo "FAIL";
|
Loading…
Reference in New Issue
Block a user