[unixODBC-support] unixODBC Setup on Gentoo

barsalou barjunk at attglobal.net
Thu Sep 6 02:44:53 BST 2012


That is an interesting question.

Does anyone else on this list want to try and add spaces to their  
config files to see if it will break a working config with various  
drivers?

So far this occurs with the following drivers that I know of:

  - sqlite
  - MSSQL

I'm going to guess it is consistent across all drivers, but would  
rather know than assume.

Thanks for any effort put towards this.

Mike Barsalou

Quoting Spencer Ogden <spencer at spencerogden.com>:

> Wow, ding ding. A lark was right.
>
> Leading spaces remove, and:
>
> # isql Test -v
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL>
>
> What systems do you think this affects, just some Linux installations,
> or all users of unixODBC?
>
> Thanks for taking another look at this and finding a solution,
>
> Spencer
>
> On 9/4/2012 4:42 PM, barsalou wrote:
>> Spencer,
>>
>> As a lark...try deleting any leading spaces in the ini files and   
>> see if that works.
>>
>> Mike Barsalou
>>
>> Quoting Spencer Ogden <spencer at spencerogden.com>:
>>
>>> Sorry to re-raise this issue, but I have been unable to find a resolution.
>>>
>>> I am trying to setup unixODBC on a Gentoo Linux install, and I am
>>> starting with a simple SQLite test case. I have a simple SQLite.db
>>> called test.sqlite. The setup files are shown below. isql gives the
>>> following error:
>>>
>>> # isql Test -v
>>> [IM002][unixODBC][Driver Manager]Data source name not found, and no
>>> default driver specified
>>> [ISQL]ERROR: Could not SQLConnect
>>>
>>> The extended Trace file is included below. I have tested the all
>>> libraries are present with ldd, and I have tested on both 32-bit and
>>> 64-bit installs.
>>>
>>> Any help is greatly appreciated as I am at a loss for where to look
>>> next for problems. I'm happy to do any testing that would be helpful.
>>>
>>> Thanks,
>>>
>>> Spencer
>>>
>>> # cat /etc/unixODBC/odbcinst.ini
>>> [SQLite]
>>>    Description=SQLite ODBC Driver
>>>    Driver=/usr/lib64/libsqlite3odbc.so
>>>    Setup=/usr/lib64/libsqlite3odbc.so
>>>    Threading=2
>>>
>>> [ODBC]
>>> Trace = Yes
>>> TraceFile = /tmp/odbc.spencer.log
>>>
>>> Here is odbc.ini
>>> # cat /etc/unixODBC/odbc.ini
>>> [Test]
>>>        Description = Test database
>>>        Driver = SQLite
>>>        Database = /root/test.sqlite
>>>
>>> # odbcinst -q -s
>>> [Test]
>>>
>>> # cat /tmp/odbc.spencer.log
>>> [ODBC][19331][1346278438.061463][__handles.c][460]
>>>                Exit:[SQL_SUCCESS]
>>>                        Environment = 0x60c780
>>> [ODBC][19331][1346278438.061577][SQLAllocHandle.c][375]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60c780
>>> [ODBC][19331][1346278438.061629][SQLAllocHandle.c][493]
>>>                Exit:[SQL_SUCCESS]
>>>                        Output Handle = 0x60d080
>>> [ODBC][19331][1346278438.061681][SQLConnect.c][3700]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        Server Name = [Test][length = 4 (SQL_NTS)]
>>>                        User Name = [NULL]
>>>                        Authentication = [NULL]
>>> [ODBC][19331][1346278438.062822][SQLConnect.c][3908]Error: IM002
>>> [ODBC][19331][1346278438.062892][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fff8bebcdc0
>>>                        Native = 0x7fff8bebcdd8
>>>                        Message Text = 0x7fff8bebcbc0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff8bebcdde
>>> [ODBC][19331][1346278438.062954][SQLError.c][471]
>>>                Exit:[SQL_SUCCESS]
>>>                        SQLState = IM002
>>>                        Native = 0x7fff8bebcdd8 -> 0
>>>                        Message Text = [[unixODBC][Driver Manager]Data
>>> source name not found, and no default driver specified]
>>> [ODBC][19331][1346278438.063119][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fff8bebcdc0
>>>                        Native = 0x7fff8bebcdd8
>>>                        Message Text = 0x7fff8bebcbc0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff8bebcdde
>>> [ODBC][19331][1346278438.063156][SQLError.c][471]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19331][1346278438.063195][SQLError.c][514]
>>>                Entry:
>>>                        Environment = 0x60c780
>>>                        SQLState = 0x7fff8bebcdc0
>>>                        Native = 0x7fff8bebcdd8
>>>                        Message Text = 0x7fff8bebcbc0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff8bebcdde
>>> [ODBC][19331][1346278438.063232][SQLError.c][551]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19331][1346278438.063331][SQLFreeHandle.c][284]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60d080
>>> [ODBC][19331][1346278438.063378][SQLFreeHandle.c][333]
>>>                Exit:[SQL_SUCCESS]
>>> [ODBC][19331][1346278438.063417][SQLFreeHandle.c][219]
>>>                Entry:
>>>                        Handle Type = 1
>>>                        Input Handle = 0x60c780
>>> [ODBC][19340][1346278708.837567][__handles.c][460]
>>>                Exit:[SQL_SUCCESS]
>>>                        Environment = 0x60c780
>>> [ODBC][19340][1346278708.837688][SQLAllocHandle.c][375]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60c780
>>> [ODBC][19340][1346278708.837741][SQLAllocHandle.c][493]
>>>                Exit:[SQL_SUCCESS]
>>>                        Output Handle = 0x60d080
>>> [ODBC][19340][1346278708.837793][SQLConnect.c][3700]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        Server Name = [Test][length = 4 (SQL_NTS)]
>>>                        User Name = [NULL]
>>>                        Authentication = [NULL]
>>> [ODBC][19340][1346278708.839126][SQLConnect.c][3908]Error: IM002
>>> [ODBC][19340][1346278708.839214][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fff41e05be0
>>>                        Native = 0x7fff41e05bf8
>>>                        Message Text = 0x7fff41e059e0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff41e05bfe
>>> [ODBC][19340][1346278708.839276][SQLError.c][471]
>>>                Exit:[SQL_SUCCESS]
>>>                        SQLState = IM002
>>>                        Native = 0x7fff41e05bf8 -> 0
>>>                        Message Text = [[unixODBC][Driver Manager]Data
>>> source name not found, and no default driver specified]
>>> [ODBC][19340][1346278708.839444][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fff41e05be0
>>>                        Native = 0x7fff41e05bf8
>>>                        Message Text = 0x7fff41e059e0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff41e05bfe
>>> [ODBC][19340][1346278708.839481][SQLError.c][471]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19340][1346278708.839520][SQLError.c][514]
>>>                Entry:
>>>                        Environment = 0x60c780
>>>                        SQLState = 0x7fff41e05be0
>>>                        Native = 0x7fff41e05bf8
>>>                        Message Text = 0x7fff41e059e0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff41e05bfe
>>> [ODBC][19340][1346278708.839556][SQLError.c][551]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19340][1346278708.839655][SQLFreeHandle.c][284]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60d080
>>> [ODBC][19340][1346278708.839703][SQLFreeHandle.c][333]
>>>                Exit:[SQL_SUCCESS]
>>> [ODBC][19340][1346278708.839741][SQLFreeHandle.c][219]
>>>                Entry:
>>>                        Handle Type = 1
>>>                        Input Handle = 0x60c780
>>> [ODBC][19384][1346279417.344336][__handles.c][460]
>>>                Exit:[SQL_SUCCESS]
>>>                        Environment = 0x60c780
>>> [ODBC][19384][1346279417.344440][SQLAllocHandle.c][375]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60c780
>>> [ODBC][19384][1346279417.344494][SQLAllocHandle.c][493]
>>>                Exit:[SQL_SUCCESS]
>>>                        Output Handle = 0x60d080
>>> [ODBC][19384][1346279417.344581][SQLConnect.c][3700]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        Server Name = [Test][length = 4 (SQL_NTS)]
>>>                        User Name = [NULL]
>>>                        Authentication = [NULL]
>>> [ODBC][19384][1346279417.345924][SQLConnect.c][3908]Error: IM002
>>> [ODBC][19384][1346279417.346014][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fffa9cab1d0
>>>                        Native = 0x7fffa9cab1e8
>>>                        Message Text = 0x7fffa9caafd0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fffa9cab1ee
>>> [ODBC][19384][1346279417.346091][SQLError.c][471]
>>>                Exit:[SQL_SUCCESS]
>>>                        SQLState = IM002
>>>                        Native = 0x7fffa9cab1e8 -> 0
>>>                        Message Text = [[unixODBC][Driver Manager]Data
>>> source name not found, and no default driver specified]
>>> [ODBC][19384][1346279417.346306][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x60d080
>>>                        SQLState = 0x7fffa9cab1d0
>>>                        Native = 0x7fffa9cab1e8
>>>                        Message Text = 0x7fffa9caafd0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fffa9cab1ee
>>> [ODBC][19384][1346279417.346346][SQLError.c][471]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19384][1346279417.346387][SQLError.c][514]
>>>                Entry:
>>>                        Environment = 0x60c780
>>>                        SQLState = 0x7fffa9cab1d0
>>>                        Native = 0x7fffa9cab1e8
>>>                        Message Text = 0x7fffa9caafd0
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fffa9cab1ee
>>> [ODBC][19384][1346279417.346425][SQLError.c][551]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][19384][1346279417.346532][SQLFreeHandle.c][284]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x60d080
>>> [ODBC][19384][1346279417.346583][SQLFreeHandle.c][333]
>>>                Exit:[SQL_SUCCESS]
>>> [ODBC][19384][1346279417.346625][SQLFreeHandle.c][219]
>>>                Entry:
>>>                        Handle Type = 1
>>>                        Input Handle = 0x60c780
>>>
>>>
>>> On 8/30/2012 12:09 PM, Spencer Ogden wrote:
>>>> FWIW, I have now tried this on a 32-bit install of Gentoo with   
>>>> the  same results. Same exact config files, same error messages.
>>>>
>>>> Spencer
>>>>
>>>>
>>>> On 8/29/2012 7:14 PM, Spencer Ogden wrote:
>>>>>
>>>>> On 8/29/2012 7:02 PM, Nick Gorham wrote:
>>>>>> Check you have a 64 bit unixODBC.
>>>>>>
>>>>>> Then try
>>>>>>
>>>>>> ldd /usr/lib64/libsqlite3odbc.so
>>>>>>
>>>>>> To make sure it is not missing dependancies.
>>>>>>
>>>>>> or
>>>>>>
>>>>>> dltest /usr/lib64/libsqlite3odbc.so SQLConnect
>>>>>>
>>>>>> to see if it still loads.
>>>>>>
>>>>>
>>>>> Hi Nick, Thanks for your quick response.
>>>>>
>>>>> unixODBC was compiled on this machine, so I think it must be    
>>>>> 64-bit. Here is some output:
>>>>>
>>>>> # odbc_config --libs
>>>>> -L/usr/lib64 -lodbc
>>>>> # file `which isql`
>>>>> /usr/bin/isql: ELF 64-bit LSB executable, x86-64, version 1   
>>>>> (SYSV), dynamically linked (uses shared libs), for GNU/Linux    
>>>>> 2.6.9, stripped
>>>>> # ldd /usr/lib64/libsqlite3odbc.so
>>>>>       linux-vdso.so.1 (0x00007fff6a9ff000)
>>>>>       libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0 (0x00007f2fc0e61000)
>>>>>       libdl.so.2 => /lib64/libdl.so.2 (0x00007f2fc0c5d000)
>>>>>       libc.so.6 => /lib64/libc.so.6 (0x00007f2fc08b3000)
>>>>>       libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2fc0696000)
>>>>>       /lib64/ld-linux-x86-64.so.2 (0x00007f2fc1342000)
>>>>> # dltest /usr/lib64/libsqlite3odbc.so SQLConnect
>>>>> SUCCESS: Loaded /usr/lib64/libsqlite3odbc.so
>>>>> SUCCESS: Found SQLConnect
>>>>>
>>>>> _______________________________________________
>>>>> unixODBC-support mailing list
>>>>> unixODBC-support at mailman.unixodbc.org
>>>>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>>>>
>>>>
>>>> _______________________________________________
>>>> unixODBC-support mailing list
>>>> unixODBC-support at mailman.unixodbc.org
>>>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>>>
>>>
>>> _______________________________________________
>>> unixODBC-support mailing list
>>> unixODBC-support at mailman.unixodbc.org
>>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>> _______________________________________________
>> unixODBC-support mailing list
>> unixODBC-support at mailman.unixodbc.org
>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the unixODBC-support mailing list