mysql2-reconnect_with_readonly 0.1.1 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ee648cbb8cc9a88119b20c4d14f2fa7da45cbed
4
- data.tar.gz: 4fe315c498af1e57afec7e055bccc9d22bdb5809
3
+ metadata.gz: 7c6fa8c8522ef6ce7d1df607405f27675d42fcfb
4
+ data.tar.gz: ae7c299be9f9631fa208b81dbcc3e7a2ce7839fc
5
5
  SHA512:
6
- metadata.gz: 5f4c97bd3ee7fd56fbbb95c6d6785f0471b8b714358e0febd1d2a53ed10a2a75fdc39806b9c3dd874975bf73e49241d39c8fb00fa47633d46aa329c197f5c2c8
7
- data.tar.gz: 0886a41cc602a1334dbf9360fa38138078f43cc497a7d9ffb1fecbe4f676213a2c102a74374b7694cfe7d62a3bdc9043b6d3725dfec09a819e5889063bcafede
6
+ metadata.gz: f0e6a2d7c6c64355250b754d5034895018118b793320ac6a83d333b079cbe00abc356166a2174f3316ed619075c684bb6c50c247ebdda322723cc4f78c60c81a
7
+ data.tar.gz: a2e0eae93a51596746fc24db9d07080b0a395267962d9f168f54a772c5f0159a7d95545a9bef077b87dde027e9bb2af19d1d48775bda858c7c0193031afe8d9c
@@ -1,3 +1,9 @@
1
+ # 0.2.0 (2017-04-07)
2
+
3
+ Fixes:
4
+
5
+ * Delegate constants, too
6
+
1
7
  # 0.1.1 (2016-08-28)
2
8
 
3
9
  Fixes:
@@ -65,11 +65,19 @@ module Mysql2
65
65
  end
66
66
  end
67
67
 
68
+ Mysql2::ReconnectWithReadonly::OriginalClient.constants.each do |const|
69
+ const_set(const, Mysql2::ReconnectWithReadonly::OriginalClient.const_get(const))
70
+ end
71
+
68
72
  def initialize(opts = {})
69
73
  @opts = opts
70
74
  @original_client = Mysql2::ReconnectWithReadonly::OriginalClient.new(@opts)
71
75
  end
72
76
 
77
+ # Mysql2::Client does not have a #reconnect method
78
+ # Mysql2::Client#close and Mysql2::Client#connect(*args) resulted in SEGV.
79
+ # It is required to create a new Mysql2::Client instance for reconnection.
80
+ # This is why we wrap orginal client with this monkey pathced client.
73
81
  def reconnect
74
82
  @original_client.close rescue nil
75
83
  @original_client = Mysql2::ReconnectWithReadonly::OriginalClient.new(@opts)
@@ -1,5 +1,5 @@
1
1
  module Mysql2
2
2
  class ReconnectWithReadonly
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2-reconnect_with_readonly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-28 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.5.1
98
+ rubygems_version: 2.5.2
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Reconnect mysql2 if the MySQL server is running with the --read-only option.