-
Notifications
You must be signed in to change notification settings - Fork 550
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
Prevent command out of sync errors with Prepared Statements #958
Merged
sodabrew
merged 1 commit into
brianmario:master
from
sodabrew:avoid_rb_funcall_between_mysql_api_calls
Apr 7, 2018
Merged
Prevent command out of sync errors with Prepared Statements #958
sodabrew
merged 1 commit into
brianmario:master
from
sodabrew:avoid_rb_funcall_between_mysql_api_calls
Apr 7, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From the land of you must be f kidding me, prepared statement cursors disable microsecond timestamps. https://bugs.mysql.com/bug.php?id=86818 This is fixed in MariaDB and broken in MySQL 5.5, 5.6. Meanwhile, MySQL 5.7 and 8.0 just hang when cursors are enabled.
|
sodabrew
force-pushed
the
avoid_rb_funcall_between_mysql_api_calls
branch
from
April 7, 2018 01:44
67c1795
to
216c92e
Compare
sodabrew
changed the title
Avoid GC run between
Prevent command out of sync errors with Prepared Statements
Apr 7, 2018
mysql_stmt_execute
and mysql_stmt_store_result
sodabrew
force-pushed
the
avoid_rb_funcall_between_mysql_api_calls
branch
from
April 7, 2018 02:07
216c92e
to
aaac1e5
Compare
This commit fixes two error scenarios. The first is to avoid GC runs between `mysql_stmt_execute` and `mysql_stmt_store_result`. This fixes a regression caused by brianmario#912 due to calling `rb_funcall` between `mysql_stmt_execute` and `mysql_stmt_store_result`. The error in this case is: Commands out of sync; you can't run this command now Thanks to @kamipo for diagnosing the problem and drafting the first PR. The second problem is that in streaming mode, rows are returned to Ruby space one at a time, so garbage collection will naturally occur at any time. By requesting a cursor into the result set, other MySQL commands can be sent on the wire between row fetches. The error in this case is: Row retrieval was canceled by mysql_stmt_close Fixes brianmario#956, updates brianmario#957.
sodabrew
force-pushed
the
avoid_rb_funcall_between_mysql_api_calls
branch
from
April 7, 2018 02:13
aaac1e5
to
515ee31
Compare
sodabrew
added a commit
that referenced
this pull request
Apr 7, 2018
This was referenced Apr 11, 2018
jeremy
added a commit
to jeremy/mysql2
that referenced
this pull request
Mar 5, 2019
* upstream/master: Expose windows client authentication (brianmario#1018) Fix code snippet (brianmario#1002) Add CentOS on Travis CI. (brianmario#989) Bump version to 0.5.2 Travis apt-get update for MySQL 5.5 install Updating the mysql2_mysql_enc_to_rb conversion table to 8.0 List (brianmario#976) Add default-libmysqlclient-dev to the likely packages list Bump version to 0.5.1 Use the prepared statement performance schema if available (brianmario#960) README mysql2 0.5.x works with Rails 5.0.7, 5.1.6, and higher README be sure to read about the known limitations of prepared statements Add missing FREE_BINDS to prepared statement streaming error case (brianmario#958) Fix with --with-mysql-dir (brianmario#952) Prevent command out of sync errors with Prepared Statements (brianmario#958)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks to @kamipo for diagnosing the problem and drafting the first PR #957
Fixes #956.