severity 803222 grave
tag 803222 + patch
thanks

After more careful look at this bug, the problem is entirely within
ruby-mysql and its handling of MySQL versions. Debian does not work
the way this software thinks. Needless to say, the entire MySQL
version check currently results in complete breaking of ruby-mysql on
testing and sid, requiring a rebuild.

Furthermore, rebuilding does not fix the bug at root of the
problem. If MySQL get upgraded to another minor version while keeping
its soname as is (ie. ABI doesn't change), ruby-mysql will break
again.

The attached patch removes this broken version checking.

- Adam
diff --git a/ext/mysql_api/mysql.c b/ext/mysql_api/mysql.c
index 1bd2268..98b65d0 100644
--- a/ext/mysql_api/mysql.c
+++ b/ext/mysql_api/mysql.c
@@ -1905,21 +1905,6 @@ static VALUE error_sqlstate(VALUE obj)
 
 void Init_mysql_api(void)
 {
-    int i;
-    int dots = 0;
-    const char *lib = mysql_get_client_info();
-    for (i = 0; lib[i] != 0 && MYSQL_SERVER_VERSION[i] != 0; i++) {
-        if (lib[i] == '.') {
-            dots++;
-            /* we only compare MAJOR and MINOR */
-            if (dots == 2) break;
-        }
-        if (lib[i] != MYSQL_SERVER_VERSION[i]) {
-            rb_raise(rb_eRuntimeError, "Incorrect MySQL client library version! This gem was compiled for %s but the client library is %s.", MYSQL_SERVER_VERSION, lib);
-            return;
-        }
-    }
-
     cMysql = rb_define_class("Mysql", rb_cObject);
     cMysqlRes = rb_define_class_under(cMysql, "Result", rb_cObject);
     cMysqlField = rb_define_class_under(cMysql, "Field", rb_cObject);

Reply via email to