TPC-Council / HammerDB

HammerDB Database Load Testing and Benchmarking Tool
http://www.hammerdb.com
GNU General Public License v3.0
589 stars 119 forks source link

HammerDB CLI in container in MSSQLS mode not finding MSSQL ODBC drivers #595

Closed zinzh closed 1 year ago

zinzh commented 1 year ago

Description Hammerdb CLI in container in MSSQLS mode not finding MSSQL ODBC drivers

To Reproduce

  1. Run hammerdb container from the provided official image
  2. select mssqls mode from hammerdbcli
  3. use any parameters to connect to an MSSQL database

Expected behavior Can connect to the DB and build the schema

Screenshots edited2

HammerDB Version HammerDB v4.8

HammerDB Interface

Operating System (please complete the following information): HammerDb CLI in container (base image Ubuntu 20.04)

Database Server (please complete the following information): 15.0.4316

Database Client (please complete the following information): Based on container image

Additional context In MSSQL Dockerfile, msodbcsql18 is being installed without specifying a version, however, in the same Dockerfile the line Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.1.so.2.1 is being added in /usr/local/unixODBC/etc/odbcinst.ini with a specific version .

Installing msodbcsql18 with specific version 18.1.2.1-1 solves the issue since a newer version has been released from microsoft (18.3.1.1-1)

Replacing ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y msodbcsql18 && \ with ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get install -y msodbcsql18==18.1.2.1-1 && \

pooja-jain-17 commented 1 year ago

'librarycheck' passes on the both the images from

  1. Docker Hub docker pull tpcorg/hammerdb:mssqls
  2. And the image built from Dockerfile

Also the library /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.2.1 is present in both of these images

image

zinzh commented 1 year ago

@pooja-jain-17 Yes, but the path to the driver in /usr/local/unixODBC/etc/odbcinst.ini is still pointing to an older version which is causing the error

pooja-jain-17 commented 1 year ago

@zinzh Thanks for pointing this. I see what you are saying. We have Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.1.so.2.1 as opposed to Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.2.1

Please go ahead and create a pull request if you would like and we can incorporate it.

You will need to edit this particular code in the Dockerfile

echo "[ODBC Driver 18 for SQL Server] \n\
    Description=Microsoft ODBC Driver 18 for SQL Server \n\
    Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.1.so.2.1 \n\
    UsageCount=1 " >> /usr/local/unixODBC/etc/odbcinst.ini && \

We can also incorporate your earlier suggestion of installing the specific msodbcsql18 version 18.2.2.1-1 so everything is consistent.

Thanks,

zinzh commented 1 year ago

I will open a PR with the fix i suggested so that we do not face the issue again when a new version is released from microsoft and gets automatically selected for installation, thanks @pooja-jain-17