[odb-users] Problem connecting a mysql server

niermann at informatik.uni-tuebingen.de niermann at informatik.uni-tuebingen.de
Wed May 16 06:50:33 EDT 2012


Hello Boris,

thank you for your help so far. Now that you told me the right driver I
was able to trace the stack.

On 15.05.2012 20:05, Boris Kolpackov wrote:
> Hi Peter,
>
> niermann at informatik.uni-tuebingen.de
<niermann at informatik.uni-tuebingen.de> writes:
>
>> ./driver --options-file ../../db.options
>> BEGIN
>> INSERT INTO `auto_object` (`id`,`str`) VALUES (?,?)
>> INSERT INTO `auto_object` (`id`,`str`) VALUES (?,?)
>> INSERT INTO `auto_object` (`id`,`str`) VALUES (?,?)
>> COMMIT
>> BEGIN
>> SELECT `auto_object`.`id`,`auto_object`.`str` FROM `auto_object` WHERE
>> `auto_object`.`id`=?
>> ROLLBACK
>> ./../../tester: line 35: 28986 Segmentation fault      (core dumped)
> I assume you modified the driver to trace the SQL statement execution.
> Based on that last ROLLBACK line, I think that an exception is thrown
> (this ROLLBACK is caused by the transaction object's destructor being
> called when the stack is unwound).
>
> Can you run gdb on the driver and core file (the actual executable is
> .libs/lt-driver) and send the stack trace (once in gdb, run the 'bt'
> command):
>
> gdb .libs/lt-driver core
>
Here comes the stacktrace:

#0  mysql_send_query (mysql=0x0, query=0x2ada3e9aaa2f "rollback",
length=8) at
/export/home2/tmp/cteam/bs/connector-c-64bit/src/mysql-connector-c-6.0.2/libmysql/client.c:2899
#1  0x00002ada3f35f339 in mysql_real_query (mysql=0x0,
query=0x2ada3e9aaa2f "rollback", length=8) at
/export/home2/tmp/cteam/bs/connector-c-64bit/src/mysql-connector-c-6.0.2/libmysql/client.c:2910
#2  0x00002ada3f360879 in mysql_query (mysql=0x0, query=0x2ada3e9aaa2f
"rollback") at
/export/home2/tmp/cteam/bs/connector-c-64bit/src/mysql-connector-c-6.0.2/libmysql/libmysql.c:790
#3  0x00002ada3e9a541d in odb::mysql::transaction_impl::rollback
(this=0xc18e9e0) at transaction-impl.cxx:91
#4  0x00002ada3ebbac7d in ~transaction (this=0x7fff09383430) at
transaction.cxx:24
#5  0x0000000000000003 in ?? ()
#6  0x00000000004024f6 in odb::database::load<object> (this=<value
optimized out>, id=<value optimized out>) at
/home/niermann/libodb-2.0.0/odb/database.txx:64
#7  0x000000000c1a81a0 in ?? ()
#8  0x0000000000402b79 in main (argc=3, argv=<value optimized out>) at
driver.cxx:58
Current language:  auto; currently c

I used the mysql-connector-c-6.0.2-linux-glibc2.3-x86-64bit as mysql-library.

>> I tried it for a 64bit linux machine with a 2.6.18-238.5.1.el5 kernel and
>> compiled the odb-tests with gcc (GCC) 4.6.1.
> I assume you installed unixODBC-2.3.1 and Microsoft's Native Client driver
> for Linux? See this blog post for more information:
>
> http://www.codesynthesis.com/~boris/blog/2011/12/02/microsoft-sql-server-odbc-driver-linux/

As far as I understand the unixODBC lib is only needed when connecting to
a Microsoft-SQL server. We are running a linux MySQL server:
Server version:         5.1.38-log Source distribution

Since the odb-tests are working perfect when run on an ubuntu machine
which connects to the same database I don't think it is an issue with the
database server.
The mysql server listens on the port 3307 since it is our instance for
testing. On the standard port runs the productive server. May this be
problematic?

Another point is, that Qt querries to the same database are working
correctly.
Further help is much apprechiated.

Peter

>> May this be related to the old kernel?
> No, I don't think it is related to the kernel version. One thing that would
> be helpful to know is the version of SQL Server you are connecting to.
>
> Boris





More information about the odb-users mailing list