mysql2 0.4.10 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +23 -6
- data/examples/eventmachine.rb +0 -2
- data/examples/threaded.rb +2 -4
- data/ext/mysql2/client.c +100 -51
- data/ext/mysql2/client.h +1 -39
- data/ext/mysql2/extconf.rb +23 -20
- data/ext/mysql2/mysql2_ext.c +2 -1
- data/ext/mysql2/mysql2_ext.h +8 -4
- data/ext/mysql2/result.c +15 -75
- data/ext/mysql2/result.h +2 -3
- data/ext/mysql2/statement.c +78 -71
- data/ext/mysql2/statement.h +0 -2
- data/ext/mysql2/wait_for_single_fd.h +2 -1
- data/lib/mysql2.rb +14 -15
- data/lib/mysql2/client.rb +33 -27
- data/lib/mysql2/em.rb +2 -4
- data/lib/mysql2/error.rb +49 -20
- data/lib/mysql2/result.rb +2 -0
- data/lib/mysql2/statement.rb +3 -9
- data/lib/mysql2/version.rb +1 -1
- data/spec/em/em_spec.rb +5 -6
- data/spec/mysql2/client_spec.rb +206 -173
- data/spec/mysql2/error_spec.rb +0 -4
- data/spec/mysql2/result_spec.rb +94 -154
- data/spec/mysql2/statement_spec.rb +105 -169
- data/spec/spec_helper.rb +6 -2
- data/support/mysql_enc_to_ruby.rb +2 -2
- data/support/ruby_enc_to_mysql.rb +5 -5
- metadata +6 -5
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
1
|
require 'rspec'
|
4
2
|
require 'mysql2'
|
5
3
|
require 'timeout'
|
@@ -36,6 +34,12 @@ RSpec.configure do |config|
|
|
36
34
|
end
|
37
35
|
end
|
38
36
|
|
37
|
+
def num_classes
|
38
|
+
# rubocop:disable Lint/UnifiedInteger
|
39
|
+
0.class == Integer ? [Integer] : [Fixnum, Bignum]
|
40
|
+
# rubocop:enable Lint/UnifiedInteger
|
41
|
+
end
|
42
|
+
|
39
43
|
config.before :each do
|
40
44
|
@client = new_client
|
41
45
|
end
|
@@ -45,8 +45,8 @@ mysql_to_rb = {
|
|
45
45
|
"eucjpms" => "eucJP-ms",
|
46
46
|
}
|
47
47
|
|
48
|
-
client = Mysql2::Client.new(:
|
49
|
-
collations = client.query "SHOW COLLATION", :
|
48
|
+
client = Mysql2::Client.new(username: user, password: pass, host: host, port: port.to_i)
|
49
|
+
collations = client.query "SHOW COLLATION", as: :array
|
50
50
|
encodings = Array.new(collations.to_a.last[2].to_i)
|
51
51
|
encodings_with_nil = Array.new(encodings.size)
|
52
52
|
|
@@ -40,7 +40,7 @@ mysql_to_rb = {
|
|
40
40
|
"eucjpms" => "eucJP-ms",
|
41
41
|
}
|
42
42
|
|
43
|
-
puts <<-
|
43
|
+
puts <<-HEADER
|
44
44
|
%readonly-tables
|
45
45
|
%enum
|
46
46
|
%define lookup-function-name mysql2_mysql_enc_name_to_rb
|
@@ -48,13 +48,13 @@ puts <<-header
|
|
48
48
|
%struct-type
|
49
49
|
struct mysql2_mysql_enc_name_to_rb_map { const char *name; const char *rb_name; }
|
50
50
|
%%
|
51
|
-
|
51
|
+
HEADER
|
52
52
|
|
53
53
|
mysql_to_rb.each do |mysql, ruby|
|
54
|
-
if ruby.nil?
|
55
|
-
|
54
|
+
name = if ruby.nil?
|
55
|
+
"NULL"
|
56
56
|
else
|
57
|
-
|
57
|
+
"\"#{ruby}\""
|
58
58
|
end
|
59
59
|
|
60
60
|
puts "#{mysql}, #{name}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|
@@ -75,10 +75,11 @@ files:
|
|
75
75
|
- support/libmysql.def
|
76
76
|
- support/mysql_enc_to_ruby.rb
|
77
77
|
- support/ruby_enc_to_mysql.rb
|
78
|
-
homepage:
|
78
|
+
homepage: https://github.com/brianmario/mysql2
|
79
79
|
licenses:
|
80
80
|
- MIT
|
81
|
-
metadata:
|
81
|
+
metadata:
|
82
|
+
msys2_mingw_dependencies: libmariadbclient
|
82
83
|
post_install_message:
|
83
84
|
rdoc_options:
|
84
85
|
- "--charset=UTF-8"
|
@@ -88,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
89
|
requirements:
|
89
90
|
- - ">="
|
90
91
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
+
version: 2.0.0
|
92
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
95
|
- - ">="
|