mysql2 0.3.21 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/README.md +28 -6
  4. data/examples/eventmachine.rb +1 -1
  5. data/examples/threaded.rb +4 -6
  6. data/ext/mysql2/client.c +93 -84
  7. data/ext/mysql2/client.h +21 -1
  8. data/ext/mysql2/extconf.rb +60 -41
  9. data/ext/mysql2/infile.c +2 -2
  10. data/ext/mysql2/mysql2_ext.c +1 -0
  11. data/ext/mysql2/mysql2_ext.h +5 -6
  12. data/ext/mysql2/mysql_enc_name_to_ruby.h +2 -2
  13. data/ext/mysql2/mysql_enc_to_ruby.h +25 -22
  14. data/ext/mysql2/result.c +464 -97
  15. data/ext/mysql2/result.h +11 -4
  16. data/ext/mysql2/statement.c +491 -0
  17. data/ext/mysql2/statement.h +18 -0
  18. data/lib/mysql2/client.rb +32 -24
  19. data/lib/mysql2/console.rb +1 -1
  20. data/lib/mysql2/em.rb +5 -6
  21. data/lib/mysql2/error.rb +17 -26
  22. data/lib/mysql2/field.rb +3 -0
  23. data/lib/mysql2/statement.rb +17 -0
  24. data/lib/mysql2/version.rb +1 -1
  25. data/lib/mysql2.rb +37 -35
  26. data/spec/em/em_spec.rb +21 -21
  27. data/spec/mysql2/client_spec.rb +322 -290
  28. data/spec/mysql2/error_spec.rb +37 -36
  29. data/spec/mysql2/result_spec.rb +200 -209
  30. data/spec/mysql2/statement_spec.rb +684 -0
  31. data/spec/spec_helper.rb +7 -0
  32. data/spec/ssl/ca-cert.pem +17 -0
  33. data/spec/ssl/ca-key.pem +27 -0
  34. data/spec/ssl/ca.cnf +22 -0
  35. data/spec/ssl/cert.cnf +22 -0
  36. data/spec/ssl/client-cert.pem +17 -0
  37. data/spec/ssl/client-key.pem +27 -0
  38. data/spec/ssl/client-req.pem +15 -0
  39. data/spec/ssl/gen_certs.sh +48 -0
  40. data/spec/ssl/pkcs8-client-key.pem +28 -0
  41. data/spec/ssl/pkcs8-server-key.pem +28 -0
  42. data/spec/ssl/server-cert.pem +17 -0
  43. data/spec/ssl/server-key.pem +27 -0
  44. data/spec/ssl/server-req.pem +15 -0
  45. data/support/mysql_enc_to_ruby.rb +7 -8
  46. data/support/ruby_enc_to_mysql.rb +1 -1
  47. metadata +41 -47
data/spec/spec_helper.rb CHANGED
@@ -7,13 +7,20 @@ require 'yaml'
7
7
  DatabaseCredentials = YAML.load_file('spec/configuration.yml')
8
8
 
9
9
  RSpec.configure do |config|
10
+ config.disable_monkey_patching!
11
+
10
12
  def with_internal_encoding(encoding)
11
13
  old_enc = Encoding.default_internal
14
+ old_verbose = $VERBOSE
15
+ $VERBOSE = nil
12
16
  Encoding.default_internal = encoding
17
+ $VERBOSE = old_verbose
13
18
 
14
19
  yield
15
20
  ensure
21
+ $VERBOSE = nil
16
22
  Encoding.default_internal = old_enc
23
+ $VERBOSE = old_verbose
17
24
  end
18
25
 
19
26
  config.before :each do
@@ -0,0 +1,17 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIICqjCCAZICCQDbDS+Z2mpWkDANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxj
3
+ YV9teXNxbDJnZW0wHhcNMTUwOTA5MDQ1NzIxWhcNMjUwNzE4MDQ1NzIxWjAXMRUw
4
+ EwYDVQQDDAxjYV9teXNxbDJnZW0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
5
+ AoIBAQDFnpc22lPFtdPELsIffsDt8cD2Hkt47nGMcKQ9n4U98yAg+fodipyP1Bn0
6
+ 2OeaONqpttJIET7HxlGrtugPtV/O8XZHlhfAHrRUDMFZJhgnnqK+c/7fRGeB0Eqw
7
+ ljBlRD/dDL3bFq5hVBC9QsGi5k03r+xLPKm5ccAr4WtofcoKXqEbSO6koTSrsGG5
8
+ 7inlldM2AVzrY2kXbe0jAyNvYmDL2ycN8G2wObogPWDfITQRhOxfkzKIQiEhQF2Y
9
+ /DlhT7IbIarBIm6abf6JxZ6/S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2LOe6lPe1hoeB6rT44IYZaWMo3ikY8xW9RztOLSv8E9uE1K9yq8OA
26
+ P8QzXmr1Lga+hoEmMHc2biEJNeF6iAcAFfrHj9Sr7w5PC8g4A3PlCvU=
27
+ -----END RSA PRIVATE KEY-----
data/spec/ssl/ca.cnf ADDED
@@ -0,0 +1,22 @@
1
+
2
+ [ ca ]
3
+ # January 1, 2015
4
+ default_startdate = 2015010360000Z
5
+
6
+ [ req ]
7
+ distinguished_name = req_distinguished_name
8
+
9
+ [ req_distinguished_name ]
10
+ # If this isn't set, the error is error, no objects specified in config file
11
+ commonName = Common Name (hostname, IP, or your name)
12
+
13
+ countryName_default = US
14
+ stateOrProvinceName_default = CA
15
+ localityName_default = San Francisco
16
+ 0.organizationName_default = mysql2_gem
17
+ organizationalUnitName_default = Mysql2Gem
18
+ emailAddress_default = mysql2gem@example.com
19
+
20
+
21
+ commonName_default = ca_mysql2gem
22
+
data/spec/ssl/cert.cnf ADDED
@@ -0,0 +1,22 @@
1
+
2
+ [ ca ]
3
+ # January 1, 2015
4
+ default_startdate = 2015010360000Z
5
+
6
+ [ req ]
7
+ distinguished_name = req_distinguished_name
8
+
9
+ [ req_distinguished_name ]
10
+ # If this isn't set, the error is error, no objects specified in config file
11
+ commonName = Common Name (hostname, IP, or your name)
12
+
13
+ countryName_default = US
14
+ stateOrProvinceName_default = CA
15
+ localityName_default = San Francisco
16
+ 0.organizationName_default = mysql2_gem
17
+ organizationalUnitName_default = Mysql2Gem
18
+ emailAddress_default = mysql2gem@example.com
19
+
20
+
21
+ commonName_default = mysql2gem.example.com
22
+
@@ -0,0 +1,17 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIICqzCCAZMCAQEwDQYJKoZIhvcNAQELBQAwFzEVMBMGA1UEAwwMY2FfbXlzcWwy
3
+ Z2VtMB4XDTE1MDkwOTA0NTcyMVoXDTI1MDcxODA0NTcyMVowIDEeMBwGA1UEAwwV
4
+ bXlzcWwyZ2VtLmV4YW1wbGUuY29tM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QELBQADggEBAB05YaBSyAKCgHfBWhpZ1+OOVp1anr2v
10
+ TkStnqmNrNM2qBJXjfrythPTX4EJAt7+eNdH/6IVA93qKC/EUQVuMjgfMmMUaM+m
11
+ 5pqfAo95w7vUY147U9nbC+EIo2u1KOVTNTgl45H372/1vCwTHZYu2atCk4tN3ueO
12
+ 0O2XW89Kq94/7PDAExN2PhZdeATVX9dPNT+7ZUDNe8cuq9v0YCHy+2JN2WkplxcG
13
+ kMyCE3YYLnd96YtWiS9DOUib3+b7FwyGe0dXeLVw1br3NZGCZrybyfmnAQfiouAF
14
+ 9nMxKIpWFSx00ubGrUefOQqp6nuk27n+scgr4+d6dBXz9efEEvTbLKA=
15
+ -----END CERTIFICATE REQUEST-----
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eu
4
+
5
+ echo "
6
+ [ ca ]
7
+ # January 1, 2015
8
+ default_startdate = 2015010360000Z
9
+
10
+ [ req ]
11
+ distinguished_name = req_distinguished_name
12
+
13
+ [ req_distinguished_name ]
14
+ # If this isn't set, the error is "error, no objects specified in config file"
15
+ commonName = Common Name (hostname, IP, or your name)
16
+
17
+ countryName_default = US
18
+ stateOrProvinceName_default = CA
19
+ localityName_default = San Francisco
20
+ 0.organizationName_default = mysql2_gem
21
+ organizationalUnitName_default = Mysql2Gem
22
+ emailAddress_default = mysql2gem@example.com
23
+ " | tee ca.cnf cert.cnf
24
+
25
+ # The client and server certs must have a diferent common name than the CA
26
+ # to avoid "SSL connection error: error:00000001:lib(0):func(0):reason(1)"
27
+
28
+ echo "
29
+ commonName_default = ca_mysql2gem
30
+ " >> ca.cnf
31
+
32
+ echo "
33
+ commonName_default = mysql2gem.example.com
34
+ " >> cert.cnf
35
+
36
+ # Generate a set of certificates
37
+ openssl genrsa -out ca-key.pem 2048
38
+ openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca-cert.pem -batch -config ca.cnf
39
+ openssl req -newkey rsa:2048 -days 3600 -nodes -keyout pkcs8-server-key.pem -out server-req.pem -batch -config cert.cnf
40
+ openssl x509 -req -in server-req.pem -days 3600 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
41
+ openssl req -newkey rsa:2048 -days 3600 -nodes -keyout pkcs8-client-key.pem -out client-req.pem -batch -config cert.cnf
42
+ openssl x509 -req -in client-req.pem -days 3600 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
43
+
44
+ # Convert format from PKCS#8 to PKCS#1
45
+ openssl rsa -in pkcs8-server-key.pem -out server-key.pem
46
+ openssl rsa -in pkcs8-client-key.pem -out client-key.pem
47
+
48
+ echo "done"
@@ -0,0 +1,28 @@
1
+ -----BEGIN PRIVATE KEY-----
2
+ MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDVm4F/UVUmqKXv
3
+ 8u+deo93je6OjTGpsXLtCuqYzlT9QzeCAwJ/Yavb9ahkkY9OTU0VqJTIzmaFKWCL
4
+ T9IY8Sn0kxS4f5SK/1TCY4WX0SbcVdBDxIbt9XvrnW4BSyQ2B8SqjL5/66+LU/Xn
5
+ msc0PHtjDqL7DB+ksZNTRugycsvpw78pwhtmXHj/YuqvmxhukiqHPjptsb58iG96
6
+ mu4f2HtZVaoCJtOrKZisDdPTc78dZM6p+rTeAzs57e0m8lupfYt5xC+LZJtChfxz
7
+ YytDpfvEN7YCOHtjH0NDWCoKVOCVs8Uc2JY9wYAKD5bam0Jj9DZJ0/mHV22PlLDl
8
+ XAvd28KNAgMBAAECggEARaEaNllZy29AIBZtu0S/TXZro/YskScx0kkzrbnchG4L
9
+ wwqeHs3Eyr+qM5YrQ5f5H61DSq3VR2T0fpT3ZIAAcCQdpgKYdjLC+1abrqBT7ZDf
10
+ gaenYBwcV/KKcEuBM0eW+Q1F78bxAxbMWsHeW423ntOflvwduH7WClhbyk4XYEyA
11
+ iwtEr7xvbpMpRatIJz9nE5JjjCas3JvGSCsca3buXAg3Ry8lluZC8d683PMK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wGQvpcxmpm1p8VKKoeTqvE8OelbrqHrmyNIq7E/S3UZelVt+HOIPJOOs/aqEzaEg
12
+ VL1u+4kCMbHM2rG8dii060oZ5i/gUtMn2TQWcNjSQBvaVztW5FOL74bYkoq0zIwd
13
+ MFl2BoYyAnERJEcBmh1f+D7MuxPaqTUKjUmfDbHCMAAyTS1FHr9AnIN0/C2Mxywl
14
+ H/zL9/DkfR53KZjITkf2gTH5D/N5oDUwmgCg6UZ0MeTOP27jvgcvb/k=
15
+ -----END CERTIFICATE REQUEST-----
@@ -42,7 +42,7 @@ mysql_to_rb = {
42
42
  "binary" => "ASCII-8BIT",
43
43
  "geostd8" => "NULL",
44
44
  "cp932" => "Windows-31J",
45
- "eucjpms" => "eucJP-ms"
45
+ "eucjpms" => "eucJP-ms",
46
46
  }
47
47
 
48
48
  client = Mysql2::Client.new(:username => user, :password => pass, :host => host, :port => port.to_i)
@@ -53,7 +53,7 @@ encodings_with_nil = Array.new(encodings.size)
53
53
  collations.each do |collation|
54
54
  mysql_col_idx = collation[2].to_i
55
55
  rb_enc = mysql_to_rb[collation[1]]
56
- encodings[mysql_col_idx-1] = [mysql_col_idx, rb_enc]
56
+ encodings[mysql_col_idx - 1] = [mysql_col_idx, rb_enc]
57
57
  end
58
58
 
59
59
  encodings.each_with_index do |encoding, idx|
@@ -65,10 +65,10 @@ encodings_with_nil.sort! do |a, b|
65
65
  end
66
66
 
67
67
  encodings_with_nil = encodings_with_nil.map do |encoding|
68
- name = "NULL"
69
-
70
- if !encoding.nil? && encoding[1] != "NULL"
71
- name = "\"#{encoding[1]}\""
68
+ name = if encoding.nil? || encoding[1] == 'NULL'
69
+ 'NULL'
70
+ else
71
+ "\"#{encoding[1]}\""
72
72
  end
73
73
 
74
74
  " #{name}"
@@ -76,7 +76,6 @@ end
76
76
 
77
77
  # start printing output
78
78
 
79
- puts "const char *mysql2_mysql_enc_to_rb[] = {"
79
+ puts "static const char *mysql2_mysql_enc_to_rb[] = {"
80
80
  puts encodings_with_nil.join(",\n")
81
81
  puts "};"
82
- puts
@@ -37,7 +37,7 @@ mysql_to_rb = {
37
37
  "binary" => "ASCII-8BIT",
38
38
  "geostd8" => nil,
39
39
  "cp932" => "Windows-31J",
40
- "eucjpms" => "eucJP-ms"
40
+ "eucjpms" => "eucJP-ms",
41
41
  }
42
42
 
43
43
  puts <<-header
metadata CHANGED
@@ -1,64 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez
8
+ - Aaron Stone
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-05-08 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rake-compiler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: 0.9.5
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: 0.9.5
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: 0.9.3
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: 0.9.3
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: 2.8.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 2.8.0
12
+ date: 2015-09-16 00:00:00.000000000 Z
13
+ dependencies: []
55
14
  description:
56
- email: seniorlopez@gmail.com
15
+ email:
16
+ - seniorlopez@gmail.com
17
+ - aaron@serendipity.cx
57
18
  executables: []
58
19
  extensions:
59
20
  - ext/mysql2/extconf.rb
60
21
  extra_rdoc_files: []
61
22
  files:
23
+ - CHANGELOG.md
62
24
  - LICENSE
63
25
  - README.md
64
26
  - ext/mysql2/client.c
@@ -72,13 +34,17 @@ files:
72
34
  - ext/mysql2/mysql_enc_to_ruby.h
73
35
  - ext/mysql2/result.c
74
36
  - ext/mysql2/result.h
37
+ - ext/mysql2/statement.c
38
+ - ext/mysql2/statement.h
75
39
  - ext/mysql2/wait_for_single_fd.h
76
40
  - lib/mysql2.rb
77
41
  - lib/mysql2/client.rb
78
42
  - lib/mysql2/console.rb
79
43
  - lib/mysql2/em.rb
80
44
  - lib/mysql2/error.rb
45
+ - lib/mysql2/field.rb
81
46
  - lib/mysql2/result.rb
47
+ - lib/mysql2/statement.rb
82
48
  - lib/mysql2/version.rb
83
49
  - support/libmysql.def
84
50
  - support/mysql_enc_to_ruby.rb
@@ -91,8 +57,22 @@ files:
91
57
  - spec/mysql2/client_spec.rb
92
58
  - spec/mysql2/error_spec.rb
93
59
  - spec/mysql2/result_spec.rb
60
+ - spec/mysql2/statement_spec.rb
94
61
  - spec/rcov.opts
95
62
  - spec/spec_helper.rb
63
+ - spec/ssl/ca-cert.pem
64
+ - spec/ssl/ca-key.pem
65
+ - spec/ssl/ca.cnf
66
+ - spec/ssl/cert.cnf
67
+ - spec/ssl/client-cert.pem
68
+ - spec/ssl/client-key.pem
69
+ - spec/ssl/client-req.pem
70
+ - spec/ssl/gen_certs.sh
71
+ - spec/ssl/pkcs8-client-key.pem
72
+ - spec/ssl/pkcs8-server-key.pem
73
+ - spec/ssl/server-cert.pem
74
+ - spec/ssl/server-key.pem
75
+ - spec/ssl/server-req.pem
96
76
  - spec/test_data
97
77
  homepage: http://github.com/brianmario/mysql2
98
78
  licenses:
@@ -115,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
95
  version: '0'
116
96
  requirements: []
117
97
  rubyforge_project:
118
- rubygems_version: 2.0.14.1
98
+ rubygems_version: 2.0.14
119
99
  signing_key:
120
100
  specification_version: 4
121
101
  summary: A simple, fast Mysql library for Ruby, binding to libmysql
@@ -128,6 +108,20 @@ test_files:
128
108
  - spec/mysql2/client_spec.rb
129
109
  - spec/mysql2/error_spec.rb
130
110
  - spec/mysql2/result_spec.rb
111
+ - spec/mysql2/statement_spec.rb
131
112
  - spec/rcov.opts
132
113
  - spec/spec_helper.rb
114
+ - spec/ssl/ca-cert.pem
115
+ - spec/ssl/ca-key.pem
116
+ - spec/ssl/ca.cnf
117
+ - spec/ssl/cert.cnf
118
+ - spec/ssl/client-cert.pem
119
+ - spec/ssl/client-key.pem
120
+ - spec/ssl/client-req.pem
121
+ - spec/ssl/gen_certs.sh
122
+ - spec/ssl/pkcs8-client-key.pem
123
+ - spec/ssl/pkcs8-server-key.pem
124
+ - spec/ssl/server-cert.pem
125
+ - spec/ssl/server-key.pem
126
+ - spec/ssl/server-req.pem
133
127
  - spec/test_data