Bug #44652 Test database connection fails with out of memory error
Submitted: 4 May 2009 20:09 Modified: 27 May 2009 16:57
Reporter: F N Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.0 Beta OS:Linux (ArchLinux)
Assigned to: Sergei Tkachenko CPU Architecture:Any
Tags: client, connect, Memory

[4 May 2009 20:09] F N
Description:
I just downloaded the sources for workbench 5.2.0 Beta and compiled it. It loads up fine (some windows need resizing because they don't display everything). I tried to add a connection, which fails at the point when I want to "test connection": "Cannot connect to database server: Connection 'localhost' could not be established: MySQL client ran out of memory."

But there is enough memory available, and I can login into my MySQL server without any problem from the command line mysql tool.

How to repeat:
Add new connection.
Test connection.
[4 May 2009 21:37] MySQL Verification Team
Thank you for the bug report. Are you tried the package binaries instead to compile it?. Thanks in advance.
[5 May 2009 1:28] F N
No I did not try the binaries, as they were only in Debian or RPM format and in that case it was easier for me to just compile the source.
[5 May 2009 9:57] Valeriy Kravchuk
I can't repeat this with our binaries on Ubuntu 8.04. Should be something platfrom/compilation specific.
[5 May 2009 11:57] Kirill M.
I have same bug on Debian/Sid with mysql 5.0.77. And i use Ubuntu 8.04(x32) package.
[5 May 2009 21:48] Kevin McLaughlin
Same issue on Fedora Core 8 (yes, I know it's old):

mysql-server-5.0.45-6.fc8
mysql-devel-5.0.45-6.fc8
mysql-connector-odbc-3.51.14r248-2.fc8
mysql-libs-5.0.45-6.fc8
mysql-5.0.45-6.fc8

built from src.
[12 May 2009 21:35] Luis Daniel Ibáñez
Hi there,

Same trouble over here, debian Lenny, i used the ubuntu 8.04 .deb (x32). and its installation instructions

The situation reported by F N happens to me while trying to connect to localhost, i tried a remote server and the application hangs badly (must force quit), in this case, seems to be because it cant connect to server more than a memory trouble.

Cheers
[13 May 2009 17:23] Sergei Tkachenko
Guys, since WB 5.2 feature set relies on standalone MySQL Connector/C++ library (which is in beta stage atm) please don't dare to compile it seprately and see if it helps. You can find sources here: http://dev.mysql.com/downloads/connector/cpp/ (official releases) and here: https://launchpad.net/mysql-connector-cpp (development trunk). It requires CMake to be built.
Just replace mysqlcppconn library located in /usr/local/lib/mysql-workbench (or path appropriate to your machine/installation) with one compiled yourself.
[13 May 2009 17:50] Sergei Tkachenko
Please also try to compile & run tests from Connector/C++ package on your box. If same problem there then please report a bug for MySQL Connector/C++.
[13 May 2009 19:45] Luis Daniel Ibáñez
Hi Sergei, will try that at soon as possible.

Just to mention that my case the problem is with the .deb of 5.1.12-1, and not the 5.2.0 as reported by F N
[14 May 2009 12:47] Sergei Tkachenko
Latest 5.1.12 version contains same sources of Connector/C++ as 5.2 does.
The key points are:
1) mentioned WB versions contain _development_snapshot_ of connector source tree;
2) WB source tree uses makefile (not cmake as apposed to original package) to build connector lib. Theoretically we could mistakenly omit some significant detail when writing makefile, which lead to subtle bug.
[14 May 2009 14:23] Kevin McLaughlin
Built 1.0.5 as well as rev 649 from trunk of the c++ connector and replaced mysqlcppconn.so w/ libmysqlcppconn.so in libs/mysql-workbench/.

Does not seem to help.

gcc-c++-4.1.2-33

$ pmap 27755 | grep libmysql
01172000   1164K r-x--  /usr/lib/mysql/libmysqlclient_r.so.15.0.0
01295000    264K rwx--  /usr/lib/mysql/libmysqlclient_r.so.15.0.0
02c0c000    660K r-x--  /apps/mysql-workbench-oss-5.2.0/lib/mysql-workbench/libmysqlcppconn.so
02cb1000     36K rwx--  /apps/mysql-workbench-oss-5.2.0/lib/mysql-workbench/libmysqlcppconn.so
[14 May 2009 14:33] Kevin McLaughlin
Driver tests (trunk, rev 649):

$ ./driver_test localhost root '' | tail -5
# 
#---------------  2 -----------------
ok 2 - driver_test_unknown_loop2

# Loops= 2 Tests=  792 Failures=   0
[14 May 2009 15:44] Sergei Tkachenko
Kevin, I forgot about headers used by WB. Please copy over all existing header/source files (only *.cpp;*.h) from connector source tree to ext/cppconn/ subdir of WB sources. And run `make` as usual afterwards. No need to replace built libmysqlcppconn.so after this - they'll be equivalent.
Please also attach config.h from your connector source tree (created after running cmake).
[14 May 2009 21:51] Kevin McLaughlin
Did not seem to help.

I replaced all .h and .cpp files in:

ext/cppconn/cppconn/
ext/cppconn/driver/

and did a full rebuild of the workbench.

Will attach config.h from from the connector.
[14 May 2009 21:54] Kevin McLaughlin
config.h

Attachment: config.h (application/octet-stream, text), 2.01 KiB.

[16 May 2009 0:34] Sergei Tkachenko
Bug was verified & fixed in local repository.
Below I will attach fixes for versions 5.1.12 & 5.2.0a. Copy files from archives over WB sources directory & do `make; make install`. No matter what Connector/C++ you have installed. The problem was in WB itself.
[16 May 2009 0:35] Sergei Tkachenko
fix for 5.1.12

Attachment: wb-5.1.12_fix44652.tar.gz (application/gzip, text), 2.13 KiB.

[16 May 2009 0:36] Sergei Tkachenko
fix for 5.2.0a

Attachment: wb-5.2.0a_fix44652.tar.gz (application/gzip, text), 2.20 KiB.

[18 May 2009 10:39] Susanne Ebrecht
Bug #44527 is set as duplicate of this bug here.
[19 May 2009 16:26] Riccardo Santoro
console log

Attachment: mysql-workbench.log (application/octet-stream, text), 63.42 KiB.

[19 May 2009 16:28] Riccardo Santoro
doesn't work yet on sabayon 2.6.29

compiled from source with fix
[20 May 2009 12:57] Sergei Tkachenko
Sorry guys, there was another issue I missed out, and revised fix is quite hard to isolate and paste it here. Anyway nearest days there will be a new alpha release of 5.2 including fix for this bug. Keep an eye on announces.
[25 May 2009 21:03] Luis Daniel Ibáñez
Hi Sergei,

Just to add that i tried the 5.2.0a ubuntu 8.04 .deb in my debian lenny box, and the bug doesn't reproduce.

I will wait for further versions,

thanks in advance for your hard work.
[26 May 2009 12:15] Riccardo Santoro
seems to be fixed in 5.2.1
[27 May 2009 16:57] Michael G. Zinner
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/

Fixed in 5.2.0