Skip to content

Commit

Permalink
fix logical error introduced in PR#189, add smoke test for MariaDB (#192
Browse files Browse the repository at this point in the history
)

* CI: smoke test against mariadb odbc

* revert #189

there's some logical error in that PR, will address it later
  • Loading branch information
chipitsine authored Oct 7, 2024
1 parent a9a66e6 commit 9e6b264
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/MariaDB_odbc_data_source_template.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[MariaDB-server]
Description=MariaDB server
Driver=MariaDB ODBC 3.0 Driver
SERVER=127.0.0.1
USER=test_user
PASSWORD=test_password
DATABASE=test_db
PORT=3306
3 changes: 3 additions & 0 deletions .github/MariaDB_odbc_driver_template.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MariaDB ODBC 3.0 Driver]
Description = MariaDB Connector/ODBC v.3.0
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
28 changes: 25 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: [ push, workflow_dispatch ]
on: [ push, pull_request, workflow_dispatch ]

permissions:
contents: read
Expand All @@ -11,17 +11,39 @@ jobs:
fail-fast: false
name: ${{ matrix.cc }}
runs-on: ubuntu-24.04
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: test_db
MYSQL_USER: test_user
MYSQL_PASSWORD: test_password
options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y libltdl-dev
sudo apt-get install -y libltdl-dev odbc-mariadb
- name: configure
run: |
autoreconf -iv
CC=${{ matrix.cc }} ./configure
CC=${{ matrix.cc }} CFLAGS="-ggdb -fsanitize=address" ./configure --prefix=/ --exec-prefix=/
- name: build
run: |
##make AM_MAKEFLAGS=CFLAGS=-Werror
make
sudo make install
- name: mariadb smoke test
run: |
sudo -E ./exe/.libs/odbcinst -i -d -f .github/MariaDB_odbc_driver_template.ini
./exe/.libs/odbcinst -i -s -h -f .github/MariaDB_odbc_data_source_template.ini
echo 'SELECT VERSION();' | ./exe/.libs/isql -v MariaDB-server -b
2 changes: 1 addition & 1 deletion exe/isql.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main( int argc, char *argv[] )
* CONNECT
***************************/

if (szPWD==NULL || szUID==NULL || !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ))
if (!OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ))
exit( 1 );

/****************************
Expand Down

0 comments on commit 9e6b264

Please sign in to comment.