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

Expose the mysql_set_server_option: #943

Merged
merged 1 commit into from
Mar 1, 2018

Conversation

Edouard-chin
Copy link
Contributor

Expose the mysql_set_server_option:

  • Use case: I'd like to be able to do multiple statements query without having to reconnect to the db first. Without this feature, if I want to do a multi statement query after the connection is established without the MULTI_STATEMENTS flag, I'd have to set the flag on the connection and reconnect
  • One of the main motivation for this is because Rails is now inserting fixtures inside a multi-statements query. We used the workaround I described above, but it would be great if we could use the mysql function mysql_set_server_option . For more context Ref
  • Ref https://dev.mysql.com/doc/refman/5.5/en/mysql-set-server-option.html

- Use case: I'd like to be able to do multiple statements query without having to reconnect to the db first. Without this feature, if I want to do a multi statement query **after** the connection is established without the `MULTI_STATEMENTS` flag, I'd have to set the flag on the connection and reconnect
- One of the main motivation for this is because Rails is now inserting fixtures inside a multi-statements query. We used the workaround I described above, but it would be great if we could use the mysql function mysql_set_server_option . For more context [Ref](rails/rails#31422 (comment))
- Ref https://dev.mysql.com/doc/refman/5.5/en/mysql-set-server-option.html
@Edouard-chin
Copy link
Contributor Author

The build is failing because of rubocop (I added more tests thus the Rspec.describe block has reached the 825 lines limit), let me know what you prefer me to do: (exclude the client_spec file from this cop, put the test somewhere else ...)

@sodabrew sodabrew added this to the 0.5.0 milestone Mar 1, 2018
@sodabrew
Copy link
Collaborator

sodabrew commented Mar 1, 2018

Looks awesome. Thanks for this contribution! Merging now!

@sodabrew sodabrew merged commit 9d971db into brianmario:master Mar 1, 2018
@Edouard-chin
Copy link
Contributor Author

Thanks a lot for the quick merge, appreciate ❤️

@Edouard-chin Edouard-chin deleted the set-server-option branch March 2, 2018 00:15
sodabrew added a commit that referenced this pull request Mar 19, 2018
sodabrew added a commit to sodabrew/mysql2 that referenced this pull request Mar 19, 2018
sodabrew added a commit to sodabrew/mysql2 that referenced this pull request Mar 20, 2018
jeremy added a commit to jeremy/mysql2 that referenced this pull request Mar 21, 2018
* master: (21 commits)
  Bump version to 0.5.0
  README note that MariaDB 10.3 and Ruby 2.6 are supported
  Initialize params_enc variable to resolve a warning
  Travis CI add MariaDB 10.3
  Travis CI add Ruby 2.6
  Use a local scope to avoid leaking the temporary variable for bind_count
  Revert "Layout/IndentHeredoc"
  Bump RuboCop limits for spec file length
  Style nit fix for brianmario#943
  Use a typedef my_bool to improve compatibility across MySQL versions
  Revert "Use `bool` instead of `my_bool` which has been removed since MySQL 8.0.1 (brianmario#840)"
  Style nit for brianmario#943
  Expose the `mysql_set_server_option`: (brianmario#943)
  Update usage section of README.md (brianmario#939)
  Travis CI should run MySQL 5.5 tests on Trusty
  Looks like Windows Ruby 2.0 still has the buggy mkmf
  Use CLIENT_CONNECT_ATTRS flag to test the connection attributes feature
  README note that MariaDB 10.2 is supported
  Travis CI drop tests for MySQL 5.1 on Ubuntu Precise
  Fix Ruby 2.4 on Appveyor
  ...
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

Successfully merging this pull request may close these issues.

2 participants