Skip to content

Commit

Permalink
Fix shadowing member variables causing null pointer exception (#148)
Browse files Browse the repository at this point in the history
* fix some shadowing member variables casuing null pointer exception

* extend perf tests aws credentials duration from 3 to 4 hours

* workaround mysqlclient

* fix zlib not found

* fix mac build

* bump mysql version

* fix mac build

* bump github action runner macos versiooon

* update download link

* fix build

* install openssl1.1 for macos13

* debug

* debug

* fall back to macos 11

* change macos version to 12

* fix build

* fix build
  • Loading branch information
yanw-bq committed May 18, 2023
1 parent 2e725a6 commit 6e80ed8
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: 'integration-test-logs'
path: build/reports/tests/
path: reports/tests/
retention-days: 3

- name: 'Delete Test Clusters if Ungraceful Cancel'
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/failover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
# Configure build environment/dependencies
- name: Install MySQL client libs and include files
run: |
curl https://cdn.mysql.com/archives/mysql-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
curl https://cdn.mysql.com/archives/mysql-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64-debug-test.zip -o mysql-debug.zip
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64-debug-test.zip -o mysql-debug.zip
unzip -d C:/ mysql.zip
mkdir C:/mysql-${{ vars.MYSQL_VERSION }}-winx64-debug
unzip -d C:/mysql-${{ vars.MYSQL_VERSION }}-winx64-debug mysql-debug.zip
Expand Down Expand Up @@ -205,10 +205,9 @@ jobs:

build-mac:
name: MacOS
runs-on: macos-11
runs-on: macos-13
env:
CMAKE_GENERATOR: Unix Makefiles
MYSQL_DIR: /usr/local/opt/mysql-client
ODBC_DM_INCLUDES: /usr/local/include
steps:
- name: Checkout source code
Expand All @@ -234,6 +233,15 @@ jobs:
brew install libiodbc mysql-client
brew link --overwrite --force libiodbc
brew install openssl@1.1
rm -f /usr/local/lib/libssl.1.1.dylib
rm -f /usr/local/lib/libcrypto.1.1.dylib
ln -s /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib /usr/local/lib/
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64.tar.gz -o mysql.tar.gz
tar -xzvf mysql.tar.gz
- name: Cache AWS SDK libraries
id: cache-dynamic-aws-sdk
uses: actions/cache@v3
Expand Down Expand Up @@ -261,6 +269,7 @@ jobs:
-DODBC_INCLUDES=$ODBC_DM_INCLUDES
-DENABLE_UNIT_TESTS=TRUE
-DENABLE_INTEGRATION_TESTS=FALSE
-DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64

# Build driver
- name: Build driver
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# Configure build environment/dependencies
- name: Install MySQL client libs
run: |
curl https://cdn.mysql.com/archives/mysql-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
unzip -d C:/ mysql.zip
- name: Add msbuild to PATH
Expand Down Expand Up @@ -130,10 +130,9 @@ jobs:

build-mac:
name: MacOS
runs-on: macos-11
runs-on: macos-13
env:
CMAKE_GENERATOR: Unix Makefiles
MYSQL_DIR: /usr/local/opt/mysql-client
ODBC_DM_INCLUDES: /usr/local/include
steps:
- name: Checkout source code
Expand All @@ -159,6 +158,15 @@ jobs:
brew install libiodbc mysql mysql-client
brew link --overwrite --force libiodbc
brew install openssl@1.1
rm -f /usr/local/lib/libssl.1.1.dylib
rm -f /usr/local/lib/libcrypto.1.1.dylib
ln -s /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib /usr/local/lib/
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64.tar.gz -o mysql.tar.gz
tar -xzvf mysql.tar.gz
- name: Cache AWS SDK libraries
id: cache-dynamic-aws-sdk
uses: actions/cache@v3
Expand All @@ -184,6 +192,7 @@ jobs:
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DMYSQLCLIENT_STATIC_LINKING=true
-DODBC_INCLUDES=$ODBC_DM_INCLUDES
-DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64

# Build driver
- name: Build driver
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: 'Set up Temp AWS Credentials'
run: |
creds=($(aws sts get-session-token \
--duration-seconds 10800 \
--duration-seconds 14400 \
--query 'Credentials.[AccessKeyId, SecretAccessKey, SessionToken]' \
--output text \
| xargs));
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
- name: 'Display and save log'
if: always()
working-directory: ${{ github.workspace }}/build
working-directory: ${{ github.workspace }}
run: |
echo "Displaying logs"
mkdir -p ./reports/tests
Expand All @@ -147,7 +147,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: 'performance-test-logs'
path: build/reports/tests/
path: reports/tests/
retention-days: 3

- name: 'Delete Test Clusters if Ungraceful Cancel'
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ env:
jobs:
build-mac:
name: macOS
runs-on: macos-11
runs-on: macos-13
env:
CMAKE_GENERATOR: Unix Makefiles
MYSQL_DIR: /usr/local/opt/mysql-client
ODBC_DM_INCLUDES: /usr/local/include
steps:
- name: Checkout source code
Expand All @@ -40,6 +39,15 @@ jobs:
brew install libiodbc mysql-client
brew link --overwrite --force libiodbc
brew install openssl@1.1
rm -f /usr/local/lib/libssl.1.1.dylib
rm -f /usr/local/lib/libcrypto.1.1.dylib
ln -s /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib /usr/local/lib/
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64.tar.gz -o mysql.tar.gz
tar -xzvf mysql.tar.gz
- name: Build and install AWS SDK C++
working-directory: ./scripts
run: |
Expand All @@ -56,6 +64,7 @@ jobs:
-DODBC_INCLUDES=$ODBC_DM_INCLUDES
-DCONNECTOR_PLATFORM=macos
-DBUNDLE_DEPENDENCIES=true
-DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-macos13-x86_64

- name: Build driver
working-directory: ${{ github.workspace }}/build
Expand Down Expand Up @@ -150,7 +159,7 @@ jobs:
# Configure build environment/dependencies
- name: Install MySQL client libs
run: |
curl -L https://cdn.mysql.com/archives/mysql-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
unzip -d C:/ mysql.zip
- name: Add msbuild to PATH
Expand Down
5 changes: 0 additions & 5 deletions driver/mysql_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ class MYSQL_PROXY : public CONNECTION_PROXY {

void close_socket() override;

protected:
DBC* dbc = nullptr;
DataSource* ds = nullptr;
MYSQL_PROXY* next_proxy = nullptr;

private:
MYSQL* mysql = nullptr;
std::shared_ptr<HOST_INFO> host = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion test/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mysql-odbc-test:
image: mysql:8.0.31
image: mysql:8.0.33
container_name: myodbc-test
restart: on-failure
ports:
Expand Down
2 changes: 1 addition & 1 deletion testframework/src/test/java/utility/ContainerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected boolean isRunning(InspectContainerResponse containerInfo) {
}

public static GenericContainer<?> createMysqlContainer(Network network) {
return new GenericContainer<>("mysql:8.0.31")
return new GenericContainer<>("mysql:8.0.33")
.withNetwork(network)
.withNetworkAliases("mysql-instance")
.withEnv("MYSQL_ROOT_PASSWORD", "root")
Expand Down

0 comments on commit 6e80ed8

Please sign in to comment.