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

Alternative wire protocols support (RowBinaryWithNamesAndTypes) #255

Merged
merged 39 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
301cf50
Remove unused keys
traceon Jan 20, 2020
f3529dd
Fix fromString()
traceon Jan 21, 2020
0ee121d
Fix int -> string attribute value extraction checks
traceon Jan 21, 2020
daa2452
Reaarrange parameters for better browsing
traceon Jan 22, 2020
4f4a563
Fix renamed parameter usage
traceon Jan 22, 2020
91bd8d0
Pass detected or anticipated format name to ResultSet c-tor
traceon Jan 22, 2020
a6c03ff
Fix icompare() typo
traceon Jan 22, 2020
8ec3763
Add more test cases
traceon Jan 23, 2020
b9fd612
Fix description for CentOS 7
traceon Feb 4, 2020
8a9b188
Deep refactoring of data conversion and result set processing
traceon Feb 14, 2020
8a0ad2f
GCC compilation fix/workaround: https://gcc.gnu.org/bugzilla/show_bug…
traceon Feb 15, 2020
24a1387
No more Python 2 in brew, using Python (3)
traceon Feb 15, 2020
9cfd946
Fix 'long' and 'unsigned long' conversion specialization conficts on …
traceon Feb 16, 2020
35cd88c
Merge branch 'switch-to-variant' into alternative-wire-protocol
traceon Feb 16, 2020
40f6405
Bump submodules
traceon Feb 16, 2020
8bcc22f
Fix STOP_MEASURING_TIME_AND_REPORT macro usage in new code
traceon Feb 16, 2020
8962392
Fix flag setting
traceon Feb 16, 2020
b811cdb
Fix macro name
traceon Feb 16, 2020
afe4e4c
Basic RowBinary deserialization
traceon Feb 16, 2020
5be48b2
UUID RowBinary deserialization
traceon Feb 16, 2020
8a1061c
Store precision and scale of decimal type specs in column info, and u…
traceon Feb 16, 2020
a714a0a
Use TEST_DSN_LIST instead of separate TEST_DSN and TEST_DSN_W ("-dsn-…
traceon Feb 16, 2020
85c4163
Fix cmake invocation
traceon Feb 16, 2020
448d55a
Shorten DSN name to avoid problems
traceon Feb 17, 2020
1c708be
Remove some cases to stay within common Decimal64 boundaries
traceon Feb 17, 2020
3355c9d
Make best efforts to provide meaningful display size as early as poss…
traceon Feb 17, 2020
626927b
Change ResultMutator interface
traceon Feb 18, 2020
b4f6880
Add default conversion from DataSourceType<DataSourceTypeId::Nothing>…
traceon Feb 18, 2020
1d483bf
Recycle strings in the pool based on capacity which should be greater…
traceon Feb 18, 2020
dc0e93d
Merge branch 'master' into alternative-wire-protocol
traceon Feb 18, 2020
4dd7f92
Fix cmake (build) invocation flag
traceon Feb 18, 2020
d8f523c
Add comments
traceon Feb 25, 2020
758f7f5
Update brew before installing packages
traceon Feb 25, 2020
5004eed
Add "URL query string" section
traceon Feb 25, 2020
eb5cf2d
Working around wierd behavior of brew
traceon Feb 25, 2020
b31a5c3
Try versionned openssl package name
traceon Feb 25, 2020
654d0d4
Set OPENSSL_ROOT_DIR explicitly
traceon Feb 25, 2020
c685014
Add note about deifference in timezone handling between formats
traceon Feb 25, 2020
58c068b
Add convert()'s that accept moving-into source values
traceon Feb 27, 2020
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
28 changes: 23 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ jobs:
homebrew:
packages:
- libiodbc
update: true

- name: "macOS 10.14 - iODBC - RelWithDebInfo - System third-party libs - x86_64 - AppleClang (Xcode 11.2) - Unix Makefiles"
os: osx
Expand All @@ -254,6 +255,7 @@ jobs:
- openssl
- poco
- libiodbc
update: true

- name: "macOS 10.14 - UnixODBC - RelWithDebInfo - x86_64 - AppleClang (Xcode 11.2) - Unix Makefiles"
os: osx
Expand All @@ -270,6 +272,7 @@ jobs:
homebrew:
packages:
- unixodbc
update: true

before_install: |-
set -Eeo pipefail
Expand Down Expand Up @@ -375,8 +378,9 @@ install: |-
DebugFile = ${RUN_DIR}/odbc-driver-manager-debug.log

[ODBC Data Sources]
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)

[ClickHouse DSN (ANSI)]
Driver = ClickHouse ODBC Driver (ANSI)
Expand All @@ -391,23 +395,37 @@ install: |-
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver-w.log

[ClickHouse DSN (ANSI, RBWNAT)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver.log
EOF
fi
fi

.configure: &configure |-
CMAKE_CONFIGURE_ARGS="'-DTEST_DSN=ClickHouse DSN (ANSI)' '-DTEST_DSN_W=ClickHouse DSN (Unicode)' $CMAKE_CONFIGURE_EXTRA_ARGS"
CMAKE_CONFIGURE_ARGS="-DTEST_DSN_LIST=\"ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)\" $CMAKE_CONFIGURE_EXTRA_ARGS"
if [[ "$EXTERNAL_THIRD_PARTY" == "yes" ]]; then
CMAKE_CONFIGURE_ARGS="-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=OFF $CMAKE_CONFIGURE_ARGS"
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
CMAKE_CONFIGURE_ARGS="-DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl $CMAKE_CONFIGURE_ARGS"
fi
fi
if [[ ! -z "$ODBC_PROVIDER" ]]; then
CMAKE_CONFIGURE_ARGS="-DODBC_PROVIDER=$ODBC_PROVIDER $CMAKE_CONFIGURE_ARGS"
fi
cd $BUILD_DIR
echo "#!/usr/bin/env bash" > cmake_configure.sh
echo "set -Eeuo pipefail" >> cmake_configure.sh
echo "cmake $CMAKE_CONFIGURE_ARGS $SOURCE_DIR" >> cmake_configure.sh
chmod u+x cmake_configure.sh
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
$SOURCE_DIR/test/vcvars_enabled_bash.sh cmake $CMAKE_CONFIGURE_ARGS $SOURCE_DIR
$SOURCE_DIR/test/vcvars_enabled_bash.sh ./cmake_configure.sh
else
cmake $CMAKE_CONFIGURE_ARGS $SOURCE_DIR
./cmake_configure.sh
fi

.build: &build |-
Expand Down
16 changes: 7 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ endif ()
# Make sure that all optimized builds have NDEBUG macro set.
foreach (config Release RelWithDebInfo MinSizeRel)
foreach (lang CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
set (var "${lang}_${config}")
string (TOUPPER "${config}" config_uc)
set (var "${lang}_${config_uc}")
set (${var} "${${var}} -DNDEBUG")
endforeach ()
endforeach ()

# Set BUILD_TYPE_* macro for each of build types.
foreach (config Debug Release RelWithDebInfo MinSizeRel)
foreach (lang CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
set (var "${lang}_${config}")
set (${var} "${${var}} -DBUILD_TYPE_${config}")
string (TOUPPER "${config}" config_uc)
set (var "${lang}_${config_uc}")
set (${var} "${${var}} -DBUILD_TYPE_${config_uc}")
endforeach ()
endforeach ()

Expand Down Expand Up @@ -149,12 +151,8 @@ if (CH_ODBC_ENABLE_TESTING)
enable_testing ()
include (GoogleTest)

if (NOT TEST_DSN)
set (TEST_DSN "${CH_ODBC_DEFAULT_DSN_ANSI}")
endif ()

if (NOT TEST_DSN_W)
set (TEST_DSN_W "${CH_ODBC_DEFAULT_DSN_UNICODE}")
if (NOT TEST_DSN_LIST)
set (TEST_DSN_LIST "${CH_ODBC_DEFAULT_DSN_ANSI};${CH_ODBC_DEFAULT_DSN_UNICODE}")
endif ()
endif ()

Expand Down
75 changes: 44 additions & 31 deletions README.md

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ unset (WORKAROUND_ENABLE_NO_UNICODE_CHARS_IN_COLUMN_NAMES_IN_TESTS)

# In order to enable testing, put every non-public symbol to a static library (which is then used by shared library and unit-test binary).
add_library (${libname}-impl STATIC
utils/read_helpers.cpp
utils/type_parser.cpp
utils/type_info.cpp

config/config.cpp

escaping/escape_sequences.cpp
escaping/lexer.cpp

format/ODBCDriver2.cpp
format/RowBinaryWithNamesAndTypes.cpp

api/impl/impl.cpp

attributes.cpp
Expand All @@ -66,7 +69,6 @@ add_library (${libname}-impl STATIC
object.cpp
result_set.cpp
statement.cpp
type_info.cpp


${CMAKE_CURRENT_BINARY_DIR}/platform/config_cmake${WIDECHAR_SUFFIX}.h
Expand All @@ -75,9 +77,8 @@ add_library (${libname}-impl STATIC
utils/utils.h
utils/unicode_conv.h
utils/iostream_debug_helpers.h
utils/read_helpers.h
utils/type_parser.h
utils/scope_guard.h
utils/type_info.h

config/config.h
config/ini_defines.h
Expand All @@ -89,6 +90,9 @@ add_library (${libname}-impl STATIC

api/impl/impl.h

format/ODBCDriver2.h
format/RowBinaryWithNamesAndTypes.h

attributes.h
connection.h
descriptor.h
Expand All @@ -99,7 +103,6 @@ add_library (${libname}-impl STATIC
object.h
result_set.h
statement.h
type_info.h
)

set (WIN_SOURCES)
Expand Down
Loading