lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
94 stars 51 forks source link

isql crashes with one space character on standard input #146

Closed Jacob-Burckhardt closed 11 months ago

Jacob-Burckhardt commented 11 months ago

Using bash, this command:

printf " " | isql -b LIVE_Config -v

produces this output:

Segmentation fault (core dumped)

It works if you remove the space in the printf command like this

printf "" | isql -b LIVE_Config -v

That command outputs nothing as expected.

/etc/odbc.ini says (password changed to protect confidentiality):

[LIVE_Config]
Driver       = MySQLdriver
SERVER       = 192.168.10.230
PORT         = 3306
USER         = tcsApplication
Password     = xxxxxx
Database     = LIVE_Config

/etc/odbcinst.ini says:

[MySQLdriver]
Driver       = /usr/lib64/libmyodbc5.so

It occurred on Amazon Linux 2 using rpm unixODBC-2.3.1-14.amzn2.x86_64.

v-chojas commented 11 months ago

unixODBC 2.3.1 is very old, please see all the Bugfixes since then: https://www.unixodbc.org/

I don't have a MySQL but your test case worked fine for me with MS SQL Server , msodbcsql18 driver and unixODBC 2.3.11. Please try a newer unixODBC first.

lurcher commented 11 months ago

On 10/08/2023 20:44, v-chojas wrote:

unixODBC 2.3.1 is /very/ old, please see all the Bugfixes since then: https://www.unixodbc.org/

I don't have a MySQL but your test case worked fine for me with MS SQL Server , msodbcsql18 driver and unixODBC 2.3.11. Please try a newer unixODBC first.

Yep, I tried it with the latest build, MySQL and SQL Server, both fine, also a much older build, also fine, though the older build passed the empty string to the driver which then reported a empty query.

If you want to use your version, I would check with a debugger just where the seg fault is happening. May be in the driver.

Jacob-Burckhardt commented 11 months ago

I don't have an easy way to quickly test a newer version, but I will trust your testing. Sorry to take up your time; I should have checked to see how old my version was.

lurcher commented 11 months ago

On 10/08/2023 21:02, Jacob-Burckhardt wrote:

I don't have an easy way to quickly test a newer version, but I will trust your testing. Sorry to take up your time; I should have checked to see how old my version was.

No problem, I would still check where the seg fault is happening, may be driver, worth knowing.