Skip to content

Commit 4d254df

Browse files
committed
Register ODBC driver
ODBC driver registration is required for ODBC tests (enabled in a separate PR)
1 parent 83df835 commit 4d254df

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/cpp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ jobs:
476476
PIPX_BASE_PYTHON: ${{ steps.python-install.outputs.python-path }}
477477
run: |
478478
ci/scripts/install_gcs_testbench.sh default
479+
- name: Register Flight SQL ODBC Driver
480+
shell: cmd
481+
run: |
482+
call "cpp\src\arrow\flight\sql\odbc\install\install_amd64.cmd" ${{github.workspace}}\build\cpp\%ARROW_BUILD_TYPE%\libarrow_flight_sql_odbc.dll
479483
- name: Test
480484
shell: msys2 {0}
481485
run: |
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
@REM Licensed to the Apache Software Foundation (ASF) under one
2+
@REM or more contributor license agreements. See the NOTICE file
3+
@REM distributed with this work for additional information
4+
@REM regarding copyright ownership. The ASF licenses this file
5+
@REM to you under the Apache License, Version 2.0 (the
6+
@REM "License"); you may not use this file except in compliance
7+
@REM with the License. You may obtain a copy of the License at
8+
@REM
9+
@REM http://www.apache.org/licenses/LICENSE-2.0
10+
@REM
11+
@REM Unless required by applicable law or agreed to in writing,
12+
@REM software distributed under the License is distributed on an
13+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
@REM KIND, either express or implied. See the License for the
15+
@REM specific language governing permissions and limitations
16+
@REM under the License.
17+
18+
@echo off
19+
20+
set ODBC_AMD64=%1
21+
22+
@REM enable delayed variable expansion to make environment variables enclosed with "!" to be evaluated
23+
@REM when the command is executed instead of when the command is parsed
24+
setlocal enableextensions enabledelayedexpansion
25+
26+
if [%ODBC_AMD64%] == [] (
27+
echo error: 64-bit driver is not specified. Call format: install_amd64 abs_path_to_64_bit_driver
28+
pause
29+
exit /b 1
30+
)
31+
32+
if exist %ODBC_AMD64% (
33+
for %%i IN (%ODBC_AMD64%) DO IF EXIST %%~si\NUL (
34+
echo warning: The path you have specified seems to be a directory. Note that you have to specify path to driver file itself instead.
35+
)
36+
echo Installing 64-bit driver: %ODBC_AMD64%
37+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v DriverODBCVer /t REG_SZ /d "03.80" /f
38+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v UsageCount /t REG_DWORD /d 00000001 /f
39+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v Driver /t REG_SZ /d %ODBC_AMD64% /f
40+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v Setup /t REG_SZ /d %ODBC_AMD64% /f
41+
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Arrow Flight SQL ODBC Driver" /t REG_SZ /d "Installed" /f
42+
43+
IF !ERRORLEVEL! NEQ 0 (
44+
echo Error occurred while registering 64-bit driver. Exiting.
45+
echo ERRORLEVEL: !ERRORLEVEL!
46+
exit !ERRORLEVEL!
47+
)
48+
) else (
49+
echo 64-bit driver can not be found: %ODBC_AMD64%
50+
echo Call format: install_amd64 abs_path_to_64_bit_driver
51+
pause
52+
exit /b 1
53+
)

0 commit comments

Comments
 (0)