Skip to content

Commit

Permalink
Override the flightsql-odbc version
Browse files Browse the repository at this point in the history
Override what flightsql-odbc reports for SQLGetInfo(SQL_DRIVER_VER)
to be consistent with WARPDRIVE_VERSION which is what's used for the
DLL version.

Change-Id: Ib4d8ae59b9438956135a4bac615502fc353e94a2
  • Loading branch information
jduo committed Jun 28, 2022
1 parent eef3f79 commit eb685c2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ if (NOT ODBCABSTRACTION_GIT_TAG)
if (DEFINED ENV{ODBCABSTRACTION_GIT_TAG})
set(ODBCABSTRACTION_GIT_TAG "$ENV{ODBCABSTRACTION_GIT_TAG}")
else()
set(ODBCABSTRACTION_GIT_TAG "83771d462b221f093a5cf9c7b747fdbdc8cc9464")
set(ODBCABSTRACTION_GIT_TAG "5a8660d0b815489d981e73560e81ee1f036358a3")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion build-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cd _build
ARROW_GIT_REPOSITORY="${ARROW_GIT_REPOSITORY:=https://github.com/apache/arrow}"
ARROW_GIT_TAG="${ARROW_GIT_TAG:=b050bd0d31db6412256cec3362c0d57c9732e1f2}"
ODBCABSTRACTION_REPO="${ODBCABSTRACTION_REPO:=/opt/flightsql-odbc}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=83771d462b221f093a5cf9c7b747fdbdc8cc9464}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=5a8660d0b815489d981e73560e81ee1f036358a3}"

cmake \
-GNinja \
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd _build
ARROW_GIT_REPOSITORY="${ARROW_GIT_REPOSITORY:=https://github.com/apache/arrow}"
ARROW_GIT_TAG="${ARROW_GIT_TAG:=b050bd0d31db6412256cec3362c0d57c9732e1f2}"
ODBCABSTRACTION_REPO="${ODBCABSTRACTION_REPO:=/opt/flightsql-odbc}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=83771d462b221f093a5cf9c7b747fdbdc8cc9464}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=5a8660d0b815489d981e73560e81ee1f036358a3}"

cmake \
-GNinja \
Expand Down
2 changes: 1 addition & 1 deletion build_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd build
ARROW_GIT_REPOSITORY="${ARROW_GIT_REPOSITORY:=https://github.com/apache/arrow}"
ARROW_GIT_TAG="${ARROW_GIT_TAG:=b050bd0d31db6412256cec3362c0d57c9732e1f2}"
ODBCABSTRACTION_REPO="${ODBCABSTRACTION_REPO:=../flightsql-odbc}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=83771d462b221f093a5cf9c7b747fdbdc8cc9464}"
ODBCABSTRACTION_GIT_TAG="${ODBCABSTRACTION_GIT_TAG:=5a8660d0b815489d981e73560e81ee1f036358a3}"

cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
2 changes: 1 addition & 1 deletion build_win32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SETLOCAL
if NOT DEFINED ARROW_GIT_REPOSITORY SET ARROW_GIT_REPOSITORY="https://github.com/apache/arrow"
if NOT DEFINED ARROW_GIT_TAG SET ARROW_GIT_TAG="b050bd0d31db6412256cec3362c0d57c9732e1f2"
if NOT DEFINED ODBCABSTRACTION_REPO SET ODBCABSTRACTION_REPO="../flightsql-odbc"
if NOT DEFINED ODBCABSTRACTION_GIT_TAG SET ODBCABSTRACTION_GIT_TAG="83771d462b221f093a5cf9c7b747fdbdc8cc9464"
if NOT DEFINED ODBCABSTRACTION_GIT_TAG SET ODBCABSTRACTION_GIT_TAG="5a8660d0b815489d981e73560e81ee1f036358a3"

cmake ..^
-DARROW_GIT_REPOSITORY=%ARROW_GIT_REPOSITORY%^
Expand Down
2 changes: 1 addition & 1 deletion build_win64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SETLOCAL
if NOT DEFINED ARROW_GIT_REPOSITORY SET ARROW_GIT_REPOSITORY="https://github.com/apache/arrow"
if NOT DEFINED ARROW_GIT_TAG SET ARROW_GIT_TAG="b050bd0d31db6412256cec3362c0d57c9732e1f2"
if NOT DEFINED ODBCABSTRACTION_REPO SET ODBCABSTRACTION_REPO="../flightsql-odbc"
if NOT DEFINED ODBCABSTRACTION_GIT_TAG SET ODBCABSTRACTION_GIT_TAG="83771d462b221f093a5cf9c7b747fdbdc8cc9464"
if NOT DEFINED ODBCABSTRACTION_GIT_TAG SET ODBCABSTRACTION_GIT_TAG="5a8660d0b815489d981e73560e81ee1f036358a3"

cmake ..^
-DARROW_GIT_REPOSITORY=%ARROW_GIT_REPOSITORY%^
Expand Down
16 changes: 8 additions & 8 deletions src/arrow-odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ find_package(OpenSSL REQUIRED)
# Add gRPC dependencies needed by Arrow Flight. Should be pre-installed.
find_package(gRPC 1.36 CONFIG REQUIRED)

# Define the version number information.
if(DEFINED ENV{WARPDRIVE_BUILD_VERSION})
set(WARPDRIVE_BUILD_VERSION "$ENV{WARPDRIVE_BUILD_VERSION}")
else()
set(WARPDRIVE_BUILD_VERSION "${WARPDRIVE_VERSION_MAJOR}.${WARPDRIVE_VERSION_MINOR}.${WARPDRIVE_VERSION_PATCH}.0")
endif()
add_compile_definitions(WARPDRIVE_BUILD_VERSION="${WARPDRIVE_BUILD_VERSION}")

if (MSVC)
# the following definitions stop arrow from using __declspec when staticly linking and will break on windows without them
add_compile_definitions(ARROW_STATIC ARROW_FLIGHT_STATIC)
Expand Down Expand Up @@ -89,17 +97,9 @@ if (MSVC)

# Add version info resources
# More info at: https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource

if(DEFINED ENV{WARPDRIVE_BUILD_VERSION})
set(WARPDRIVE_BUILD_VERSION "$ENV{WARPDRIVE_BUILD_VERSION}")
else()
set(WARPDRIVE_BUILD_VERSION "${WARPDRIVE_VERSION_MAJOR}.${WARPDRIVE_VERSION_MINOR}.${WARPDRIVE_VERSION_PATCH}.0")
endif()

set(WARPDRIVE_RC_PRODUCTVERSION "${WARPDRIVE_BUILD_VERSION}")
string(REPLACE "." "," WARPDRIVE_RC_FILEVERSION "${WARPDRIVE_RC_PRODUCTVERSION}")
configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)

list(APPEND ARROW_ODBC_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()

Expand Down
4 changes: 3 additions & 1 deletion src/arrow-odbc/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
* @brief Create a Driver object
*/
std::shared_ptr<driver::odbcabstraction::Driver> CreateDriver() {
return std::shared_ptr<driver::odbcabstraction::Driver>(new driver::flight_sql::FlightSqlDriver());
auto driver = std::shared_ptr<driver::odbcabstraction::Driver>(new driver::flight_sql::FlightSqlDriver());
driver->SetVersion(WARPDRIVE_BUILD_VERSION);
return driver;
}

0 comments on commit eb685c2

Please sign in to comment.