ClickHouse/tests/queries/0_stateless/01086_odbc_roundtrip.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
1.5 KiB
Bash
Raw Normal View History

2020-04-10 11:29:56 +00:00
#!/usr/bin/env bash
# Tags: no-asan, no-msan, no-fasttest, no-cpu-aarch64
2021-09-12 12:35:27 +00:00
# Tag no-msan: can't pass because odbc libraries are not instrumented
# Tag no-cpu-aarch64: clickhouse-odbc is not setup for arm
2020-04-10 11:29:56 +00:00
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
2020-04-10 11:29:56 +00:00
2020-08-01 00:40:56 +00:00
for _ in $(seq 1 10); do
2020-04-10 11:29:56 +00:00
${CLICKHOUSE_CLIENT} -q "select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (ANSI)}','system','tables'))" 2>/dev/null && break
2020-04-10 13:51:09 +00:00
sleep 0.1
2020-04-10 11:29:56 +00:00
done
2023-03-21 09:40:10 +00:00
# ODBC will do HEAD request because of progress bar
# in normal situation, 501 will be returned and no Error is logged
# but sometimes we get I/O broken pipe producing an Error log but it doesn't affect the run of the test
${CLICKHOUSE_CLIENT} --query "select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (Unicode)}','system','tables'))" 2> >(grep -Fv "Failed to make HTTP_HEAD request")
2020-04-10 11:29:56 +00:00
${CLICKHOUSE_CLIENT} --query "CREATE TABLE t (x UInt8, y Float32, z String) ENGINE = Memory"
${CLICKHOUSE_CLIENT} --query "INSERT INTO t VALUES (1,0.1,'a я'),(2,0.2,'b ą'),(3,0.3,'c d')"
2020-04-10 11:29:56 +00:00
2023-03-21 09:40:10 +00:00
${CLICKHOUSE_CLIENT} --query "SELECT x, y, z FROM odbc('DSN={ClickHouse DSN (ANSI)}','$CLICKHOUSE_DATABASE','t') ORDER BY x" 2> >(grep -Fv "Failed to make HTTP_HEAD request")
${CLICKHOUSE_CLIENT} --query "SELECT x, y, z FROM odbc('DSN={ClickHouse DSN (Unicode)}','$CLICKHOUSE_DATABASE','t') ORDER BY x" 2> >(grep -Fv "Failed to make HTTP_HEAD request")
2020-04-10 11:29:56 +00:00
${CLICKHOUSE_CLIENT} --query "DROP TABLE t"