Skip to content

Commit 96dbab6

Browse files
authored
Merge pull request #478 from slabko/unique-type-names
Report native ClickHouse data types and pupulate missing type information
2 parents f1f2c9c + f09c9c3 commit 96dbab6

23 files changed

+1238
-344
lines changed

.github/workflows/Linux.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
-DODBC_PROVIDER=${{ matrix.odbc_provider }}
100100
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
101101
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
102-
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
102+
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode)"
103103
104104
- name: Build
105105
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} --parallel $(nproc)
@@ -158,7 +158,6 @@ jobs:
158158
[ODBC Data Sources]
159159
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
160160
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
161-
ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
162161
163162
[ClickHouse DSN (ANSI)]
164163
Driver = ClickHouse ODBC Driver (ANSI)
@@ -173,13 +172,6 @@ jobs:
173172
Url = http://localhost:8123
174173
DriverLog = yes
175174
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log
176-
177-
[ClickHouse DSN (ANSI, RBWNAT)]
178-
Driver = ClickHouse ODBC Driver (ANSI)
179-
Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
180-
Url = http://localhost:8123/query?default_format=RowBinaryWithNamesAndTypes
181-
DriverLog = yes
182-
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
183175
EOF
184176
185177
# Run all tests except those that were run in "Test - unit tests" step.

.github/workflows/Windows.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
-DODBC_PROVIDER=${{ matrix.odbc_provider }}
7979
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
8080
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
81-
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
81+
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode)"
8282
8383
- name: Build
8484
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
@@ -156,7 +156,6 @@ jobs:
156156
# [ODBC Data Sources]
157157
# ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
158158
# ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
159-
# ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
160159

161160
# [ClickHouse DSN (ANSI)]
162161
# Driver = ClickHouse ODBC Driver (ANSI)
@@ -171,13 +170,6 @@ jobs:
171170
# Url = http://${CLICKHOUSE_SERVER_IP}
172171
# DriverLog = yes
173172
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log
174-
175-
# [ClickHouse DSN (ANSI, RBWNAT)]
176-
# Driver = ClickHouse ODBC Driver (ANSI)
177-
# Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
178-
# Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
179-
# DriverLog = yes
180-
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
181173
# EOF
182174

183175
# if [[ "${{ matrix.odbc_provider }}" == "iODBC" ]]; then

.github/workflows/macOS.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
102102
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
103103
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
104-
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
104+
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode)"
105105
106106
- name: Build
107107
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
@@ -166,7 +166,6 @@ jobs:
166166
[ODBC Data Sources]
167167
ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
168168
ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
169-
ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
170169
171170
[ClickHouse DSN (ANSI)]
172171
Driver = ClickHouse ODBC Driver (ANSI)
@@ -181,13 +180,6 @@ jobs:
181180
Url = http://${CLICKHOUSE_SERVER_IP}
182181
DriverLog = yes
183182
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log
184-
185-
[ClickHouse DSN (ANSI, RBWNAT)]
186-
Driver = ClickHouse ODBC Driver (ANSI)
187-
Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
188-
Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
189-
DriverLog = yes
190-
DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
191183
EOF
192184
193185
# Run all tests except those that were run in "Test - unit tests" step.

driver/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ endif ()
201201

202202
add_library (${libname} SHARED
203203
api/odbc.cpp
204+
api/sql_columns_resultset_mutator.cpp
204205
${WIN_SOURCES}
205206
)
206207

driver/api/impl/impl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ SQLRETURN GetDescField(
940940
CASE_FIELD_NUM_DEF ( SQL_DESC_BIND_TYPE, SQLUINTEGER, SQL_BIND_TYPE_DEFAULT );
941941
CASE_FIELD_NUM ( SQL_DESC_COUNT, SQLSMALLINT );
942942
CASE_FIELD_NUM ( SQL_DESC_ROWS_PROCESSED_PTR, SQLULEN * );
943-
943+
944944
#undef CASE_FIELD_NUM_DEF
945945
#undef CASE_FIELD_NUM
946946

@@ -1271,7 +1271,7 @@ SQLRETURN fillBinding(
12711271

12721272
if (binding_info.c_type == SQL_C_DEFAULT) {
12731273
const auto & column_info = result_set.getColumnInfo(column_idx);
1274-
binding_info.c_type = convertSQLTypeToCType(statement.getTypeInfo(column_info.type, column_info.type_without_parameters).sql_type);
1274+
binding_info.c_type = convertSQLTypeToCType(statement.getTypeInfo(column_info.type, column_info.type_without_parameters).data_type);
12751275
}
12761276

12771277
if (

0 commit comments

Comments
 (0)