Missing SQL drivers in libQtSql.so

Bug #178084 reported by Michal Sylwester
10
Affects Status Importance Assigned to Milestone
qt4-x11 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: libqt4-sql

libqt4-sql 4.3.3-0ubuntu2 on amd64 is missing SQL drivers (-ubuntu1 seems to be fine):
Simple qt program shows:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:

Sizes of ubuntu2 vs ubuntu1:
libqt4-sql_4.3.3-0ubuntu1_amd64.deb (153.4 KiB) - this seems to be fine
libqt4-sql_4.3.3-0ubuntu2_amd64.deb (91.8 KiB)

According to file sizes the i386 version may be also affected (I haven't looked inside)

ldd /usr/lib/libQtSql.so.4 (from libqt4-sql_4.3.3-0ubuntu1 - note references to libmysqlclient, libsqlite and libsqlite3)
        linux-vdso.so.1 => (0x00007fff0adfe000)
        libpq.so.5 => /usr/lib/libpq.so.5 (0x00002afea00cd000)
        libmysqlclient_r.so.15 => /usr/lib/libmysqlclient_r.so.15 (0x00002afea02ef000)
        libsqlite.so.0 => /usr/lib/libsqlite.so.0 (0x00002afea0702000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00002afea095f000)
        libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00002afea0bcb000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00002afea0f6e000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00002afea119f000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00002afea13b6000)
        librt.so.1 => /lib/librt.so.1 (0x00002afea15bc000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00002afea17c5000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002afea1a84000)
        libdl.so.2 => /lib/libdl.so.2 (0x00002afea1ca1000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00002afea1ea5000)
        libm.so.6 => /lib/libm.so.6 (0x00002afea21b0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00002afea2432000)
        libc.so.6 => /lib/libc.so.6 (0x00002afea2640000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00002afea29a2000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00002afea2bed000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00002afea2f6d000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x00002afea320a000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002afea340d000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00002afea3645000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00002afea385f000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002afea3ade000)
        libselinux.so.1 => /lib/libselinux.so.1 (0x00002afea3d02000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0x00002afea3f1c000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00002afea4141000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00002afea4367000)
        libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00002afea456f000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00002afea4771000)
        libsepol.so.1 => /lib/libsepol.so.1 (0x00002afea4988000)

ldd /usr/lib/libQtSql.so.4 (from libqt4-sql_4.3.3-0ubuntu2 - note no references of any sql libraries)
        linux-vdso.so.1 => (0x00007fff5fdfe000)
        libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00002b5f4af37000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00002b5f4b2d9000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00002b5f4b50b000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00002b5f4b722000)
        librt.so.1 => /lib/librt.so.1 (0x00002b5f4b927000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00002b5f4bb31000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002b5f4bdf0000)
        libdl.so.2 => /lib/libdl.so.2 (0x00002b5f4c00c000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00002b5f4c211000)
        libm.so.6 => /lib/libm.so.6 (0x00002b5f4c51c000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00002b5f4c79d000)
        libc.so.6 => /lib/libc.so.6 (0x00002b5f4c9ac000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00002b5f4cd0e000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00002b5f4cf8d000)
        libselinux.so.1 => /lib/libselinux.so.1 (0x00002b5f4d1b2000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0x00002b5f4d3cb000)
        libsepol.so.1 => /lib/libsepol.so.1 (0x00002b5f4d5f1000)

Revision history for this message
Michal Sylwester (msylwester) wrote :

I've played with this a little more, and I've managed to find a workaround and compile this package with drivers...

The short story:
My workaround was to change the first line of configure script to execute it using bash instead of sh (which is actually dash).

The long story:
I've found out the the problem is that the configure script is unable to find available sql drivers. With no drivers available the request (passed as configure argument) to build some of them is ignored.

It can be easily checked whether the drivers will be built without waiting for it to finish: either by checking the last lines of .qmake.cache - drivers will be built if they are listed in like like this:
sql-drivers = mysql psql sqlite sqlite2
or even before starting build by running "configure --help" - available drivers are listed as:
    -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
                         at run time.

                         Possible values for <driver>:
                         [ ibase mysql odbc psql sqlite sqlite2 ]

When I simply run apt-get source -b libqt4-sql both lists are empty.

I've found this is caused by this lines in configure script (starting at line 677):
CFG_SQL_AVAILABLE=
if [ -d "$relpath/src/plugins/sqldrivers" ]; then
  for a in "$relpath/src/plugins/sqldrivers/"*; do
     if [ -d "$a" ]; then
  base_a=`basename $a`
    CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
  eval "CFG_SQL_${base_a}=auto"
     fi
  done
fi

For some reason the for loop instead of looping over all entries in the sqldrivers directory loops over one value "$relpath/src/plugins/sqldrivers/*" (with $relpath replaced as expected). This is later found to not be a valid driver directory, so the list ends up empty.

Now, I still have no idea why it worked fine for previous builds - I wasn't able to take a look at how the build worked there, and changelog indicates no changes in this area. As such I'm not really sure this workaround can be used as long-term solution, but I hope it will help to get this working.
My best guesses are:
- different interpreter was used
- something changed in dash (there was a new release recently, between the releases of liqt4-sql)

Revision history for this message
muesli (muesli) wrote :

i can confirm that this problem is due to dash. using bash as the configure script's interpreter fixing the issue.

Revision history for this message
rp (peinthor) wrote :

this problem still exists in the hardy heron packages

Revision history for this message
Michal Sylwester (msylwester) wrote :

Seems to be fixed in libqt4-sql-4.3.4

Revision history for this message
rp (peinthor) wrote :

yes it is

Changed in qt4-x11:
status: New → Fix Released
Revision history for this message
zcat (zcat) wrote :

Is this a duplicate of bug #193808 which causes mumble to not run?

I suspect it isn't because I just installed mumble, afaik everything is up to date (A few days ago at most, certainly way more recent than 2008-03-01), and mumble still failed to run (QSqlDatabase: QSQLITE driver not loaded) until I installed libqt4-sql-sqlite

are libsql and libsqlite supposed to be the same thing?

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.