Merge pull request #9348 from filimonov/docker_for_odbc_driver

adjust dockerfile used in tests to allow odbc roundtrip
This commit is contained in:
alexey-milovidov 2020-02-25 12:06:11 +03:00 committed by GitHub
commit 749c41a545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,8 @@
1
1
1 0.1 a я
2 0.2 b ą
3 0.3 c d
1 0.1 a я
2 0.2 b ą
3 0.3 c d

View File

@ -0,0 +1,14 @@
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;

View File

@ -1,6 +1,8 @@
# docker build -t yandex/clickhouse-stateless-test . # docker build -t yandex/clickhouse-stateless-test .
FROM yandex/clickhouse-deb-builder FROM yandex/clickhouse-deb-builder
ARG odbc_driver_url="https://github.com/ClickHouse/clickhouse-odbc/releases/download/v1.1.3.20200115/clickhouse-odbc-1.1.3-Linux.tar.gz"
RUN apt-get update -y \ RUN apt-get update -y \
&& env DEBIAN_FRONTEND=noninteractive \ && env DEBIAN_FRONTEND=noninteractive \
apt-get install --yes --no-install-recommends \ apt-get install --yes --no-install-recommends \
@ -27,8 +29,16 @@ RUN apt-get update -y \
gdb \ gdb \
lsof \ lsof \
llvm-8 \ llvm-8 \
vim vim \
unixodbc \
wget
RUN mkdir -p /tmp/clickhouse-odbc-tmp \
&& wget --quiet -O - ${odbc_driver_url} | tar --strip-components=1 -xz -C /tmp/clickhouse-odbc-tmp \
&& cp /tmp/clickhouse-odbc-tmp/lib64/*.so /usr/local/lib/ \
&& odbcinst -i -d -f /tmp/clickhouse-odbc-tmp/share/doc/clickhouse-odbc/config/odbcinst.ini.sample \
&& odbcinst -i -s -l -f /tmp/clickhouse-odbc-tmp/share/doc/clickhouse-odbc/config/odbc.ini.sample \
&& rm -rf /tmp/clickhouse-odbc-tmp
ENV TZ=Europe/Moscow ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone