You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check for LIBMYSQL_VERSION, if it exists we are linking against the
connector library, otherwise, use MYSQL_SERVER_VERSION as before
added preprocessor variable to track connector library version
* compatability with mysql-connector-c, where LIBMYSQL_VERSION is the correct
29
+
* variable to use, but MYSQL_SERVER_VERSION gives the correct numbers when
30
+
* linking against the server itself
31
+
*/
32
+
#ifdefLIBMYSQL_VERSION
33
+
#defineMYSQL_LINK_VERSION LIBMYSQL_VERSION
34
+
#else
35
+
#defineMYSQL_LINK_VERSION MYSQL_SERVER_VERSION
36
+
#endif
37
+
27
38
/*
28
39
* used to pass all arguments to mysql_real_connect while inside
29
40
* rb_thread_blocking_region
@@ -740,14 +751,15 @@ void init_mysql2_client() {
740
751
inti;
741
752
intdots=0;
742
753
constchar*lib=mysql_get_client_info();
743
-
for (i=0; lib[i] !=0&&MYSQL_SERVER_VERSION[i] !=0; i++) {
754
+
755
+
for (i=0; lib[i] !=0&&MYSQL_LINK_VERSION[i] !=0; i++) {
744
756
if (lib[i] =='.') {
745
757
dots++;
746
758
// we only compare MAJOR and MINOR
747
759
if (dots==2) break;
748
760
}
749
-
if (lib[i] !=MYSQL_SERVER_VERSION[i]) {
750
-
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);
761
+
if (lib[i] !=MYSQL_LINK_VERSION[i]) {
762
+
rb_raise(rb_eRuntimeError, "Incorrect MySQL client library version! This gem was compiled for %s but the client library is %s.", MYSQL_LINK_VERSION, lib);
0 commit comments