Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix logical error introduced in PR#189, add smoke test for MariaDB #192

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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