Skip to content

Commit

Permalink
Merge pull request #3 from timeplus-io/feature/issue-2-test-types
Browse files Browse the repository at this point in the history
Feature/issue 2 test types and fix some tests
  • Loading branch information
sunset3000 authored Nov 9, 2023
2 parents 740b500 + b9fe925 commit a215579
Show file tree
Hide file tree
Showing 49 changed files with 970 additions and 745 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
-DODBC_PROVIDER=${{ matrix.odbc_provider }}
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
-DTEST_DSN_LIST="Proton DSN (ANSI);Proton DSN (Unicode);Proton DSN (ANSI, RBWNAT)"
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
Expand Down Expand Up @@ -169,15 +169,15 @@ jobs:
DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log
[ODBC Drivers]
ClickHouse ODBC Driver (ANSI) = Installed
ClickHouse ODBC Driver (Unicode) = Installed
Proton ODBC Driver (ANSI) = Installed
Proton ODBC Driver (Unicode) = Installed
[ClickHouse ODBC Driver (ANSI)]
[Proton ODBC Driver (ANSI)]
Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
UsageCount = 1
[ClickHouse ODBC Driver (Unicode)]
[Proton ODBC Driver (Unicode)]
Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
UsageCount = 1
Expand All @@ -191,27 +191,27 @@ jobs:
DebugFile = ${{ github.workspace }}/run/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, RBWNAT) = ClickHouse ODBC Driver (ANSI)
Proton DSN (ANSI) = Proton ODBC Driver (ANSI)
Proton DSN (Unicode) = Proton ODBC Driver (Unicode)
Proton DSN (ANSI, RBWNAT) = Proton ODBC Driver (ANSI)
[ClickHouse DSN (ANSI)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI)
[Proton DSN (ANSI)]
Driver = Proton ODBC Driver (ANSI)
Description = Test DSN for Proton ODBC Driver (ANSI)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
[ClickHouse DSN (Unicode)]
Driver = ClickHouse ODBC Driver (Unicode)
Description = Test DSN for ClickHouse ODBC Driver (Unicode)
[Proton DSN (Unicode)]
Driver = Proton ODBC Driver (Unicode)
Description = Test DSN for Proton ODBC Driver (Unicode)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/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
[Proton DSN (ANSI, RBWNAT)]
Driver = Proton ODBC Driver (ANSI)
Description = Test DSN for Proton ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
DriverLog = yes
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
-DODBC_PROVIDER=${{ matrix.odbc_provider }}
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
-DTEST_DSN_LIST="Proton DSN (ANSI);Proton DSN (Unicode);Proton DSN (ANSI, RBWNAT)"
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
Expand Down Expand Up @@ -131,15 +131,15 @@ jobs:
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log

# [ODBC Drivers]
# ClickHouse ODBC Driver (ANSI) = Installed
# ClickHouse ODBC Driver (Unicode) = Installed
# Proton ODBC Driver (ANSI) = Installed
# Proton ODBC Driver (Unicode) = Installed

# [ClickHouse ODBC Driver (ANSI)]
# [Proton ODBC Driver (ANSI)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# UsageCount = 1

# [ClickHouse ODBC Driver (Unicode)]
# [Proton ODBC Driver (Unicode)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# UsageCount = 1
Expand All @@ -153,27 +153,27 @@ jobs:
# DebugFile = ${{ github.workspace }}/run/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, RBWNAT) = ClickHouse ODBC Driver (ANSI)
# Proton DSN (ANSI) = Proton ODBC Driver (ANSI)
# Proton DSN (Unicode) = Proton ODBC Driver (Unicode)
# Proton DSN (ANSI, RBWNAT) = Proton ODBC Driver (ANSI)

# [ClickHouse DSN (ANSI)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI)
# [Proton DSN (ANSI)]
# Driver = Proton ODBC Driver (ANSI)
# Description = Test DSN for Proton ODBC Driver (ANSI)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log

# [ClickHouse DSN (Unicode)]
# Driver = ClickHouse ODBC Driver (Unicode)
# Description = Test DSN for ClickHouse ODBC Driver (Unicode)
# [Proton DSN (Unicode)]
# Driver = Proton ODBC Driver (Unicode)
# Description = Test DSN for Proton ODBC Driver (Unicode)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/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
# [Proton DSN (ANSI, RBWNAT)]
# Driver = Proton ODBC Driver (ANSI)
# Description = Test DSN for Proton ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
# Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
-DTEST_DSN_LIST="Proton DSN (ANSI);Proton DSN (Unicode);Proton DSN (ANSI, RBWNAT)"
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
Expand Down Expand Up @@ -156,15 +156,15 @@ jobs:
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log

# [ODBC Drivers]
# ClickHouse ODBC Driver (ANSI) = Installed
# ClickHouse ODBC Driver (Unicode) = Installed
# Proton ODBC Driver (ANSI) = Installed
# Proton ODBC Driver (Unicode) = Installed

# [ClickHouse ODBC Driver (ANSI)]
# [Proton ODBC Driver (ANSI)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# UsageCount = 1

# [ClickHouse ODBC Driver (Unicode)]
# [Proton ODBC Driver (Unicode)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# UsageCount = 1
Expand All @@ -178,27 +178,27 @@ jobs:
# DebugFile = ${{ github.workspace }}/run/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, RBWNAT) = ClickHouse ODBC Driver (ANSI)
# Proton DSN (ANSI) = Proton ODBC Driver (ANSI)
# Proton DSN (Unicode) = Proton ODBC Driver (Unicode)
# Proton DSN (ANSI, RBWNAT) = Proton ODBC Driver (ANSI)

# [ClickHouse DSN (ANSI)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI)
# [Proton DSN (ANSI)]
# Driver = Proton ODBC Driver (ANSI)
# Description = Test DSN for Proton ODBC Driver (ANSI)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log

# [ClickHouse DSN (Unicode)]
# Driver = ClickHouse ODBC Driver (Unicode)
# Description = Test DSN for ClickHouse ODBC Driver (Unicode)
# [Proton DSN (Unicode)]
# Driver = Proton ODBC Driver (Unicode)
# Description = Test DSN for Proton ODBC Driver (Unicode)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/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
# [Proton DSN (ANSI, RBWNAT)]
# Driver = Proton ODBC Driver (ANSI)
# Description = Test DSN for Proton ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
# Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
/build-*

.vs/
**/.vs/

CMakeFiles/
CMakeCache.txt

__pycache__/
*.py[cod]
.idea/
**/.idea/
.vscode/
**/.vscode/
34 changes: 17 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,15 @@ install: |-
DebugFile = ${RUN_DIR}/odbc-driver-manager-debug.log

[ODBC Drivers]
ClickHouse ODBC Driver (ANSI) = Installed
ClickHouse ODBC Driver (Unicode) = Installed
Proton ODBC Driver (ANSI) = Installed
Proton ODBC Driver (Unicode) = Installed

[ClickHouse ODBC Driver (ANSI)]
[Proton ODBC Driver (ANSI)]
Driver = ${ODBC_DRIVER_PATH}
Setup = ${ODBC_DRIVER_PATH}
UsageCount = 1

[ClickHouse ODBC Driver (Unicode)]
[Proton ODBC Driver (Unicode)]
Driver = ${ODBC_DRIVERW_PATH}
Setup = ${ODBC_DRIVERW_PATH}
UsageCount = 1
Expand All @@ -412,27 +412,27 @@ 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, RBWNAT) = ClickHouse ODBC Driver (ANSI)
Proton DSN (ANSI) = Proton ODBC Driver (ANSI)
Proton DSN (Unicode) = Proton ODBC Driver (Unicode)
Proton DSN (ANSI, RBWNAT) = Proton ODBC Driver (ANSI)

[ClickHouse DSN (ANSI)]
Driver = ClickHouse ODBC Driver (ANSI)
Description = Test DSN for ClickHouse ODBC Driver (ANSI)
[Proton DSN (ANSI)]
Driver = Proton ODBC Driver (ANSI)
Description = Test DSN for Proton ODBC Driver (ANSI)
Url = http://${CLICKHOUSE_SERVER_IP}
DriverLog = yes
DriverLogFile = ${RUN_DIR}/clickhouse-odbc-driver.log

[ClickHouse DSN (Unicode)]
Driver = ClickHouse ODBC Driver (Unicode)
Description = Test DSN for ClickHouse ODBC Driver (Unicode)
[Proton DSN (Unicode)]
Driver = Proton ODBC Driver (Unicode)
Description = Test DSN for Proton ODBC Driver (Unicode)
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
[Proton DSN (ANSI, RBWNAT)]
Driver = Proton ODBC Driver (ANSI)
Description = Test DSN for Proton 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
Expand All @@ -441,7 +441,7 @@ install: |-
fi

.configure: &configure |-
CMAKE_CONFIGURE_ARGS="-DTEST_DSN_LIST=\"ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)\" $CMAKE_CONFIGURE_EXTRA_ARGS"
CMAKE_CONFIGURE_ARGS="-DTEST_DSN_LIST=\"Proton DSN (ANSI);Proton DSN (Unicode);Proton DSN (ANSI, RBWNAT)\" $CMAKE_CONFIGURE_EXTRA_ARGS"
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
CMAKE_CONFIGURE_ARGS="-DICU_ROOT=$(brew --prefix)/opt/icu4c $CMAKE_CONFIGURE_ARGS"
fi
Expand Down
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/M
include (cmake/prevent_in_source_builds.cmake)

project (
clickhouse-odbc
proton-odbc
VERSION 1.2.1.20220905
DESCRIPTION "The official ODBC driver implementation for accessing ClickHouse as a data source."
HOMEPAGE_URL "https://github.com/ClickHouse/clickhouse-odbc"
DESCRIPTION "The official ODBC driver implementation for accessing Proton as a data source."
HOMEPAGE_URL "https://github.com/timeplus-io/proton-odbc"
LANGUAGES C CXX
)

Expand Down Expand Up @@ -59,8 +59,8 @@ cmake_dependent_option (CH_ODBC_PREFER_BUNDLED_NANODBC "Prefer bundled over syst
option (CH_ODBC_RUNTIME_LINK_STATIC "Link with compiler and language runtime statically" OFF)
option (CH_ODBC_THIRD_PARTY_LINK_STATIC "Link with third party libraries statically" ON)

set (CH_ODBC_DEFAULT_DSN_ANSI "ClickHouse DSN (ANSI)" CACHE STRING "Default ANSI DSN name")
set (CH_ODBC_DEFAULT_DSN_UNICODE "ClickHouse DSN (Unicode)" CACHE STRING "Default Unicode DSN name")
set (CH_ODBC_DEFAULT_DSN_ANSI "Proton DSN (ANSI)" CACHE STRING "Default ANSI DSN name")
set (CH_ODBC_DEFAULT_DSN_UNICODE "Proton DSN (Unicode)" CACHE STRING "Default Unicode DSN name")

if (MSVC)
# This default encoding mode will be overriden by UNICODE, in the corresponding cases.
Expand Down Expand Up @@ -229,13 +229,13 @@ if (CH_ODBC_ENABLE_INSTALL)

cpack_add_component_group (ANSIGroup
DISPLAY_NAME "ANSI ${ARCH_BITS}-bit Driver"
DESCRIPTION "ClickHouse ODBC Driver (ANSI, ${ARCH_BITS}-bit)"
DESCRIPTION "Proton ODBC Driver (ANSI, ${ARCH_BITS}-bit)"
EXPANDED
)

cpack_add_component (ANSIDriver
DISPLAY_NAME "Driver"
DESCRIPTION "ClickHouse ODBC Driver (ANSI, ${ARCH_BITS}-bit)"
DESCRIPTION "Proton ODBC Driver (ANSI, ${ARCH_BITS}-bit)"
REQUIRED
GROUP ANSIGroup
)
Expand All @@ -250,13 +250,13 @@ if (CH_ODBC_ENABLE_INSTALL)

cpack_add_component_group (UnicodeGroup
DISPLAY_NAME "Unicode ${ARCH_BITS}-bit Driver"
DESCRIPTION "ClickHouse ODBC Driver (Unicode, ${ARCH_BITS}-bit)"
DESCRIPTION "Proton ODBC Driver (Unicode, ${ARCH_BITS}-bit)"
EXPANDED
)

cpack_add_component (UnicodeDriver
DISPLAY_NAME "Driver"
DESCRIPTION "ClickHouse ODBC Driver (Unicode, ${ARCH_BITS}-bit)"
DESCRIPTION "Proton ODBC Driver (Unicode, ${ARCH_BITS}-bit)"
DEPENDS ANSIDriver
GROUP UnicodeGroup
)
Expand Down Expand Up @@ -297,7 +297,7 @@ if (CH_ODBC_ENABLE_INSTALL)

set (CPACK_PACKAGE_VENDOR "Yandex LLC")
set (CPACK_PACKAGE_DESCRIPTION "The official ODBC driver implementation for accessing ClickHouse as a data source.")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "ClickHouse ODBC Driver (${ARCH_BITS}-bit)")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Proton ODBC Driver (${ARCH_BITS}-bit)")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/packaging/Readme.rtf")
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/packaging/License.rtf")
set (CPACK_PACKAGE_CHECKSUM "SHA256")
Expand All @@ -321,7 +321,7 @@ if (CH_ODBC_ENABLE_INSTALL)
set (CPACK_RPM_DEBUGINFO_PACKAGE OFF)
set (CPACK_RPM_PACKAGE_SOURCES OFF)

set (CPACK_WIX_ROOT_FEATURE_TITLE "ClickHouse ODBC Driver")
set (CPACK_WIX_ROOT_FEATURE_TITLE "Proton ODBC Driver")
set (CPACK_WIX_ROOT_FEATURE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set (CPACK_WIX_PATCH_FILE "${PROJECT_SOURCE_DIR}/packaging/RegConfig.patch.wxs")
if ("${ARCH_BITS}" STREQUAL "32")
Expand Down
Loading

0 comments on commit a215579

Please sign in to comment.