GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Tests pass, code cleaned up, cherry-picked to a new branch and tested, current with master.
Issue #233 refactor mysql_options calls and add an options method to …
Issue #233 add option :local_infile to the constructor.
List of valid Mysql2::Client options.
Issue #233 fixes to the options refactor plus tests now pass.
Ping. This is ready to merge please.
I'm eager for this to go in and can test/verify the fix. I see the issue with homebrew installed mysql Ver 14.14 Distrib 5.5.20, for osx10.7 (i386) using readline 5.1. If I roll back to mysql 5.1 the issue (malformed packet error using LOAD DATA INFILE) is not present.
+1 to getting this committed as on a mysql2 fork until it is. @brianmario or @tenderlove , any chance of this happening?
+1, would like to see this merged in.
In the meantime, not sure how to specify sodabrew's branch in my Gemfile. I have this:
gem "mysql2", git: "https://github.com/sodabrew/mysql2.git", branch: "issue-233"
But updating the bundle doesn't seem to be taking enough time to have actually recompiled the native extensions (even after blowing away the old directory). It does say "Using mysql2 (0.3.11) from https://github.com/sodabrew/mysql2.git (at issue-233) with native extensions" but it never says "Installing". And I still get the Malformed packet error. Any clues?
+1, would like to see this merged. Worked like a charm for me.
I ran into this issue as well, and fixed it in my own fork before I saw the issues/pullrequests from @sodabrew. My fixes are at https://github.com/menno/mysql2/commit/cf72bc1fba86e48ec97b428efea14a7e854b97e7 (based on 0.2.x) and https://github.com/menno/mysql2/commit/30302b7c7b6083f771c7c955e65dce2793264147 (based on master). I did not refactor any code like sodabrew did.
After applying the patches I added "local_infile: true" to my database.yml and it all works as expected.
Hope to see this resolved officially soon!
@sodabrew would you mind getting this pull mergable again?
@menno I would have definitely preferred this be split into two pull requests. One that adds the option and another to refactor.
Merge branch 'master' into issue-233a
@brianmario Done, updated to current master in my issue-233 branch. Confirmed that specs pass. I could split this into two pull requests if you need; it is split as refactor first, then add :local_infile, as two separate commits in this pull request.
Oh this is such sweet awesome splendor. Thanks @sodabrew and @brianmario !
Could we just return true/false here? Feels more ruby-ish to do that instead of return an int that represents the same. What do you think?
Sounds good to me!
Return bool from _mysql_client_options.
Merge pull request #252 from sodabrew/issue-233
Issue 233 - Add :local_infile option and refactor mysql_options code
Thinking about removing the Mysql2::Client#options ruby method. I've been trying to hide as much of the underlying libmysql API as I can in an attempt to wrap it in something more Ruby-like. We're not exposing any of the MYSQL_OPT_* options anyway so the caller would need to know the integer values of them from the libmysql headers in order to use this in Ruby-land anyway.
I have no objection to keeping this private and/or removing the public method -- you're right, there's not much you can do with the method yet. I was thinking we would expose more options as the need arose, but it's probably better to try and get all the options exposed in one shot when you're ready for it.