activerecord-pedantmysql2-adapter 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5255cb91c19fa45adb1a277a95d8e9113e6f52cd5c76c418bc79025a16724bc2
4
- data.tar.gz: 897ba4f42c2e58edff7b6a159d7007c273560a025c813099822c432576ffe473
3
+ metadata.gz: '0191edcf1291b66b644b0ee2aae2c192559dda880347270f4bac423ff0dae468'
4
+ data.tar.gz: ddbb36a60520e44f314416fbfac0bbef65cd89c7f2b6f7ecd0c13468c6a9d9d9
5
5
  SHA512:
6
- metadata.gz: 5a7c36b9b2d2d94b813bd3992878fb97c6ef5052285e0c29f53fcbfe3623047d7c00e0cd5776e013c5b2079a7e114603bc0d8a3dcc0a8ac70a1e0ab11201c754
7
- data.tar.gz: 3f25aa8d59e4adc8d5fd6f66905740ce3af5fd55a4373502e7ba5f66a0a39384d4749ebb2e891fd3dffb2913e203c05452ea84e7281a81d1a949bb99da182c04
6
+ metadata.gz: 70a10d0462324fddae3d76bc4e74fb0f62b7db8f4a65c3153ce7b5ce03b897ce7587ea402122a5b2226abf6412c9aa4367c2316f82bb1c7589548a582de24cbd
7
+ data.tar.gz: 90050a09ffec4d32945213f19360a11f3b993ef858806f465d57822d4dadb5d57281d84d60b46fac2a16a16b29b0d11bf77d344bbd213124b00c910e697fae48
@@ -8,11 +8,8 @@ jobs:
8
8
  name: Ruby ${{ matrix.ruby }} / Active Record ${{ matrix.activerecord }}
9
9
  strategy:
10
10
  matrix:
11
- ruby: ['2.6', '2.7', '3.0']
12
- activerecord: ['6.0', '6.1', 'edge']
13
- exclude:
14
- - ruby: '2.6'
15
- activerecord: 'edge'
11
+ ruby: ['2.7', '3.0', '3.1']
12
+ activerecord: ['6.1', '7.0', 'edge']
16
13
  env:
17
14
  BUNDLE_GEMFILE: gemfiles/Gemfile.activerecord-${{ matrix.activerecord }}
18
15
  steps:
@@ -24,9 +24,9 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_dependency 'activerecord', '>= 6.0'
26
26
  spec.add_dependency 'mysql2', '>= 0.3.12'
27
+
27
28
  spec.add_development_dependency 'bundler'
28
29
  spec.add_development_dependency 'rake'
29
30
  spec.add_development_dependency 'rspec', '>= 3.0'
30
31
  spec.add_development_dependency 'rspec-its'
31
- spec.add_development_dependency 'coveralls'
32
32
  end
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec path: '..'
3
3
 
4
- gem 'activerecord', '~> 6.0.0'
4
+ gem 'activerecord', '~> 7.0.0'
5
5
  gem 'mysql2'
@@ -76,10 +76,13 @@ class ActiveRecord::ConnectionAdapters::PedantMysql2Adapter < ActiveRecord::Conn
76
76
  private
77
77
 
78
78
  def log_warnings(sql)
79
- return unless @connection.warning_count > 0
79
+ # support for https://github.com/rails/rails/commit/d86fd6415c0dfce6fadb77e74696cf728e5eb76b
80
+ connection = instance_variable_defined?(:@raw_connection) ? @raw_connection : @connection
80
81
 
81
- @affected_rows_before_logging = @connection.affected_rows
82
- result = @connection.query('SHOW WARNINGS')
82
+ return unless connection.warning_count > 0
83
+
84
+ @affected_rows_before_logging = connection.affected_rows
85
+ result = connection.query('SHOW WARNINGS')
83
86
 
84
87
  result.each do |level, code, message|
85
88
  warning = MysqlWarning.new(message, code, level, sql)
@@ -1,3 +1,3 @@
1
1
  module PedantMysql2
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
data/spec/adapter_spec.rb CHANGED
@@ -8,7 +8,6 @@ describe PedantMysql2 do
8
8
  PedantMysql2.raise_warnings!
9
9
  PedantMysql2.instance_variable_set(:@whitelist, nil)
10
10
  PedantMysql2.ignore(/They will be merged with strict mode in a future release/)
11
- connection.execute('SET SESSION binlog_format = "STATEMENT"')
12
11
  if connection.execute('SHOW TABLES LIKE "comment"').size == 0
13
12
  connection.execute('CREATE TABLE comment (id int)')
14
13
  end
data/spec/spec_helper.rb CHANGED
@@ -2,14 +2,6 @@ lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  require 'rspec/its'
5
- require 'simplecov'
6
- require 'coveralls'
7
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
8
- SimpleCov::Formatter::HTMLFormatter,
9
- Coveralls::SimpleCov::Formatter
10
- ])
11
- SimpleCov.start
12
-
13
5
  require 'activerecord-pedantmysql2-adapter'
14
6
 
15
7
  module TestSupport
@@ -18,7 +10,7 @@ module TestSupport
18
10
  'database' => 'pedant_mysql2_test',
19
11
  'username' => 'root',
20
12
  'password' => ENV['CI'] ? 'root' : nil,
21
- 'encoding' => 'utf8',
13
+ 'encoding' => 'utf8mb4',
22
14
  'host' => 'localhost',
23
15
  'strict' => false,
24
16
  'pool' => 5,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-pedantmysql2-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-09 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: coveralls
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  description: Gives a hook on MySQL warnings that allow you to either raise or log
112
98
  them.
113
99
  email:
@@ -124,8 +110,8 @@ files:
124
110
  - README.md
125
111
  - Rakefile
126
112
  - activerecord-pedantmysql2-adapter.gemspec
127
- - gemfiles/Gemfile.activerecord-6.0
128
113
  - gemfiles/Gemfile.activerecord-6.1
114
+ - gemfiles/Gemfile.activerecord-7.0
129
115
  - gemfiles/Gemfile.activerecord-edge
130
116
  - lib/active_record/connection_adapters/pedant_mysql2_adapter.rb
131
117
  - lib/activerecord-pedantmysql2-adapter.rb
@@ -155,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
141
  - !ruby/object:Gem::Version
156
142
  version: '0'
157
143
  requirements: []
158
- rubygems_version: 3.0.3
144
+ rubygems_version: 3.2.20
159
145
  signing_key:
160
146
  specification_version: 4
161
147
  summary: ActiveRecord adapter for MySQL that report warnings.