mysql2 0.2.18 → 0.2.19b1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.rbenv-version +1 -0
- data/Gemfile.lock +61 -0
- data/README.md +70 -4
- data/ext/mysql2/client.c +320 -61
- data/ext/mysql2/client.h +5 -3
- data/ext/mysql2/extconf.rb +6 -5
- data/ext/mysql2/result.c +91 -40
- data/ext/mysql2/result.h +1 -0
- data/lib/active_record/connection_adapters/mysql2_adapter.rb +42 -13
- data/lib/mysql2.rb +18 -3
- data/lib/mysql2/client.rb +39 -12
- data/lib/mysql2/em.rb +13 -3
- data/lib/mysql2/version.rb +1 -1
- data/spec/configuration.yml.example +11 -0
- data/spec/em/em_fiber_spec.rb +2 -2
- data/spec/em/em_spec.rb +68 -7
- data/spec/mysql2/client_spec.rb +114 -12
- data/spec/mysql2/error_spec.rb +2 -2
- data/spec/mysql2/result_spec.rb +57 -5
- data/spec/spec_helper.rb +3 -1
- data/tasks/rspec.rake +11 -1
- metadata +149 -149
data/spec/spec_helper.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
require 'rspec'
|
4
4
|
require 'mysql2'
|
5
5
|
require 'timeout'
|
6
|
+
require 'yaml'
|
7
|
+
DatabaseCredentials = YAML.load_file('spec/configuration.yml')
|
6
8
|
|
7
9
|
RSpec.configure do |config|
|
8
10
|
config.before(:all) do
|
9
|
-
client = Mysql2::Client.new
|
11
|
+
client = Mysql2::Client.new DatabaseCredentials['root']
|
10
12
|
client.query %[
|
11
13
|
CREATE TABLE IF NOT EXISTS mysql2_test (
|
12
14
|
id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
data/tasks/rspec.rake
CHANGED
@@ -13,4 +13,14 @@ begin
|
|
13
13
|
task :default => :spec
|
14
14
|
rescue LoadError
|
15
15
|
puts "rspec, or one of its dependencies, is not available. Install it with: sudo gem install rspec"
|
16
|
-
end
|
16
|
+
end
|
17
|
+
|
18
|
+
file 'spec/configuration.yml' => 'spec/configuration.yml.example' do |task|
|
19
|
+
CLEAN.exclude task.name
|
20
|
+
src_path = File.expand_path("../../#{task.prerequisites.first}", __FILE__)
|
21
|
+
dst_path = File.expand_path("../../#{task.name}", __FILE__)
|
22
|
+
cp src_path, dst_path
|
23
|
+
sh "sed -i 's/LOCALUSERNAME/#{ENV['USER']}/' #{dst_path}"
|
24
|
+
end
|
25
|
+
|
26
|
+
Rake::Task[:spec].prerequisites << :'spec/configuration.yml'
|
metadata
CHANGED
@@ -1,168 +1,175 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql2
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 18
|
10
|
-
version: 0.2.18
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.19b1
|
5
|
+
prerelease: 6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Brian Lopez
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: eventmachine
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
33
22
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rake-compiler
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake-compiler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
39
33
|
none: false
|
40
|
-
requirements:
|
34
|
+
requirements:
|
41
35
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 13
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
- 7
|
47
|
-
- 7
|
36
|
+
- !ruby/object:Gem::Version
|
48
37
|
version: 0.7.7
|
49
38
|
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: rake
|
53
39
|
prerelease: false
|
54
|
-
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.7.7
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
64
53
|
version: 0.8.7
|
65
54
|
type: :development
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: rspec
|
69
55
|
prerelease: false
|
70
|
-
|
71
|
-
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.8.7
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
79
70
|
type: :development
|
80
|
-
version_requirements: *id004
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: activerecord
|
83
71
|
prerelease: false
|
84
|
-
|
85
|
-
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: activerecord
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
93
86
|
type: :development
|
94
|
-
version_requirements: *id005
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: mysql
|
97
87
|
prerelease: false
|
98
|
-
|
99
|
-
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: mysql
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
107
102
|
type: :development
|
108
|
-
version_requirements: *id006
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: do_mysql
|
111
103
|
prerelease: false
|
112
|
-
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: do_mysql
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
121
118
|
type: :development
|
122
|
-
version_requirements: *id007
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
|
-
name: sequel
|
125
119
|
prerelease: false
|
126
|
-
|
127
|
-
none: false
|
128
|
-
requirements:
|
129
|
-
- -
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: sequel
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
135
134
|
type: :development
|
136
|
-
version_requirements: *id008
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: faker
|
139
135
|
prerelease: false
|
140
|
-
|
141
|
-
none: false
|
142
|
-
requirements:
|
143
|
-
- -
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: faker
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
149
150
|
type: :development
|
150
|
-
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
151
158
|
description:
|
152
159
|
email: seniorlopez@gmail.com
|
153
160
|
executables: []
|
154
|
-
|
155
|
-
extensions:
|
161
|
+
extensions:
|
156
162
|
- ext/mysql2/extconf.rb
|
157
163
|
extra_rdoc_files: []
|
158
|
-
|
159
|
-
files:
|
164
|
+
files:
|
160
165
|
- .gitignore
|
166
|
+
- .rbenv-version
|
161
167
|
- .rspec
|
162
168
|
- .rvmrc
|
163
169
|
- .travis.yml
|
164
170
|
- CHANGELOG.md
|
165
171
|
- Gemfile
|
172
|
+
- Gemfile.lock
|
166
173
|
- MIT-LICENSE
|
167
174
|
- README.md
|
168
175
|
- Rakefile
|
@@ -197,6 +204,7 @@ files:
|
|
197
204
|
- lib/mysql2/result.rb
|
198
205
|
- lib/mysql2/version.rb
|
199
206
|
- mysql2.gemspec
|
207
|
+
- spec/configuration.yml.example
|
200
208
|
- spec/em/em_fiber_spec.rb
|
201
209
|
- spec/em/em_spec.rb
|
202
210
|
- spec/mysql2/client_spec.rb
|
@@ -208,43 +216,35 @@ files:
|
|
208
216
|
- tasks/compile.rake
|
209
217
|
- tasks/rspec.rake
|
210
218
|
- tasks/vendor_mysql.rake
|
211
|
-
has_rdoc: true
|
212
219
|
homepage: http://github.com/brianmario/mysql2
|
213
220
|
licenses: []
|
214
|
-
|
215
221
|
post_install_message:
|
216
|
-
rdoc_options:
|
222
|
+
rdoc_options:
|
217
223
|
- --charset=UTF-8
|
218
|
-
require_paths:
|
224
|
+
require_paths:
|
219
225
|
- lib
|
220
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
226
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
221
227
|
none: false
|
222
|
-
requirements:
|
223
|
-
- -
|
224
|
-
- !ruby/object:Gem::Version
|
225
|
-
|
226
|
-
|
227
|
-
- 0
|
228
|
-
version: "0"
|
229
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
|
+
requirements:
|
229
|
+
- - ! '>='
|
230
|
+
- !ruby/object:Gem::Version
|
231
|
+
version: '0'
|
232
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
233
|
none: false
|
231
|
-
requirements:
|
232
|
-
- -
|
233
|
-
- !ruby/object:Gem::Version
|
234
|
-
|
235
|
-
segments:
|
236
|
-
- 0
|
237
|
-
version: "0"
|
234
|
+
requirements:
|
235
|
+
- - ! '>'
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: 1.3.1
|
238
238
|
requirements: []
|
239
|
-
|
240
239
|
rubyforge_project:
|
241
|
-
rubygems_version: 1.
|
240
|
+
rubygems_version: 1.8.23
|
242
241
|
signing_key:
|
243
242
|
specification_version: 3
|
244
243
|
summary: A simple, fast Mysql library for Ruby, binding to libmysql
|
245
|
-
test_files:
|
244
|
+
test_files:
|
246
245
|
- examples/eventmachine.rb
|
247
246
|
- examples/threaded.rb
|
247
|
+
- spec/configuration.yml.example
|
248
248
|
- spec/em/em_fiber_spec.rb
|
249
249
|
- spec/em/em_spec.rb
|
250
250
|
- spec/mysql2/client_spec.rb
|