commit rubygem-mysql2 for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-mysql2 for openSUSE:Factory checked in at 2016-05-29 03:11:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-mysql2 (Old) and /work/SRC/openSUSE:Factory/.rubygem-mysql2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-mysql2" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-mysql2/rubygem-mysql2.changes 2016-03-07 13:28:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-mysql2.new/rubygem-mysql2.changes 2016-05-29 03:12:47.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Apr 20 04:32:48 UTC 2016 - coolo@suse.com + +- updated to version 0.4.4 + see installed CHANGELOG.md + +------------------------------------------------------------------- Old: ---- mysql2-0.4.3.gem New: ---- mysql2-0.4.4.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-mysql2.spec ++++++ --- /var/tmp/diff_new_pack.aZ5dVS/_old 2016-05-29 03:12:47.000000000 +0200 +++ /var/tmp/diff_new_pack.aZ5dVS/_new 2016-05-29 03:12:47.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-mysql2 -Version: 0.4.3 +Version: 0.4.4 Release: 0 %define mod_name mysql2 %define mod_full_name %{mod_name}-%{version} ++++++ mysql2-0.4.3.gem -> mysql2-0.4.4.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -484,9 +484,9 @@ This gem is tested with the following Ruby versions on Linux and Mac OS X: - * Ruby MRI 1.8.7, 1.9.3, 2.0.0, 2.1.x, 2.2.x + * Ruby MRI 1.8.7, 1.9.3, 2.0.0, 2.1.x, 2.2.x, 2.3.x * Ruby Enterprise Edition (based on MRI 1.8.7) - * Rubinius 2.x + * Rubinius 2.x, 3.x This gem is tested with the following MySQL and MariaDB versions: @@ -494,11 +494,11 @@ * MySQL Connector/C 6.0 and 6.1 (primarily on Windows) * MariaDB 5.5, 10.0, 10.1 -### Rails / Active Record +### Ruby on Rails / Active Record - * mysql2 0.4.x works with Active Record 4.2.5 and higher. - * mysql2 0.3.x works with Active Record 3.1 and higher (the AR adapter is now included in AR proper). - * mysql2 0.2.x includes an Active Record adapter compatible with AR 2.3 and 3.0, and should not be used with AR 3.1 or higher. + * mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher. + * mysql2 0.3.x works with Rails / Active Record 3.1, 3.2, 4.x, 5.0. + * mysql2 0.2.x works with Rails / Active Record 2.3 - 3.0. ### Asynchronous Active Record Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mysql2/result.c new/ext/mysql2/result.c --- old/ext/mysql2/result.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ext/mysql2/result.c 1970-01-01 01:00:00.000000000 +0100 @@ -346,15 +346,15 @@ conn_enc = rb_to_encoding(wrapper->encoding); #endif + if (wrapper->fields == Qnil) { + wrapper->numberOfFields = mysql_num_fields(wrapper->result); + wrapper->fields = rb_ary_new2(wrapper->numberOfFields); + } if (args->asArray) { rowVal = rb_ary_new2(wrapper->numberOfFields); } else { rowVal = rb_hash_new(); } - if (wrapper->fields == Qnil) { - wrapper->numberOfFields = mysql_num_fields(wrapper->result); - wrapper->fields = rb_ary_new2(wrapper->numberOfFields); - } if (wrapper->result_buffers == NULL) { rb_mysql_result_alloc_result_buffers(self, fields); @@ -541,16 +541,16 @@ return Qnil; } + if (wrapper->fields == Qnil) { + wrapper->numberOfFields = mysql_num_fields(wrapper->result); + wrapper->fields = rb_ary_new2(wrapper->numberOfFields); + } if (args->asArray) { rowVal = rb_ary_new2(wrapper->numberOfFields); } else { rowVal = rb_hash_new(); } fieldLengths = mysql_fetch_lengths(wrapper->result); - if (wrapper->fields == Qnil) { - wrapper->numberOfFields = mysql_num_fields(wrapper->result); - wrapper->fields = rb_ary_new2(wrapper->numberOfFields); - } for (i = 0; i < wrapper->numberOfFields; i++) { VALUE field = rb_mysql_result_fetch_field(self, i, args->symbolizeKeys); @@ -834,7 +834,9 @@ if (row == Qnil) { /* we don't need the mysql C dataset around anymore, peace it */ - rb_mysql_result_free_result(wrapper); + if (args->cacheRows) { + rb_mysql_result_free_result(wrapper); + } return Qnil; } @@ -842,7 +844,7 @@ rb_yield(row); } } - if (wrapper->lastRowProcessed == wrapper->numberOfRows) { + if (wrapper->lastRowProcessed == wrapper->numberOfRows && args->cacheRows) { /* we don't need the mysql C dataset around anymore, peace it */ rb_mysql_result_free_result(wrapper); } @@ -886,6 +888,7 @@ if (wrapper->stmt_wrapper && !cacheRows && !wrapper->is_streaming) { rb_warn(":cache_rows is forced for prepared statements (if not streaming)"); + cacheRows = 1; } if (wrapper->stmt_wrapper && !cast) { @@ -913,13 +916,12 @@ app_timezone = Qnil; } - if (wrapper->lastRowProcessed == 0 && !wrapper->is_streaming) { + if (wrapper->rows == Qnil && !wrapper->is_streaming) { wrapper->numberOfRows = wrapper->stmt_wrapper ? mysql_stmt_num_rows(wrapper->stmt_wrapper->stmt) : mysql_num_rows(wrapper->result); - if (wrapper->numberOfRows == 0) { - rb_mysql_result_free_result(wrapper); - wrapper->rows = rb_ary_new(); - return wrapper->rows; - } + wrapper->rows = rb_ary_new2(wrapper->numberOfRows); + } else if (wrapper->rows && !cacheRows) { + mysql_data_seek(wrapper->result, 0); + wrapper->lastRowProcessed = 0; wrapper->rows = rb_ary_new2(wrapper->numberOfRows); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mysql2/version.rb new/lib/mysql2/version.rb --- old/lib/mysql2/version.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/mysql2/version.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +1,3 @@ module Mysql2 - VERSION = "0.4.3" + VERSION = "0.4.4" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 1970-01-01 01:00:00.000000000 +0100 +++ new/metadata 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: mysql2 version: !ruby/object:Gem::Version - version: 0.4.3 + version: 0.4.4 platform: ruby authors: - Brian Lopez @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2016-02-24 00:00:00.000000000 Z +date: 2016-04-19 00:00:00.000000000 Z dependencies: [] description: email: @@ -95,7 +95,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.0.14 +rubygems_version: 2.0.14.1 signing_key: specification_version: 4 summary: A simple, fast Mysql library for Ruby, binding to libmysql diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/mysql2/client_spec.rb new/spec/mysql2/client_spec.rb --- old/spec/mysql2/client_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/mysql2/client_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -382,24 +382,24 @@ it "should expect connect_timeout to be a positive integer" do expect { - Mysql2::Client.new(:connect_timeout => -1) + Mysql2::Client.new(DatabaseCredentials['root'].merge(:connect_timeout => -1)) }.to raise_error(Mysql2::Error) end it "should expect read_timeout to be a positive integer" do expect { - Mysql2::Client.new(:read_timeout => -1) + Mysql2::Client.new(DatabaseCredentials['root'].merge(:read_timeout => -1)) }.to raise_error(Mysql2::Error) end it "should expect write_timeout to be a positive integer" do expect { - Mysql2::Client.new(:write_timeout => -1) + Mysql2::Client.new(DatabaseCredentials['root'].merge(:write_timeout => -1)) }.to raise_error(Mysql2::Error) end it "should allow nil read_timeout" do - client = Mysql2::Client.new(:read_timeout => nil) + client = Mysql2::Client.new(DatabaseCredentials['root'].merge(:read_timeout => nil)) expect(client.read_timeout).to be_nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/mysql2/result_spec.rb new/spec/mysql2/result_spec.rb --- old/spec/mysql2/result_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/mysql2/result_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -82,6 +82,11 @@ expect(result.first.object_id).not_to eql(result.first.object_id) end + it "should be able to iterate a second time even if cache_rows is disabled" do + result = @client.query "SELECT 1 UNION SELECT 2", :cache_rows => false + expect(result.to_a).to eql(result.to_a) + end + it "should yield different value for #first if streaming" do result = @client.query "SELECT 1 UNION SELECT 2", :stream => true, :cache_rows => false expect(result.first).not_to eql(result.first) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/mysql2/statement_spec.rb new/spec/mysql2/statement_spec.rb --- old/spec/mysql2/statement_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/mysql2/statement_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -128,6 +128,14 @@ expect(test_result['decimal_test']).to eql(123.45) end + it "should warn but still work if cache_rows is set to false" do + @client.query_options.merge!(:cache_rows => false) + statement = @client.prepare 'SELECT 1' + result = nil + expect { result = statement.execute.to_a }.to output(/:cache_rows is forced for prepared statements/).to_stderr + expect(result.length).to eq(1) + end + context "utf8_db" do before(:each) do @client.query("DROP DATABASE IF EXISTS test_mysql2_stmt_utf8")
participants (1)
-
root@hilbert.suse.de