mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
init
This commit is contained in:
parent
c0b36c946d
commit
223de64072
@ -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
|
@ -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