Releases: brianmario/mysql2
Releases · brianmario/mysql2
0.3.19
New Features
- Mysql2::Client#info class method for easier debugging, and both the class and instance method return US_ASCII output rather than using the connection encoding.
- When streaming results, continue result.count across calls to result.each
Bugfixes
- Search for mariadb_config on compile
- Update to Connector/C 6.1.6 in the Windows builds
- Fix Mysql2::Client#escape to set the encoding even if the string was not modified
- Fix LICENSE filename in gem file list
- Make the result.count return type consistent and match the source type
Changes
- Rename macro GetMysql2Result to GET_RESULT
- Convert StringValuePtr to either RSTRING_PTR or StringValueCStr
- Fix unused variable warning on Windows in rb_mysql_client_socket
- Add Ruby 2.2 to the AppVeyor matrix
- Test default client flag equality instead of bitwise truthiness
- Add rake-compiler-dock for building Windows binary gems
- Friendly ext build error <3
- Process :stream option in
rb_mysql_result_to_obj
once instead ofrb_mysql_result_each
for each call to each - Tests for streaming and stored procedures with multiple result sets
0.3.18
New Features
- Windows builds are restored following an extensive dive into DLL and compiler issues.
- MySQL Connector/C 6.1.5 is now vendored into the binary gems for Windows.
- Optional environment variable RUBY_MYSQL2_LIBMYSQL_DLL to find libmysql.dll on Windows.
Bugfixes
- Fix milliseconds were not converted from results into Ruby Time objects.
- Fix error when you close EM::Client with no query running.
Changes
- Update and rename MIT-LICENSE to LICENSE
- Update Travis unit tests for OS X
- Add Ruby 2.2 to Travis platforms
- Speed up certain unit tests with a MEMORY table
- More search paths are added to find MySQL installed by MacPorts and Homebrew on OS X.
0.2.24
0.3.17
New Features
- Microseconds are now supported in a TIME field (0.3.12 added support for msec in DATETIME).
Bugfixes
- Use /dev/null in invalidate_fd to avoid infinite loop in OpenSSL.
- Change sql_state to attr_reader to avoid Ruby warning.
Changes
- Added call to mysql_library_init during initialization of the gem for thread safety.
- State the name of the field that contains a bad datetime value in the exception.
- Travis CI updates including:
- SSL tests
- Ruby 2.1.x
- Newer Rubinius 2.x
- OS X with Ruby 2.0
- MySQL 5.7 with Ruby 2.0
0.3.16
New Features
- New connection argument
:init_command
sets a query string to run at connect/reconnect.
Bugfixes
- Check that dir_config returns at least one valid directory at compile time.
Changes
- Enforce connection retry time limits across interrupts (e.g. by signals, etc.)
- Prevent MySQL from calling
shutdown()
on shared sockets. - MariaDB 5.5 and 10.0 added to the test suite. No changes were required to support MariaDB, but we're actively testing for compatibility now.
- Update specs for Ruby 2.1 Timeout behavior.
0.2.23
0.3.12
New features
- We're compatible with Ruby 2.0.0 now!
- A new
:streaming
option can be passed while issuing a query which will leave the results on the server side and stream them to the client a row-at-a-time. This is great for really large datasets. Mysql2::Client#abandon_results!
has been introduced which lets you throw away result sets in an efficient manner.Mysql2::Client#select_db
has been introduced allowing you to select which database a connection is using without needing to issue a query.Mysql2::Client#more_results?
has been introduced which is used to check if there are more results to be read whenCLIENT_MULTI_STATEMENTS
is enabled.Mysql2::Client#next_result
has been introduced which is used to step the result cursor forward by one whenCLIENT_MULTI_STATEMENTS
is enabled.Mysql2::Client#store_result
has been introduced which allows you to read the next result off the wire whenCLIENT_MULTI_STATEMENTS
is enabled.Mysql2::Client#reconnect=
has been introduced which allows you to change the reconnect behavior of libmysql while a connection is active.Mysql2::Client#warning_count
has been introduced which returns the warning count from the most recent query.Mysql2::Client#query_info_string
has been introduced which returns an informational string returned by the server about the most recent query.- The
read_timeout
connection option has been introduced allowing you to set the read timeout of the connection in seconds. - The
write_timeout
connection option has been introduced allowing you to set the write timeout of the connection in seconds. - The
local_infile
connection option has been introduced which allows you to enable LOCAL INFILE support. BIT
field values can be used as boolean fields whencast_bool
is enabled.- We now respect fractional seconds in
TIMESTAMP
andDATETIME
fields (this was introduced in Mysql 5.6.4).
Bug Fixes
- Fix a really long-standing double-free bug related to a Mysql2::Client being freed before a Mysql2::Result that was generated from it. We now do our own refcounting in C as well as a Ruby reference to a Mysql2::Client from it's Mysql2::Result's.
- Fix a compile bug when using the mysql-connector-c related to version compatibility checks in mysql2
- A more explicit error is raised when a single connection is attempted to be shared across threads
- We're more protected against GC-related bugs when compiler optimizations may keep a Ruby object pointer from being visible during GC runs.
- Fix an integer overflow bug with the
CLIENT_
constant values - Compiling the gem should be a little more robust. Some changes were made to extconf to try and make sure we can find libmysql when linking.
- Make sure we read values from the various TIME/DATE field types as unsigned integers.
Mysql2::Client::EM
shouldn't swallow exceptions raised in the deferrable callbacks.- Passing options to
Mysql2::Client#query
should no longer persist on theMysql2::Client
object itself but instead only apply to theMysql2::Result
object created by the query as intended. - Reading
Mysql2::Client#affected_rows
orMysql2::Client#last_id
after a result has been freed should no longer return garbage.
Optimizations
- Push mysql<->ruby encoding mapping table down into C for a nice speedup
- Use a faster Hash#dup on 1.8.7 when cascading the options hash through Mysql2's objects
- We use
rb_intern3
if it's available to create symbol keys whensymbolize_keys
is enabled to skip creating an intermediary Ruby String.
View the diff here
0.2.19
This release contains all of the same code and therefore release notes as 0.3.12.
The following changes are specific to 0.2.19:
Changes
- The EventMachine ActiveRecord adapter and EM Fiber driver have been removed. You should use https://github.com/igrigorik/em-synchrony instead as it's being maintained there.
Bug fixes
- The ActiveRecord adapter now symbolizes the keys from the connection options hash as early as possible to ensure hash lookups on that hash will work before the
Mysql2::Client
object is created. - Make sure a default LIMIT is set when an OFFSET is set.
- A couple of small fixes related to newer ActiveRecord versions since the last mysql2 release
View the diff here
0.3.11
- change mysql error detection strategy from using mysql_field_count to the more explicit mysql_errno
- bugfix to avoid race condition with active connections that error out
- revert back to using xmalloc/xfree for allocations
- avoid potentially unsafe Ruby C API usage w/o GVL
- reacquire GVL before retrying on EINTR on connect
0.2.18
- change mysql error detection strategy from using mysql_field_count to the more explicit mysql_errno
- bugfix to avoid race condition with active connections that error out
- revert back to using xmalloc/xfree for allocations
- avoid potentially unsafe Ruby C API usage w/o GVL
- reacquire GVL before retrying on EINTR on connect