Undefined reference to SQLCancelHandle

Bug #1765762 reported by Guillaume
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unixodbc (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

The header file of the package got the definition of the SQLCancelHandle function but the linkable library doesn't implement it.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hmm,
I see that sql.h indeed has that define:
605 #if (ODBCVER >= 0x0380)
606 SQLRETURN SQL_API SQLCancelHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle);
607 #endif·

And while makefile as well as DriverManager/SQLCancelHandle.c look as if they'd provide that they don't.

On build it is compiled and linked:
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -c -o SQLCancelHandle.lo SQLCancelHandle.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -c SQLCancelHandle.c -fPIC -DPIC -o .libs/SQLCancelHandle.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -c SQLCancelHandle.c -o SQLCancelHandle.o >/dev/null 2>&1

I never used this lib on my own, so I might something trivial as "this has to be used differently" that I miss.

It is not shown in the symbols file either.

Wait - doesn't this depend on the target actually supporting it.
I think you can run "SQLGetFunctions" to list if that is supposed to work after you have set up your connection.

Let me fall back ignoring myself trying to understand.
Just checking the lib indeed does not list the function.

root@b:~# nm -D /usr/lib/x86_64-linux-gnu/libodbc.so.2 | grep -i handle
00000000000078f0 T SQLAllocHandle
0000000000007900 T SQLAllocHandleStd
0000000000018620 T SQLFreeHandle
root@b:~# nm -D /usr/lib/x86_64-linux-gnu/libodbc.so.1 | grep -i handle
00000000000078f0 T SQLAllocHandle
0000000000007900 T SQLAllocHandleStd
0000000000018620 T SQLFreeHandle

Also with debug symbols installed and objdump -dgS on the .so I can't find it.

So yes, it is defined but not there.
But since I lack to see yet why (as it is built and linked) I fail to suggest a good solution.

I found [1] which calls it a bug as well in Ubuntu/Debian - hmm.
But there is no clear call what should be different.
And OTOH some comments refer to driver dependencies as well as need to set odbc version.
Per Name I'd assume that is your entry there - which "better deb packages" do you mean.
As by checking what is different there we could derive what is wrong.
So which other .deb did you mean?

[1]: https://stackoverflow.com/questions/49771613/undefined-reference-to-sqlcancelhandle

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Setting incomplete to learn of these "other debs" that work better referred to in the stackoverflow question.

Changed in unixodbc (Ubuntu):
status: New → Incomplete
Revision history for this message
Guillaume (guignomes) wrote : Re: [Bug 1765762] Re: Undefined reference to SQLCancelHandle

In fact I though a newer version of the .deb would fix the problem but the
dependencies of the unstable .deb files makes the trick unapplicable.
Also I not very familiar with debian package management.
To explain you my point of view of the problem:
You have the API that implement all the function available in the sql.h
file. And then the driver implement or not the feature.
So when a driver don't implement a function you don't get a undefined
reference but a [driver-manager] error.
If you got an undefined reference, it means that the linkable odbc library
doesn't implement the function.
I also didn't find any people complaining about this on the internet, so I
don't know if there is an other way to compile to use this function or if
something is missing in the package.
But I came to the idea it was a bug from the package.

Regards Guillaume

On 24 April 2018 at 12:34, ChristianEhrhardt <email address hidden>
wrote:

> Setting incomplete to learn of these "other debs" that work better
> referred to in the stackoverflow question.
>
> ** Changed in: unixodbc (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1765762
>
> Title:
> Undefined reference to SQLCancelHandle
>
> Status in unixodbc package in Ubuntu:
> Incomplete
>
> Bug description:
> The header file of the package got the definition of the
> SQLCancelHandle function but the linkable library doesn't implement
> it.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/
> 1765762/+subscriptions
>

Revision history for this message
Guillaume (guignomes) wrote :

From where repo do you get the source of the unixODBC for this deb version?

I found this unixODBC source repo:
https://fossies.org/linux/privat/unixODBC-2.3.6.tar.gz/
And in this repo, SQLCancelHandle is implemented and is in the compilation
PATH.

Regards Guillaume

On 24 April 2018 at 13:16, Guillaume MILAN <email address hidden> wrote:

> In fact I though a newer version of the .deb would fix the problem but the
> dependencies of the unstable .deb files makes the trick unapplicable.
> Also I not very familiar with debian package management.
> To explain you my point of view of the problem:
> You have the API that implement all the function available in the sql.h
> file. And then the driver implement or not the feature.
> So when a driver don't implement a function you don't get a undefined
> reference but a [driver-manager] error.
> If you got an undefined reference, it means that the linkable odbc library
> doesn't implement the function.
> I also didn't find any people complaining about this on the internet, so I
> don't know if there is an other way to compile to use this function or if
> something is missing in the package.
> But I came to the idea it was a bug from the package.
>
> Regards Guillaume
>
> On 24 April 2018 at 12:34, ChristianEhrhardt <email address hidden>
> wrote:
>
>> Setting incomplete to learn of these "other debs" that work better
>> referred to in the stackoverflow question.
>>
>> ** Changed in: unixodbc (Ubuntu)
>> Status: New => Incomplete
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1765762
>>
>> Title:
>> Undefined reference to SQLCancelHandle
>>
>> Status in unixodbc package in Ubuntu:
>> Incomplete
>>
>> Bug description:
>> The header file of the package got the definition of the
>> SQLCancelHandle function but the linkable library doesn't implement
>> it.
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/1765
>> 762/+subscriptions
>>
>
>

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

That is the new releases tarball, but as I said the source we still use 2.3.4-1.1ubuntu3 is
a) the same as in unstable, so no need to pull that
b) having the source for the function you miss
c) compiling and linking the file with the function on build - look for SQLCancelHandle in [1] if you want

For silly comparisons I took a Fedora unixodbc turns out it is the same there.
I slowly tend more to the "None of the two of us understand how this 'should' work" assumption.

[1]: https://launchpadlibrarian.net/362147967/buildlog_ubuntu-bionic-amd64.unixodbc_2.3.4-1.1ubuntu3_BUILDING.txt.gz

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for unixodbc (Ubuntu) because there has been no activity for 60 days.]

Changed in unixodbc (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.