Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to ClickHouse version 20.3 as a baseline (changes NULL param string format) #304

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
- PACKAGING=yes
- TESTING=yes
- STANDALONE_TESTS_ONLY=no
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:19.11.8.46"
- CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:20.3"
services:
- docker
addons:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Pre-built binary packages of the release versions of the driver available for th

- [Releases](https://github.com/ClickHouse/clickhouse-odbc/releases)

The ODBC driver is mainly tested against ClickHouse server version `20.3`. Older versions of ClickHouse server as well as newer ones (with greater success) should work too. Possible complications with older version may include handling `Null` values and `Nullable` types, alternative wire protocol support, timezone handling during date/time conversions, etc.

Note, that since ODBC drivers are not used directly by a user, but rather accessed through applications, which in their turn access the driver through ODBC driver manager, user have to install the driver for the **same architecture** (32- or 64-bit) as the application that is going to access the driver. Moreover, both the driver and the application must be compiled for (and actually use during run-time) the **same ODBC driver manager implementation** (we call them "ODBC providers" here). There are three supported ODBC providers:

- ODBC driver manager associated with **MDAC** (Microsoft Data Access Components, sometimes referenced as WDAC, Windows Data Access Components) - the standard ODBC provider of Windows
Expand Down
4 changes: 2 additions & 2 deletions driver/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void Statement::requestNextPackOfResultSets(std::unique_ptr<ResultMutator> && mu
std::string value;

if (param_bindings.size() <= i) {
value = "Null";
value = "\\N";
}
else {
const auto & binding_info = param_bindings[i];
Expand All @@ -118,7 +118,7 @@ void Statement::requestNextPackOfResultSets(std::unique_ptr<ResultMutator> && mu
throw std::runtime_error("Unable to extract data from bound param buffer: param IO type is not supported");

if (binding_info.value == nullptr)
value = "Null";
value = "\\N";
else
readReadyDataTo(binding_info, value);
}
Expand Down
4 changes: 2 additions & 2 deletions driver/test/statement_parameters_it.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TEST_F(StatementParametersTest, BindingNullStringValueForInteger) {
# define SQL_C_myTCHAR SQL_C_TCHAR
#endif

auto param = fromUTF8<SQLmyTCHAR>("Null");
auto param = fromUTF8<SQLmyTCHAR>("\\N");
filimonov marked this conversation as resolved.
Show resolved Hide resolved
SQLLEN param_ind = 0;

auto * param_wptr = const_cast<SQLmyTCHAR *>(param.c_str());
Expand Down Expand Up @@ -201,7 +201,7 @@ TEST_F(StatementParametersTest, BindingNullStringValueForString) {
# define SQL_C_myTCHAR SQL_C_TCHAR
#endif

auto param = fromUTF8<SQLmyTCHAR>("Null");
auto param = fromUTF8<SQLmyTCHAR>("\\N");
SQLLEN param_ind = 0;

auto * param_wptr = const_cast<SQLmyTCHAR *>(param.c_str());
Expand Down
9 changes: 5 additions & 4 deletions test/deploy_and_run_clickhouse_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ echo 1. Prepare folders
mkdir -p usr/bin etc/clickhouse-server var/lib/clickhouse

echo 2. Download binaries
curl https://clickhouse-builds.s3.yandex.net/0/381947509a4f66236f943beaefb0b1f5c2fd979d/1570028580_binary/clickhouse -o usr/bin/clickhouse
curl https://clickhouse-builds.s3.yandex.net/0/381947509a4f66236f943beaefb0b1f5c2fd979d/1570028580_binary/clickhouse-odbc-bridge -o usr/bin/clickhouse-odbc-bridge
# TODO: switch to actual 20.3 binaries once available. Currently, this is master branch.
curl https://clickhouse-builds.s3.yandex.net/0/d147cd646a1e6cc41d42f92d57f016a5c49d04de/clang-10-darwin_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse -o usr/bin/clickhouse
curl https://clickhouse-builds.s3.yandex.net/0/d147cd646a1e6cc41d42f92d57f016a5c49d04de/clang-10-darwin_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse-odbc-bridge -o usr/bin/clickhouse-odbc-bridge
filimonov marked this conversation as resolved.
Show resolved Hide resolved

echo 3. Download configs
curl https://raw.githubusercontent.com/ClickHouse/ClickHouse/v20.1.9.54-stable/dbms/programs/server/config.xml -o etc/clickhouse-server/config.xml
curl https://raw.githubusercontent.com/ClickHouse/ClickHouse/v20.1.9.54-stable/dbms/programs/server/users.xml -o etc/clickhouse-server/users.xml
curl https://raw.githubusercontent.com/ClickHouse/ClickHouse/20.5/programs/server/config.xml -o etc/clickhouse-server/config.xml
curl https://raw.githubusercontent.com/ClickHouse/ClickHouse/20.5/programs/server/users.xml -o etc/clickhouse-server/users.xml

echo 4. Setup executables
pushd usr/bin/
Expand Down