List:MySQL++« Previous MessageNext Message »
From:Jason Toffaletti Date:August 23 2010 8:48am
Subject:mysql++ 3.1.0 upgrade issues
View as plain text  
I have some code that was working in 3.0.9 that is throwing an exception
after I compile against 3.1.0. The exception message is: "Not enough
parameters to fill the template."

Backtrace:

#1  0x00007ffff6d6bfb8 in mysqlpp::Query::proc (this=<value optimized out>,
p=...) at ./lib/query.cpp:446
#2  0x00007ffff6d6c059 in mysqlpp::Query::str (this=0x7fffffffd460, p=...)
at ./lib/query.cpp:610
#3  0x00007ffff6d6c1af in mysqlpp::Query::use (this=0x7ffff6f8f540, p=...)
at ./lib/query.cpp:629
#4  0x00007ffff6d6c0ef in mysqlpp::Query::use (this=0x7fffffffd460, s=...)
at ./lib/query.cpp:642

The code looks something like this:

mysqlpp::Query q = c->query();
q << "SELECT T0.a, T0.b FROM table T0 WHERE c=%0q AND d=%1q";
q.parse();
q.storein(rows, c, d);

As soon as I remove the query template parameters, the exception goes away.
I am building mysql++ and my application with:

$ g++ --version
g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1



My second issue is when using mysql 3.1.0, I got this exception:

"Option can only be set while the connection is established"

while setting ReconnectOption. So I changed my code to call set_option after
reconnect, despite reconnect working fine when I was setting it before
connect. Then I had to switch back to 3.0.9 because of the query template
problem explain above and my program started segfaulting:

#0  0x00007ffff6d60e36 in mysqlpp::Connection::set_option(mysqlpp::Option*)
() from /usr/lib/libmysqlpp.so.3

The segfault went away when I moved the call to set_option ReconnectOption
back to its previous location, before connect.

The exception you've added in 3.1.0 for ReconnectOption is telling me to do
something that actually breaks code that was working fine.

My versions:
Server version: 5.1.45-51-log Percona SQL Server (GPL), XtraDB 10

$ aptitude show libmysqlclient15-dev


Package: libmysqlclient15-dev


State: installed


Automatically installed: yes


Version: 5.1.30really5.0.83-0ubuntu3


Finally, could you please add configure options for static and shared.
Typically libtoolized autoconf projects provide --enable/disable-static
--enable/disable-shared options for configure.

Thanks,
Jason T.

Thread
mysql++ 3.1.0 upgrade issuesJason Toffaletti23 Aug
  • Re: mysql++ 3.1.0 upgrade issuesWarren Young23 Aug
Re: mysql++ 3.1.0 upgrade issuesJason Toffaletti23 Aug
  • Re: mysql++ 3.1.0 upgrade issuesWarren Young23 Aug
Re: mysql++ 3.1.0 upgrade issuesJason Toffaletti24 Aug
  • Re: mysql++ 3.1.0 upgrade issuesWarren Young24 Aug