mysql2 0.3.17 → 0.3.18
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 +34 -19
- data/ext/mysql2/client.c +2 -2
- data/ext/mysql2/extconf.rb +76 -29
- data/ext/mysql2/result.c +5 -5
- data/lib/mysql2.rb +23 -0
- data/lib/mysql2/em.rb +10 -1
- data/lib/mysql2/version.rb +1 -1
- data/spec/em/em_spec.rb +21 -0
- data/spec/mysql2/client_spec.rb +5 -5
- data/spec/mysql2/result_spec.rb +1 -1
- data/support/libmysql.def +219 -0
- metadata +5 -19
- data/MIT-LICENSE +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 791bc0352c6464ca1765498b0babcedfad3c284e
|
4
|
+
data.tar.gz: 08b44b761494ec18a0c9903fcb67bfe61718b77b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5554897f395a4fcd71e26612ef895da5d3e1d528ef29604380974950f7216783bf7636197d04228c39b471a51863f75c56e9140e05bb79410e1582c64842d0dc
|
7
|
+
data.tar.gz: afad060a7a899d69b75ca2c44aa69a07c743984fc6897cce825c6d9ec3269bbb3733671243afe7fb33a615e61e4aa8c7b9e7863fa18289578ab29abc8409e2e8
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Mysql2 - A modern, simple and very fast MySQL library for Ruby - binding to libmysql
|
2
2
|
|
3
|
-
[](https://travis-ci.org/brianmario/mysql2)
|
4
|
+
Appveyor CI [](https://ci.appveyor.com/project/sodabrew/mysql2)
|
4
5
|
|
5
6
|
The Mysql2 gem is meant to serve the extremely common use-case of connecting, querying and iterating on results.
|
6
7
|
Some database libraries out there serve as direct 1:1 mappings of the already complex C APIs available.
|
@@ -15,12 +16,16 @@ The API consists of two classes:
|
|
15
16
|
`Mysql2::Result` - returned from issuing a #query on the connection. It includes Enumerable.
|
16
17
|
|
17
18
|
## Installing
|
18
|
-
###
|
19
|
+
### General Instructions
|
19
20
|
``` sh
|
20
21
|
gem install mysql2
|
21
22
|
```
|
22
23
|
|
23
|
-
This gem links against MySQL's `libmysqlclient`
|
24
|
+
This gem links against MySQL's `libmysqlclient` library or `Connector/C`
|
25
|
+
library, and compatible alternatives such as MariaDB.
|
26
|
+
You may need to install a package such as `libmysqlclient-dev`, `mysql-devel`,
|
27
|
+
or other appropriate package for your system. See below for system-specific
|
28
|
+
instructions.
|
24
29
|
|
25
30
|
By default, the mysql2 gem will try to find a copy of MySQL in this order:
|
26
31
|
|
@@ -51,25 +56,35 @@ This may be needed if you deploy to a system where these libraries
|
|
51
56
|
are located somewhere different than on your build system.
|
52
57
|
This overrides any rpath calculated by default or by the options above.
|
53
58
|
|
54
|
-
###
|
55
|
-
|
56
|
-
|
59
|
+
### Linux and other Unixes
|
60
|
+
|
61
|
+
You may need to install a package such as `libmysqlclient-dev` or `mysql-devel`;
|
62
|
+
refer to your distribution's package guide to find the particular package.
|
63
|
+
The most common issue we see is a user who has the library file `libmysqlclient.so` but is
|
64
|
+
missing the header file `mysql.h` -- double check that you have the _-dev_ packages installed.
|
57
65
|
|
58
|
-
|
59
|
-
you can use that. If not, you will need to either copy the MySQL directory from your server, or else
|
60
|
-
obtain a copy of the MySQL C connector: http://dev.mysql.com/downloads/connector/c/
|
66
|
+
### Mac OS X
|
61
67
|
|
62
|
-
|
68
|
+
You may use MacPorts, Homebrew, or a native MySQL installer package. The most
|
69
|
+
common paths will be automatically searched. If you want to select a specific
|
70
|
+
MySQL directory, use the `--with-mysql-dir` or `--with-mysql-config` options above.
|
71
|
+
|
72
|
+
### Windows
|
73
|
+
Make sure that you have Ruby and the DevKit compilers installed. We recommend
|
74
|
+
the [Ruby Installer](http://rubyinstaller.org) distribution.
|
63
75
|
|
64
|
-
|
65
|
-
|
66
|
-
|
76
|
+
By default, the mysql2 gem will download and use MySQL Connector/C from
|
77
|
+
mysql.com. If you prefer to use a local installation of Connector/C, add the
|
78
|
+
flag `--with-mysql-dir=c:/mysql-connector-c-x-y-z` (_this path may use forward slashes_).
|
67
79
|
|
68
|
-
|
80
|
+
By default, the `libmysql.dll` library will be copied into the mysql2 gem
|
81
|
+
directory. To prevent this, add the flag `--no-vendor-libmysql`. The mysql2 gem
|
82
|
+
will search for `libmysql.dll` in the following paths, in order:
|
69
83
|
|
70
|
-
|
71
|
-
|
72
|
-
|
84
|
+
* Environment variable `RUBY_MYSQL2_LIBMYSQL_DLL=C:\path\to\libmysql.dll`
|
85
|
+
(_note the Windows-style backslashes_).
|
86
|
+
* In the mysql2 gem's own directory `vendor/libmysql.dll`
|
87
|
+
* In the system's default library search paths.
|
73
88
|
|
74
89
|
## Usage
|
75
90
|
|
@@ -422,13 +437,13 @@ As for field values themselves, I'm workin on it - but expect that soon.
|
|
422
437
|
|
423
438
|
This gem is tested with the following Ruby versions on Linux and Mac OS X:
|
424
439
|
|
425
|
-
* Ruby MRI 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.x (ongoing patch releases)
|
440
|
+
* Ruby MRI 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.x, 2.2.x (ongoing patch releases)
|
426
441
|
* Ruby Enterprise Edition (based on MRI 1.8.7)
|
427
442
|
* Rubinius 2.x
|
428
443
|
|
429
444
|
This gem is tested with the following MySQL and MariaDB versions:
|
430
445
|
|
431
|
-
* MySQL 5.0, 5.1, 5.5, 5.6
|
446
|
+
* MySQL 5.0, 5.1, 5.5, 5.6, 5.7
|
432
447
|
* MySQL Connector/C 6.0 and 6.1 (primarily on Windows)
|
433
448
|
* MariaDB 5.5, 10.0
|
434
449
|
|
data/ext/mysql2/client.c
CHANGED
@@ -438,7 +438,7 @@ static void *nogvl_do_result(void *ptr, char use_result) {
|
|
438
438
|
MYSQL_RES *result;
|
439
439
|
|
440
440
|
wrapper = (mysql_client_wrapper *)ptr;
|
441
|
-
if(use_result) {
|
441
|
+
if (use_result) {
|
442
442
|
result = mysql_use_result(wrapper->client);
|
443
443
|
} else {
|
444
444
|
result = mysql_store_result(wrapper->client);
|
@@ -483,7 +483,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
|
|
483
483
|
}
|
484
484
|
|
485
485
|
is_streaming = rb_hash_aref(rb_iv_get(self, "@current_query_options"), sym_stream);
|
486
|
-
if(is_streaming == Qtrue) {
|
486
|
+
if (is_streaming == Qtrue) {
|
487
487
|
result = (MYSQL_RES *)rb_thread_call_without_gvl(nogvl_use_result, wrapper, RUBY_UBF_IO, 0);
|
488
488
|
} else {
|
489
489
|
result = (MYSQL_RES *)rb_thread_call_without_gvl(nogvl_store_result, wrapper, RUBY_UBF_IO, 0);
|
data/ext/mysql2/extconf.rb
CHANGED
@@ -20,13 +20,13 @@ dirs = ENV['PATH'].split(File::PATH_SEPARATOR) + %w[
|
|
20
20
|
/opt
|
21
21
|
/opt/local
|
22
22
|
/opt/local/mysql
|
23
|
-
/opt/local/lib/mysql5
|
23
|
+
/opt/local/lib/mysql5*
|
24
24
|
/usr
|
25
25
|
/usr/mysql
|
26
26
|
/usr/local
|
27
27
|
/usr/local/mysql
|
28
28
|
/usr/local/mysql-*
|
29
|
-
/usr/local/lib/mysql5
|
29
|
+
/usr/local/lib/mysql5*
|
30
30
|
].map{|dir| "#{dir}/bin" }
|
31
31
|
|
32
32
|
GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}"
|
@@ -74,10 +74,6 @@ else
|
|
74
74
|
rpath_dir = lib
|
75
75
|
end
|
76
76
|
|
77
|
-
if RUBY_PLATFORM =~ /mswin|mingw/
|
78
|
-
exit 1 unless have_library('libmysql')
|
79
|
-
end
|
80
|
-
|
81
77
|
if have_header('mysql.h')
|
82
78
|
prefix = nil
|
83
79
|
elsif have_header('mysql/mysql.h')
|
@@ -98,31 +94,82 @@ if try_link('int main() {return 0;}', gcc_flags)
|
|
98
94
|
$CFLAGS << gcc_flags
|
99
95
|
end
|
100
96
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
97
|
+
if RUBY_PLATFORM =~ /mswin|mingw/
|
98
|
+
# Build libmysql.a interface link library
|
99
|
+
require 'rake'
|
100
|
+
|
101
|
+
# Build libmysql.a interface link library
|
102
|
+
# Use rake to rebuild only if these files change
|
103
|
+
deffile = File.expand_path('../../../support/libmysql.def', __FILE__)
|
104
|
+
libfile = File.expand_path(File.join(rpath_dir, 'libmysql.lib'))
|
105
|
+
file 'libmysql.a' => [deffile, libfile] do |t|
|
106
|
+
when_writing 'building libmysql.a' do
|
107
|
+
# Ruby kindly shows us where dllwrap is, but that tool does more than we want.
|
108
|
+
# Maybe in the future Ruby could provide RbConfig::CONFIG['DLLTOOL'] directly.
|
109
|
+
dlltool = RbConfig::CONFIG['DLLWRAP'].gsub('dllwrap', 'dlltool')
|
110
|
+
sh dlltool, '--kill-at',
|
111
|
+
'--dllname', 'libmysql.dll',
|
112
|
+
'--output-lib', 'libmysql.a',
|
113
|
+
'--input-def', deffile, libfile
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
Rake::Task['libmysql.a'].invoke
|
118
|
+
$LOCAL_LIBS << ' ' << 'libmysql.a'
|
119
|
+
|
120
|
+
# Make sure the generated interface library works (if cross-compiling, trust without verifying)
|
121
|
+
unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
122
|
+
abort "-----\nCannot find libmysql.a\n----" unless have_library('libmysql')
|
123
|
+
abort "-----\nCannot link to libmysql.a (my_init)\n----" unless have_func('my_init')
|
124
|
+
end
|
125
|
+
|
126
|
+
# Vendor libmysql.dll
|
127
|
+
vendordir = File.expand_path('../../../vendor/', __FILE__)
|
128
|
+
directory vendordir
|
129
|
+
|
130
|
+
vendordll = File.join(vendordir, 'libmysql.dll')
|
131
|
+
dllfile = File.expand_path(File.join(rpath_dir, 'libmysql.dll'))
|
132
|
+
file vendordll => [dllfile, vendordir] do |t|
|
133
|
+
when_writing 'copying libmysql.dll' do
|
134
|
+
cp dllfile, vendordll
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Copy libmysql.dll to the local vendor directory by default
|
139
|
+
if arg_config('--no-vendor-libmysql')
|
140
|
+
# Fine, don't.
|
141
|
+
puts "--no-vendor-libmysql"
|
142
|
+
else # Default: arg_config('--vendor-libmysql')
|
143
|
+
# Let's do it!
|
144
|
+
Rake::Task[vendordll].invoke
|
145
|
+
end
|
111
146
|
else
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
147
|
+
case explicit_rpath = with_config('mysql-rpath')
|
148
|
+
when true
|
149
|
+
abort "-----\nOption --with-mysql-rpath must have an argument\n-----"
|
150
|
+
when false
|
151
|
+
warn "-----\nOption --with-mysql-rpath has been disabled at your request\n-----"
|
152
|
+
when String
|
153
|
+
# The user gave us a value so use it
|
154
|
+
rpath_flags = " -Wl,-rpath,#{explicit_rpath}"
|
155
|
+
warn "-----\nSetting mysql rpath to #{explicit_rpath}\n-----"
|
156
|
+
$LDFLAGS << rpath_flags
|
157
|
+
else
|
158
|
+
if libdir = rpath_dir[%r{(-L)?(/[^ ]+)}, 2]
|
159
|
+
rpath_flags = " -Wl,-rpath,#{libdir}"
|
160
|
+
if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', rpath_flags)
|
161
|
+
# Usually Ruby sets RPATHFLAG the right way for each system, but not on OS X.
|
162
|
+
warn "-----\nSetting rpath to #{libdir}\n-----"
|
163
|
+
$LDFLAGS << rpath_flags
|
164
|
+
else
|
165
|
+
if RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
|
166
|
+
# If we got here because try_link failed, warn the user
|
167
|
+
warn "-----\nDon't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load\n-----"
|
168
|
+
end
|
169
|
+
# Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
|
170
|
+
warn "-----\nSetting libpath to #{libdir}\n-----"
|
171
|
+
$LIBPATH << libdir unless $LIBPATH.include?(libdir)
|
122
172
|
end
|
123
|
-
# Make sure that LIBPATH gets set if we didn't explicitly set the rpath.
|
124
|
-
warn "-----\nSetting libpath to #{libdir}\n-----"
|
125
|
-
$LIBPATH << libdir unless $LIBPATH.include?(libdir)
|
126
173
|
end
|
127
174
|
end
|
128
175
|
end
|
data/ext/mysql2/result.c
CHANGED
@@ -232,7 +232,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
|
|
232
232
|
VALUE val = Qnil;
|
233
233
|
enum enum_field_types type = fields[i].type;
|
234
234
|
|
235
|
-
if(!cast) {
|
235
|
+
if (!cast) {
|
236
236
|
if (type == MYSQL_TYPE_NULL) {
|
237
237
|
val = Qnil;
|
238
238
|
} else {
|
@@ -297,7 +297,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
|
|
297
297
|
break;
|
298
298
|
}
|
299
299
|
msec = msec_char_to_uint(msec_char, sizeof(msec_char));
|
300
|
-
val = rb_funcall(rb_cTime, db_timezone,
|
300
|
+
val = rb_funcall(rb_cTime, db_timezone, 7, opt_time_year, opt_time_month, opt_time_month, UINT2NUM(hour), UINT2NUM(min), UINT2NUM(sec), UINT2NUM(msec));
|
301
301
|
if (!NIL_P(app_timezone)) {
|
302
302
|
if (app_timezone == intern_local) {
|
303
303
|
val = rb_funcall(val, intern_localtime, 0);
|
@@ -479,11 +479,11 @@ static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self) {
|
|
479
479
|
cast = 0;
|
480
480
|
}
|
481
481
|
|
482
|
-
if(rb_hash_aref(opts, sym_stream) == Qtrue) {
|
482
|
+
if (rb_hash_aref(opts, sym_stream) == Qtrue) {
|
483
483
|
streaming = 1;
|
484
484
|
}
|
485
485
|
|
486
|
-
if(streaming && cacheRows) {
|
486
|
+
if (streaming && cacheRows) {
|
487
487
|
rb_warn("cacheRows is ignored if streaming is true");
|
488
488
|
}
|
489
489
|
|
@@ -601,7 +601,7 @@ static VALUE rb_mysql_result_count(VALUE self) {
|
|
601
601
|
mysql2_result_wrapper *wrapper;
|
602
602
|
|
603
603
|
GetMysql2Result(self, wrapper);
|
604
|
-
if(wrapper->resultFreed) {
|
604
|
+
if (wrapper->resultFreed) {
|
605
605
|
if (wrapper->streamingComplete){
|
606
606
|
return LONG2NUM(wrapper->numberOfRows);
|
607
607
|
} else {
|
data/lib/mysql2.rb
CHANGED
@@ -3,6 +3,29 @@ require 'date'
|
|
3
3
|
require 'bigdecimal'
|
4
4
|
require 'rational' unless RUBY_VERSION >= '1.9.2'
|
5
5
|
|
6
|
+
# Load libmysql.dll before requiring mysql2/mysql2.so
|
7
|
+
# This gives a chance to be flexible about the load path
|
8
|
+
# Or to bomb out with a clear error message instead of a linker crash
|
9
|
+
if RUBY_PLATFORM =~ /mswin|mingw/
|
10
|
+
dll_path = if ENV['RUBY_MYSQL2_LIBMYSQL_DLL']
|
11
|
+
# If this environment variable is set, it overrides any other paths
|
12
|
+
# The user is advised to use backslashes not forward slashes
|
13
|
+
ENV['RUBY_MYSQL2_LIBMYSQL_DLL'].dup
|
14
|
+
elsif File.exist?(File.expand_path('../vendor/libmysql.dll', File.dirname(__FILE__)))
|
15
|
+
# Use vendor/libmysql.dll if it exists, convert slashes for Win32 LoadLibrary
|
16
|
+
File.expand_path('../vendor/libmysql.dll', File.dirname(__FILE__)).gsub('/', '\\')
|
17
|
+
else
|
18
|
+
# This will use default / system library paths
|
19
|
+
'libmysql.dll'
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'Win32API'
|
23
|
+
LoadLibrary = Win32API.new('Kernel32', 'LoadLibrary', ['P'], 'I')
|
24
|
+
if 0 == LoadLibrary.call(dll_path)
|
25
|
+
abort "Failed to load libmysql.dll from #{dll_path}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
6
29
|
require 'mysql2/version' unless defined? Mysql2::VERSION
|
7
30
|
require 'mysql2/error'
|
8
31
|
require 'mysql2/mysql2'
|
data/lib/mysql2/em.rb
CHANGED
@@ -10,6 +10,7 @@ module Mysql2
|
|
10
10
|
def initialize(client, deferable)
|
11
11
|
@client = client
|
12
12
|
@deferable = deferable
|
13
|
+
@is_watching = true
|
13
14
|
end
|
14
15
|
|
15
16
|
def notify_readable
|
@@ -22,11 +23,19 @@ module Mysql2
|
|
22
23
|
@deferable.succeed(result)
|
23
24
|
end
|
24
25
|
end
|
26
|
+
|
27
|
+
def watching?
|
28
|
+
@is_watching
|
29
|
+
end
|
30
|
+
|
31
|
+
def unbind
|
32
|
+
@is_watching = false
|
33
|
+
end
|
25
34
|
end
|
26
35
|
|
27
36
|
def close(*args)
|
28
37
|
if @watch
|
29
|
-
@watch.detach
|
38
|
+
@watch.detach if @watch.watching?
|
30
39
|
end
|
31
40
|
super(*args)
|
32
41
|
end
|
data/lib/mysql2/version.rb
CHANGED
data/spec/em/em_spec.rb
CHANGED
@@ -108,6 +108,27 @@ begin
|
|
108
108
|
callbacks_run.should == [:errback]
|
109
109
|
end
|
110
110
|
end
|
111
|
+
|
112
|
+
it "should not raise error when closing client with no query running" do
|
113
|
+
callbacks_run = []
|
114
|
+
EM.run do
|
115
|
+
client = Mysql2::EM::Client.new DatabaseCredentials['root']
|
116
|
+
defer = client.query("select sleep(0.025)")
|
117
|
+
defer.callback do |result|
|
118
|
+
callbacks_run << :callback
|
119
|
+
end
|
120
|
+
defer.errback do |err|
|
121
|
+
callbacks_run << :errback
|
122
|
+
end
|
123
|
+
EM.add_timer(0.1) do
|
124
|
+
callbacks_run.should == [:callback]
|
125
|
+
lambda {
|
126
|
+
client.close
|
127
|
+
}.should_not raise_error(/invalid binding to detach/)
|
128
|
+
EM.stop_event_loop
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
111
132
|
end
|
112
133
|
rescue LoadError
|
113
134
|
puts "EventMachine not installed, skipping the specs that use it"
|
data/spec/mysql2/client_spec.rb
CHANGED
@@ -564,7 +564,7 @@ describe Mysql2::Client do
|
|
564
564
|
end
|
565
565
|
|
566
566
|
it "should raise an exception when one of multiple statements fails" do
|
567
|
-
result = @multi_client.query("SELECT 1
|
567
|
+
result = @multi_client.query("SELECT 1 AS 'set_1'; SELECT * FROM invalid_table_name; SELECT 2 AS 'set_2';")
|
568
568
|
result.first['set_1'].should be(1)
|
569
569
|
lambda {
|
570
570
|
@multi_client.next_result
|
@@ -573,7 +573,7 @@ describe Mysql2::Client do
|
|
573
573
|
end
|
574
574
|
|
575
575
|
it "returns multiple result sets" do
|
576
|
-
@multi_client.query(
|
576
|
+
@multi_client.query("SELECT 1 AS 'set_1'; SELECT 2 AS 'set_2'").first.should eql({ 'set_1' => 1 })
|
577
577
|
|
578
578
|
@multi_client.next_result.should be_true
|
579
579
|
@multi_client.store_result.first.should eql({ 'set_2' => 2 })
|
@@ -582,12 +582,12 @@ describe Mysql2::Client do
|
|
582
582
|
end
|
583
583
|
|
584
584
|
it "does not interfere with other statements" do
|
585
|
-
@multi_client.query(
|
585
|
+
@multi_client.query("SELECT 1 AS 'set_1'; SELECT 2 AS 'set_2'")
|
586
586
|
while( @multi_client.next_result )
|
587
587
|
@multi_client.store_result
|
588
588
|
end
|
589
589
|
|
590
|
-
@multi_client.query(
|
590
|
+
@multi_client.query("SELECT 3 AS 'next'").first.should == { 'next' => 3 }
|
591
591
|
end
|
592
592
|
|
593
593
|
it "will raise on query if there are outstanding results to read" do
|
@@ -606,7 +606,7 @@ describe Mysql2::Client do
|
|
606
606
|
end
|
607
607
|
|
608
608
|
it "#more_results? should work" do
|
609
|
-
@multi_client.query(
|
609
|
+
@multi_client.query("SELECT 1 AS 'set_1'; SELECT 2 AS 'set_2'")
|
610
610
|
@multi_client.more_results?.should be_true
|
611
611
|
|
612
612
|
@multi_client.next_result
|
data/spec/mysql2/result_spec.rb
CHANGED
@@ -136,7 +136,7 @@ describe Mysql2::Result do
|
|
136
136
|
it "should raise an exception if streaming ended due to a timeout" do
|
137
137
|
# Create an extra client instance, since we're going to time it out
|
138
138
|
client = Mysql2::Client.new DatabaseCredentials['root']
|
139
|
-
client.query "CREATE TEMPORARY TABLE streamingTest (val BINARY(255))"
|
139
|
+
client.query "CREATE TEMPORARY TABLE streamingTest (val BINARY(255)) ENGINE=MEMORY"
|
140
140
|
|
141
141
|
# Insert enough records to force the result set into multiple reads
|
142
142
|
# (the BINARY type is used simply because it forces full width results)
|
@@ -0,0 +1,219 @@
|
|
1
|
+
; MySQL's Connector/C ships with a libmysql.dll main library and libmysql.lib
|
2
|
+
; interface library. However, the interface library is not linkable by MinGW.
|
3
|
+
;
|
4
|
+
; At compile time, we generate a libmysql.a interface library with dlltool.exe.
|
5
|
+
;
|
6
|
+
; This def file can be re-generated using the reimp.exe or gendef.exe tools.
|
7
|
+
;
|
8
|
+
LIBRARY libmysql.dll
|
9
|
+
EXPORTS
|
10
|
+
mysql_affected_rows
|
11
|
+
mysql_affected_rows@4
|
12
|
+
mysql_change_user
|
13
|
+
mysql_change_user@16
|
14
|
+
mysql_character_set_name
|
15
|
+
mysql_character_set_name@4
|
16
|
+
mysql_close
|
17
|
+
mysql_close@4
|
18
|
+
mysql_data_seek
|
19
|
+
mysql_data_seek@12
|
20
|
+
mysql_debug
|
21
|
+
mysql_debug@4
|
22
|
+
mysql_dump_debug_info
|
23
|
+
mysql_dump_debug_info@4
|
24
|
+
mysql_eof
|
25
|
+
mysql_eof@4
|
26
|
+
mysql_errno
|
27
|
+
mysql_errno@4
|
28
|
+
mysql_error
|
29
|
+
mysql_error@4
|
30
|
+
mysql_escape_string
|
31
|
+
mysql_escape_string@12
|
32
|
+
mysql_fetch_field
|
33
|
+
mysql_fetch_field@4
|
34
|
+
mysql_fetch_field_direct
|
35
|
+
mysql_fetch_field_direct@8
|
36
|
+
mysql_fetch_fields
|
37
|
+
mysql_fetch_fields@4
|
38
|
+
mysql_fetch_lengths
|
39
|
+
mysql_fetch_lengths@4
|
40
|
+
mysql_fetch_row
|
41
|
+
mysql_fetch_row@4
|
42
|
+
mysql_field_count
|
43
|
+
mysql_field_count@4
|
44
|
+
mysql_field_seek
|
45
|
+
mysql_field_seek@8
|
46
|
+
mysql_field_tell
|
47
|
+
mysql_field_tell@4
|
48
|
+
mysql_free_result
|
49
|
+
mysql_free_result@4
|
50
|
+
mysql_get_client_info
|
51
|
+
mysql_get_client_info@0
|
52
|
+
mysql_get_client_version
|
53
|
+
mysql_get_client_version@0
|
54
|
+
mysql_get_host_info
|
55
|
+
mysql_get_host_info@4
|
56
|
+
mysql_get_option
|
57
|
+
mysql_get_option@12
|
58
|
+
mysql_get_proto_info
|
59
|
+
mysql_get_proto_info@4
|
60
|
+
mysql_get_server_info
|
61
|
+
mysql_get_server_info@4
|
62
|
+
mysql_get_server_version
|
63
|
+
mysql_get_server_version@4
|
64
|
+
mysql_get_ssl_cipher
|
65
|
+
mysql_get_ssl_cipher@4
|
66
|
+
mysql_hex_string
|
67
|
+
mysql_hex_string@12
|
68
|
+
mysql_info
|
69
|
+
mysql_info@4
|
70
|
+
mysql_init
|
71
|
+
mysql_init@4
|
72
|
+
mysql_insert_id
|
73
|
+
mysql_insert_id@4
|
74
|
+
mysql_kill
|
75
|
+
mysql_kill@8
|
76
|
+
mysql_library_end
|
77
|
+
mysql_library_end@0
|
78
|
+
mysql_library_init
|
79
|
+
mysql_library_init@12
|
80
|
+
mysql_list_dbs
|
81
|
+
mysql_list_dbs@8
|
82
|
+
mysql_list_fields
|
83
|
+
mysql_list_fields@12
|
84
|
+
mysql_list_processes
|
85
|
+
mysql_list_processes@4
|
86
|
+
mysql_list_tables
|
87
|
+
mysql_list_tables@8
|
88
|
+
mysql_more_results
|
89
|
+
mysql_more_results@4
|
90
|
+
mysql_next_result
|
91
|
+
mysql_next_result@4
|
92
|
+
mysql_num_fields
|
93
|
+
mysql_num_fields@4
|
94
|
+
mysql_num_rows
|
95
|
+
mysql_num_rows@4
|
96
|
+
mysql_options
|
97
|
+
mysql_options@12
|
98
|
+
mysql_options4
|
99
|
+
mysql_options4@16
|
100
|
+
mysql_ping
|
101
|
+
mysql_ping@4
|
102
|
+
mysql_query
|
103
|
+
mysql_query@8
|
104
|
+
mysql_read_query_result
|
105
|
+
mysql_read_query_result@4
|
106
|
+
mysql_real_connect
|
107
|
+
mysql_real_connect@32
|
108
|
+
mysql_real_escape_string
|
109
|
+
mysql_real_escape_string@16
|
110
|
+
mysql_real_query
|
111
|
+
mysql_real_query@12
|
112
|
+
mysql_refresh
|
113
|
+
mysql_refresh@8
|
114
|
+
mysql_reset_connection
|
115
|
+
mysql_reset_connection@4
|
116
|
+
mysql_rollback
|
117
|
+
mysql_rollback@4
|
118
|
+
mysql_row_seek
|
119
|
+
mysql_row_seek@8
|
120
|
+
mysql_row_tell
|
121
|
+
mysql_row_tell@4
|
122
|
+
mysql_select_db
|
123
|
+
mysql_select_db@8
|
124
|
+
mysql_send_query
|
125
|
+
mysql_send_query@12
|
126
|
+
mysql_server_end
|
127
|
+
mysql_server_end@0
|
128
|
+
mysql_server_init
|
129
|
+
mysql_server_init@12
|
130
|
+
mysql_session_track_get_first
|
131
|
+
mysql_session_track_get_first@16
|
132
|
+
mysql_session_track_get_next
|
133
|
+
mysql_session_track_get_next@16
|
134
|
+
mysql_set_character_set
|
135
|
+
mysql_set_character_set@8
|
136
|
+
mysql_set_local_infile_default
|
137
|
+
mysql_set_local_infile_default@4
|
138
|
+
mysql_set_local_infile_handler
|
139
|
+
mysql_set_local_infile_handler@24
|
140
|
+
mysql_set_server_option
|
141
|
+
mysql_set_server_option@8
|
142
|
+
mysql_shutdown
|
143
|
+
mysql_shutdown@8
|
144
|
+
mysql_sqlstate
|
145
|
+
mysql_sqlstate@4
|
146
|
+
mysql_ssl_set
|
147
|
+
mysql_ssl_set@24
|
148
|
+
mysql_stat
|
149
|
+
mysql_stat@4
|
150
|
+
mysql_stmt_affected_rows
|
151
|
+
mysql_stmt_affected_rows@4
|
152
|
+
mysql_stmt_attr_get
|
153
|
+
mysql_stmt_attr_get@12
|
154
|
+
mysql_stmt_attr_set
|
155
|
+
mysql_stmt_attr_set@12
|
156
|
+
mysql_stmt_bind_param
|
157
|
+
mysql_stmt_bind_param@8
|
158
|
+
mysql_stmt_bind_result
|
159
|
+
mysql_stmt_bind_result@8
|
160
|
+
mysql_stmt_close
|
161
|
+
mysql_stmt_close@4
|
162
|
+
mysql_stmt_data_seek
|
163
|
+
mysql_stmt_data_seek@12
|
164
|
+
mysql_stmt_errno
|
165
|
+
mysql_stmt_errno@4
|
166
|
+
mysql_stmt_error
|
167
|
+
mysql_stmt_error@4
|
168
|
+
mysql_stmt_execute
|
169
|
+
mysql_stmt_execute@4
|
170
|
+
mysql_stmt_fetch
|
171
|
+
mysql_stmt_fetch@4
|
172
|
+
mysql_stmt_fetch_column
|
173
|
+
mysql_stmt_fetch_column@16
|
174
|
+
mysql_stmt_field_count
|
175
|
+
mysql_stmt_field_count@4
|
176
|
+
mysql_stmt_free_result
|
177
|
+
mysql_stmt_free_result@4
|
178
|
+
mysql_stmt_init
|
179
|
+
mysql_stmt_init@4
|
180
|
+
mysql_stmt_insert_id
|
181
|
+
mysql_stmt_insert_id@4
|
182
|
+
mysql_stmt_next_result
|
183
|
+
mysql_stmt_next_result@4
|
184
|
+
mysql_stmt_num_rows
|
185
|
+
mysql_stmt_num_rows@4
|
186
|
+
mysql_stmt_param_count
|
187
|
+
mysql_stmt_param_count@4
|
188
|
+
mysql_stmt_param_metadata
|
189
|
+
mysql_stmt_param_metadata@4
|
190
|
+
mysql_stmt_prepare
|
191
|
+
mysql_stmt_prepare@12
|
192
|
+
mysql_stmt_reset
|
193
|
+
mysql_stmt_reset@4
|
194
|
+
mysql_stmt_result_metadata
|
195
|
+
mysql_stmt_result_metadata@4
|
196
|
+
mysql_stmt_row_seek
|
197
|
+
mysql_stmt_row_seek@8
|
198
|
+
mysql_stmt_row_tell
|
199
|
+
mysql_stmt_row_tell@4
|
200
|
+
mysql_stmt_send_long_data
|
201
|
+
mysql_stmt_send_long_data@16
|
202
|
+
mysql_stmt_sqlstate
|
203
|
+
mysql_stmt_sqlstate@4
|
204
|
+
mysql_stmt_store_result
|
205
|
+
mysql_stmt_store_result@4
|
206
|
+
mysql_store_result
|
207
|
+
mysql_store_result@4
|
208
|
+
mysql_thread_end
|
209
|
+
mysql_thread_end@0
|
210
|
+
mysql_thread_id
|
211
|
+
mysql_thread_id@4
|
212
|
+
mysql_thread_init
|
213
|
+
mysql_thread_init@0
|
214
|
+
mysql_thread_safe
|
215
|
+
mysql_thread_safe@0
|
216
|
+
mysql_use_result
|
217
|
+
mysql_use_result@4
|
218
|
+
mysql_warning_count
|
219
|
+
mysql_warning_count@4
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: eventmachine
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake-compiler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ~>
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
19
|
+
version: 0.9.5
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - ~>
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
26
|
+
version: 0.9.5
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +59,6 @@ extensions:
|
|
73
59
|
- ext/mysql2/extconf.rb
|
74
60
|
extra_rdoc_files: []
|
75
61
|
files:
|
76
|
-
- MIT-LICENSE
|
77
62
|
- README.md
|
78
63
|
- ext/mysql2/client.c
|
79
64
|
- ext/mysql2/client.h
|
@@ -94,6 +79,7 @@ files:
|
|
94
79
|
- lib/mysql2/error.rb
|
95
80
|
- lib/mysql2/result.rb
|
96
81
|
- lib/mysql2/version.rb
|
82
|
+
- support/libmysql.def
|
97
83
|
- support/mysql_enc_to_ruby.rb
|
98
84
|
- support/ruby_enc_to_mysql.rb
|
99
85
|
- examples/eventmachine.rb
|
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2010-2011 Brian Lopez - http://github.com/brianmario
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|