Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql 5.7 support #548

Closed
OpenCoderX opened this issue Oct 13, 2014 · 14 comments
Closed

Mysql 5.7 support #548

OpenCoderX opened this issue Oct 13, 2014 · 14 comments

Comments

@OpenCoderX
Copy link

5.7 has some nice improvements, it would be great to see support in mysql2.

@simi
Copy link
Contributor

simi commented Oct 13, 2014

Are there any known problems? I'll try to setup CI for MySQL 5.7

@peterc
Copy link

peterc commented Oct 13, 2014

Not a lot of details yet but I've come across this issue as I've been unable to get MySQL 5.7 and mysql2 working together. The error?

NameError: uninitialized constant Mysql2::Client::SECURE_CONNECTION

@sodabrew
Copy link
Collaborator

It's possible that CLIENT_SECURE_CONNECTION was removed from MySQL 5.7.

Idea #1: If SECURE_CONNECTION is not defined in the mysql header file, define it as 0 in mysql2 in client.c here:
https://github.com/brianmario/mysql2/blob/master/ext/mysql2/client.c#L1378

Pros:

  • 0 is an identity for bitwise OR, so foo | 0 | bar is just like foo | bar.
  • If anybody has copied our default flags code, they won't have to change anything.
  • We don't have to change our default flags, so this feature still works on older MySQL while being transparent to newer MySQL.

Cons:

  • The value isn't actually 0, it's cheating.

Idea #2: Add some logic to check if this variable is defined before setting it in the connection flags in client.rb here:
https://github.com/brianmario/mysql2/blob/master/lib/mysql2/client.rb#L12

Pros:

  • If MySQL doesn't provide this feature, neither do we.

Cons:

  • Other people may have copied our default flags code and will have to change to match.

@simi
Copy link
Contributor

simi commented Oct 15, 2014

Basic CI setup for MySQL 5.7 is done (CI, commit, based on). I can prepare PR and add it into allowed failures for now. @sodabrew

@sodabrew
Copy link
Collaborator

Awesome! Yes please for a PR for this.

@simi
Copy link
Contributor

simi commented Oct 16, 2014

@peterc @sodabrew that missing constant is related to this change.

@simi
Copy link
Contributor

simi commented Oct 16, 2014

@sodabrew simple change to 0 is not working.

@peterc
Copy link

peterc commented Oct 16, 2014

I don't want to add any more confusion but I should note that SECURE_CONNECTION is 32768 on my 5.6 install even though I'm not actually using a secure connection, so the flag may not behave as simply as it seems.

@simi
Copy link
Contributor

simi commented Oct 16, 2014

@peterc I also tried that without luck. Actually I tred to use SECURE_RESERVED2.

@sodabrew
Copy link
Collaborator

Closing this issue. Please see PR #553 "Completion of MySQL 5.7 support".

@tomfuertes
Copy link

thanks for clarification @sodabrew! didn't realize I was on brew edge but not the gem edge for this one :(

@sodabrew
Copy link
Collaborator

@tomfuertes mysql2 gem 0.3.17 and 0.2.24 and above support MySQL 5.7. There's no reason to direct people to downgrade their MySQL installation.

@xwaynec
Copy link

xwaynec commented Nov 17, 2015

MySQL 5.7.9 update the libmysqlclient from libmysqlclient.18.dylib to libmysqlclient.20.dylib

@sodabrew
Copy link
Collaborator

@xwaynec If the library version changed, then you simply need to rebuild your mysql2 gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants