mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Merge pull request #10172 from ClickHouse/fix_odbc_roundtrip
Fix odbc round trip test
This commit is contained in:
commit
5e36a65d0c
25
tests/queries/0_stateless/01086_odbc_roundtrip.sh
Executable file
25
tests/queries/0_stateless/01086_odbc_roundtrip.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CUR_DIR/../shell_config.sh
|
||||
|
||||
|
||||
for i in $(seq 1 10); do
|
||||
${CLICKHOUSE_CLIENT} -q "select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (ANSI)}','system','tables'))" 2>/dev/null && break
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (Unicode)}','system','tables'))"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS test_01086"
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE DATABASE test_01086"
|
||||
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test_01086.t (x UInt8, y Float32, z String) ENGINE = Memory"
|
||||
${CLICKHOUSE_CLIENT} --query "INSERT INTO test_01086.t VALUES (1,0.1,'a я'),(2,0.2,'b ą'),(3,0.3,'c d')"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM odbc('DSN={ClickHouse DSN (ANSI)}','test_01086','t') ORDER BY x"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM odbc('DSN={ClickHouse DSN (Unicode)}','test_01086','t') ORDER BY x"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP DATABASE test_01086;"
|
@ -1,14 +0,0 @@
|
||||
select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (ANSI)}','system','tables'));
|
||||
select count() > 1 as ok from (select * from odbc('DSN={ClickHouse DSN (Unicode)}','system','tables'));
|
||||
|
||||
DROP DATABASE IF EXISTS test_01086;
|
||||
CREATE DATABASE test_01086;
|
||||
USE test_01086;
|
||||
|
||||
CREATE TABLE t (x UInt8, y Float32, z String) ENGINE = Memory;
|
||||
INSERT INTO t VALUES (1,0.1,'a я'),(2,0.2,'b ą'),(3,0.3,'c d');
|
||||
|
||||
select * from odbc('DSN={ClickHouse DSN (ANSI)}','test_01086','t') ORDER BY x;
|
||||
select * from odbc('DSN={ClickHouse DSN (Unicode)}','test_01086','t') ORDER BY x;
|
||||
|
||||
DROP DATABASE test_01086;
|
Loading…
Reference in New Issue
Block a user