Re: [Sqlrelay-discussion] Patch to fix MySQL auto-reconnect (MYSQL_OPT_RECONNECT option)
Brought to you by:
mused
|
From: a. k. <kl...@fd...> - 2008-02-19 14:48:15
|
Renaud, On Mon, 2008-02-11 at 18:05 -0800, Renaud Amar wrote: > I wrote a small patch which fixes an issue I’ve noticed with the SQL > Relay connection daemons for MySQL: > > the connection daemon doesn’t automatically reconnect to the MySQL > database once it’s been disconnected (either when restarting mysqld or > when the connection times out). I’ve also noticed that after being > disconnected, the connection daemon usually gets stuck in a weird loop > where it keeps trying to unsuccessfully send a query over and over. We have the same issue here, and I wanted to give it a shot. > > After looking through the mysql connection daemon code, I noticed that > the code that is supposed to enable the MYSQL_OPT_RECONNECT option > (in mysqlconnection.h and mysqlconnection.C) was ifdef’ed using a > different #define symbol as the one used in the config.h file. > Namely, it’s using “#ifdef MYSQL_OPT_RECONNECT” while config.h defines > “HAVE_MYSQL_OPT_RECONNECT”. Thanks for the finding, > This patch simply modifies mysqlconnection.h and mysqlconnection.C to > use HAVE_MYSQL_OPT_RECONNECT. but the patched source does perfectly compile on i386, but not on x86_64 arch. It fails with following error: make[3]: Leaving directory `src/connections/status' make -C mysql all make[3]: Entering directory `src/sqlrelay_patch/4/src/connections/mysql' /bin/sh ../../../libtool --mode=compile g++ -Wall -pipe -pthread -I./ -I../../../ -I../../../src/common -I../../../src/util -I../../../src/connection -I/usr/local/include -pthread -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -I../../../src/api/c++/include -c mysqlconnection.C -o mysqlconnection.lo mkdir .libs g++ -Wall -pipe -pthread -I./ -I../../../ -I../../../src/common -I../../../src/util -I../../../src/connection -I/usr/local/include -pthread -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -I../../../src/api/c++/include -c mysqlconnection.C -fPIC -DPIC -o .libs/mysqlconnection.o mysqlconnection.C:19: error: 'TRUE' was not declared in this scope make[3]: *** [mysqlconnection.lo] Fehler 1 make[3]: Leaving directory `src/sqlrelay_patch/4/src/connections/mysql' make[2]: *** [all] Fehler 2 make[2]: Leaving directory `src/sqlrelay_patch/4/src/connections' make[1]: *** [all] Fehler 2 make[1]: Leaving directory `src/sqlrelay_patch/4/src' make: *** [all] Fehler 2 Any suggestions on this? regards, k |