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

Changes for issue #233 #241

Closed
wants to merge 274 commits into
from

Conversation

Projects
None yet
Collaborator

sodabrew commented Jan 28, 2012

Add :local_infile option to Mysql2::Client.new() and refactor mysql_options calls.

brianmario and others added some commits Jan 7, 2011

Big cleanup to gem development process.
Remove jeweler, integrate RVM and Bundler.
Merge pull request #117 from wvanbergen/mysql2
---

This simple patch will actually raise an error instead of returning the exception instance if one occurs while executing the query.
Fix fiber usage in Rails 3.0.
We should override the public method, clear_stale_cached_connections!,
rather than the private method, remove_stale_cached_threads!,
which actually disappeared in Rails 3.0.
Ensure we are using the exact same client config in tests.
I was running into a heisenbug and there was speculation this
might solve the problem.
use Mysql2::Client#ping instead of a simple query to test if the conn…
…ection is still alive in the ActiveRecord adapter, since it's a little more wire-efficient
release GVL under 1.9 when running mysql_ping
It writes to and reads from a socket so it could block
for an indeterminite amount of time, let other threads
run in the meantime.

mperham and others added some commits Aug 28, 2011

Change mysql error detection strategy
Previous to this commit, some mysql connection errors were not detected
by the client.

This commit changes from implicit error detection via checking
mysql_field_count() to explicit detection via mysql_errno().

http://dev.mysql.com/doc/refman/5.0/en/null-mysql-store-result.html
Merge pull request #224 from woahdae/mysql_err_check
Change mysql error detection strategy
Change mysql error detection strategy
Previous to this commit, some mysql connection errors were not detected
by the client.

This commit changes from implicit error detection via checking
mysql_field_count() to explicit detection via mysql_errno().

http://dev.mysql.com/doc/refman/5.0/en/null-mysql-store-result.html
Merge pull request #198 from JonathonMA/doc-test-requirements
Document user and database requirements for tests
revert to using xmalloc/xfree for allocations
I've (re)read our usage of them and observed no bad interactions
with the Ruby GC and no need to use RB_GC_GUARD anywhere.

xmalloc() does error-checking for us, so we'll raise
NoMemoryError instead of a segfaulting when/if malloc() fails to
release memory.

xmalloc() may increase the frequency of GC invocation in MRI
because it bumps the malloc counter (and xfree() cannot
decrement it), but MRI 1.9.3+ users can set a higher
RUBY_GC_MALLOC_LIMIT to reduce GC frequency (or improve GC :P).
avoid potentially unsafe Ruby C API usage w/o GVL
Using StringValuePtr() /can/ potentially allocate a new String
object.  This allocation _currently_ impossible in our codebase,
but to prevent future/potential bugs from appearing, we'll
avoid StringValuePtr() (and any functions not explicitly
supported w/o GVL) in nogvl_* regions.
reacquire GVL before retrying on EINTR on connect
If signals are received, we must reacquire the GVL to let
(Ruby-level) signal handlers run.  Otherwise, it may be
impossible to effectively cancel/interrupt a slow connection
negotiation.

Fortunately, connecting to MySQL servers is rare and rarely
interrupted (or even interruptible) by signal handlers, so
maybe nobody noticed this bug.
revert to using xmalloc/xfree for allocations
I've (re)read our usage of them and observed no bad interactions
with the Ruby GC and no need to use RB_GC_GUARD anywhere.

xmalloc() does error-checking for us, so we'll raise
NoMemoryError instead of a segfaulting when/if malloc() fails to
release memory.

xmalloc() may increase the frequency of GC invocation in MRI
because it bumps the malloc counter (and xfree() cannot
decrement it), but MRI 1.9.3+ users can set a higher
RUBY_GC_MALLOC_LIMIT to reduce GC frequency (or improve GC :P).
avoid potentially unsafe Ruby C API usage w/o GVL
Using StringValuePtr() /can/ potentially allocate a new String
object.  This allocation _currently_ impossible in our codebase,
but to prevent future/potential bugs from appearing, we'll
avoid StringValuePtr() (and any functions not explicitly
supported w/o GVL) in nogvl_* regions.
reacquire GVL before retrying on EINTR on connect
If signals are received, we must reacquire the GVL to let
(Ruby-level) signal handlers run.  Otherwise, it may be
impossible to effectively cancel/interrupt a slow connection
negotiation.

Fortunately, connecting to MySQL servers is rare and rarely
interrupted (or even interruptible) by signal handlers, so
maybe nobody noticed this bug.
Merge pull request #232 from tmtm/utf8mb4
utf8mb4 charset supoprt

@sodabrew sodabrew closed this Jan 28, 2012

Collaborator

sodabrew commented Jan 28, 2012

Ouch, I blew up my repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment