mysqlplus icon indicating copy to clipboard operation
mysqlplus copied to clipboard

lib/mysql.so: undefined symbol: vio_blocking

Open tadman opened this issue 13 years ago • 8 comments

When compiled on Fedora 14 under Ruby 1.9 (p180 and p290) it will throw an exception that looks like this:

ruby: symbol lookup error: /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysqlplus-0.1.2/lib/mysql.so: undefined symbol: vio_blocking

What's unusual is that vio_blocking is actually not a function but a macro expressed as a #define in MySQL in violite.h.

The relevant part of mysql.c has this:

#ifdef HAVE_MYSQL_H
#include <mysql.h>
#include <mysql_com.h>
//#include <violite.h>
#include <errmsg.h>
#include <mysqld_error.h>
#else
#include <mysql/mysql.h>
#include <mysql/mysql_com.h>
//#include <mysql/violite.h>
#include <mysql/errmsg.h>
#include <mysql/mysqld_error.h>
#endif

You can see violite.h is specifically commented out and appears to be the source of this problem. It's not clear why this works on OS X but not Linux.

tadman avatar Aug 02 '11 22:08 tadman

It looks like violite.h was present in earlier versions of MySQL 5.1, but is entirely absent in newer ones.

I think the vio_blocking method has been removed entirely in MySQL 5.5:

mysql  Ver 14.14 Distrib 5.5.14, for Linux (i686) using readline 5.1

tadman avatar Aug 02 '11 22:08 tadman

any workarounds regarding this issue?

vanjabucic avatar Feb 18 '13 19:02 vanjabucic

I made it work by commenting out code from static void optimize_for_async( VALUE obj )

what did that function really do?

vanjabucic avatar Feb 18 '13 21:02 vanjabucic

Seeing the same issue on OSX Mountain Lion with mysql 5.6 and ruby 2.0 installed through home brew:

dyld: lazy symbol binding failed: Symbol not found: _vio_blocking Referenced from: /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/mysqlplus-0.1.2/lib/mysql.bundle Expected in: flat namespace

Is these a workaround for this?

bassam avatar May 12 '13 19:05 bassam

Use the mysql2 gem.

tmm1 avatar May 12 '13 23:05 tmm1

People would if mysql2 supported prepared statements.

vanjabucic avatar Mar 03 '14 17:03 vanjabucic

I have the same problem on OS X Mavericks, using MySQL 5.6.13 and Ruby 2.0. Very annoying. :-( Could anyone who found a workaround describe it in more detail? Or is there a way we could fix this via a pull request?

PrimaryFeather avatar Apr 30 '14 07:04 PrimaryFeather

For OS X users who run into this problem: if you don't depend on using the very latest MySQL version, you can switch back to older version; for me, 5.5.27 worked well. If you're using homebrew, this Stack Overflow answer shows you how to switch back to such a version.

Of course, that's just a temporary workaround, but perhaps it helps someone.

PrimaryFeather avatar Apr 30 '14 08:04 PrimaryFeather