activerecord-jdbc-adapter 61.1-java → 61.3-java

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
  SHA256:
3
- metadata.gz: b585e8cd3bfe03b0d56e4cb5e36fe04209d206f69aba63d71db32501594e0f28
4
- data.tar.gz: f681cf2c208fc57c851a4d2e36f5e061fc1a5c33c3f6add4ff84a92b733993f0
3
+ metadata.gz: b7c1515914a3b1efa79d00597231d6e351262c6acbc9756fa73adecb05b232aa
4
+ data.tar.gz: b48d291203d3d5a7725857016e9b254b0241f043207ecf6ffdc442cdb6542ec3
5
5
  SHA512:
6
- metadata.gz: 5322f6c252053950b32cadd50ebc5df6617cffc94ecadad51b89a288f9e4c6281c84247fde54bdf93b13fad69ad81365f55f107831f3ea34f25b2add9b11f71f
7
- data.tar.gz: 39771e6db78b5ef795fb112352a4bcca89bbd6904e04db72d8924076993c4c6d6724001238950f3bfdc83d03ff515c15306822a523fa7635e0b2cfe784544faf
6
+ metadata.gz: da1158e8205f1c19d277417db83c4607e6f332e8e767d13e580c6173d64cd0de96637ac5a04ce797b13f278f71e4148cdd399e5a2d7d4ad974e71b0b405a2280
7
+ data.tar.gz: f72f84ce311a84192ef65f0f63542ab77c77bdd673f86258756ec9ebcb4dcf44c73c50dcb4753fdd22b153f76112fe0c9141dfe80ce7f97d9ca7adf54f768cbd
@@ -0,0 +1,266 @@
1
+ name: Run ARJDBC and Rails tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ 61-stable, master ]
6
+ pull_request:
7
+ branches: [ 61-stable, master ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test-rails-mysql:
14
+
15
+ name: Rails Tests (MySQL)
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ ruby-version: ['jruby-9.3.13.0']
21
+ db: ['mysql2']
22
+ test_targets: ["rails:test_mysql2"]
23
+ ar_version: ["6-1-stable"]
24
+ prepared_statements: ['false', 'true']
25
+ driver: ['MySQL']
26
+
27
+ services:
28
+ mysql:
29
+ image: mysql:5.7
30
+ ports:
31
+ - 3306
32
+
33
+ env:
34
+ DB: ${{ matrix.db }}
35
+ AR_VERSION: ${{ matrix.ar_version }}
36
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
37
+ DRIVER: ${{ matrix.driver }}
38
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
39
+
40
+ steps:
41
+ - uses: actions/checkout@v3
42
+ - name: Set up Ruby
43
+ uses: ruby/setup-ruby@v1
44
+ with:
45
+ ruby-version: ${{ matrix.ruby-version }}
46
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
47
+ - name: Setup database
48
+ run: |
49
+ sudo service mysql start
50
+ mysql --version || true # to see if we're using MySQL or MariaDB
51
+ mysql -u root -proot -e "CREATE USER rails@localhost;"
52
+ mysql -u root -proot -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
53
+ mysql -u root -proot -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
54
+ mysql -u root -proot -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
55
+ mysql -u root -proot -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;"
56
+ mysql -u root -proot -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;"
57
+ - name: Build
58
+ run: |
59
+ echo "JAVA_OPTS=$JAVA_OPTS"
60
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
61
+ - name: Run tests
62
+ run: |
63
+ bundle exec rake ${{ matrix.test_targets }}
64
+
65
+ test-rails-pgsql:
66
+
67
+ name: Rails Tests (Postgres)
68
+ runs-on: ubuntu-latest
69
+ strategy:
70
+ fail-fast: false
71
+ matrix:
72
+ ruby-version: ['jruby-9.3.13.0']
73
+ db: [ 'postgresql' ]
74
+ test_targets: [ "rails:test_postgresql" ]
75
+ ar_version: ["6-1-stable"]
76
+ prepared_statements: [ 'false', 'true' ]
77
+
78
+ services:
79
+ postgres:
80
+ image: postgres:10
81
+ env:
82
+ POSTGRES_PASSWORD: postgres
83
+ POSTGRES_HOST_AUTH_METHOD: trust
84
+ ports:
85
+ - 5432:5432
86
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
87
+
88
+ env:
89
+ DB: ${{ matrix.db }}
90
+ AR_VERSION: ${{ matrix.ar_version }}
91
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
92
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
93
+ PGHOST: localhost
94
+ PGPORT: 5432
95
+ PGUSER: postgres
96
+
97
+ steps:
98
+ - uses: actions/checkout@v3
99
+ - name: Set up Ruby
100
+ uses: ruby/setup-ruby@v1
101
+ with:
102
+ ruby-version: ${{ matrix.ruby-version }}
103
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
104
+ - name: Setup database
105
+ run: |
106
+ psql -c "create database activerecord_unittest;" -U postgres
107
+ psql -c "create database activerecord_unittest2;" -U postgres
108
+ - name: Build
109
+ run: |
110
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
111
+ - name: Run tests
112
+ run: |
113
+ bundle exec rake ${{ matrix.test_targets }}
114
+
115
+ test-rails-sqlite:
116
+
117
+ name: Rails Tests (SQLite)
118
+ runs-on: ubuntu-latest
119
+ strategy:
120
+ fail-fast: false
121
+ matrix:
122
+ ruby-version: ['jruby-9.3.13.0']
123
+ db: ['sqlite3']
124
+ test_targets: ["rails:test_sqlite3"]
125
+ ar_version: ["6-1-stable"]
126
+
127
+ env:
128
+ DB: ${{ matrix.db }}
129
+ AR_VERSION: ${{ matrix.ar_version }}
130
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
131
+
132
+ steps:
133
+ - uses: actions/checkout@v3
134
+ - name: Set up Ruby
135
+ uses: ruby/setup-ruby@v1
136
+ with:
137
+ ruby-version: ${{ matrix.ruby-version }}
138
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
139
+ - name: Build
140
+ run: |
141
+ echo "JAVA_OPTS=$JAVA_OPTS"
142
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
143
+ - name: Run tests
144
+ run: |
145
+ bundle exec rake ${{ matrix.test_targets }}
146
+
147
+ test-arjdbc-mysql:
148
+
149
+ name: ARJDBC Tests (MySQL)
150
+ runs-on: ubuntu-latest
151
+ strategy:
152
+ fail-fast: false
153
+ matrix:
154
+ ruby-version: ['jruby-9.3.13.0']
155
+ db: ['mysql2']
156
+ test_targets: ["db:mysql test_mysql2"]
157
+ prepared_statements: ['false', 'true']
158
+ driver: ['MySQL']
159
+
160
+ services:
161
+ mysql:
162
+ image: mysql:5.7
163
+ ports:
164
+ - 3306
165
+
166
+ env:
167
+ DB: ${{ matrix.db }}
168
+ DRIVER: ${{ matrix.driver }}
169
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
170
+ MY_USER: root
171
+ MY_PASSWORD: root
172
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
173
+
174
+ steps:
175
+ - uses: actions/checkout@v3
176
+ - name: Set up Ruby
177
+ uses: ruby/setup-ruby@v1
178
+ with:
179
+ ruby-version: ${{ matrix.ruby-version }}
180
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
181
+ - name: Setup database
182
+ run: |
183
+ sudo service mysql start
184
+ mysql --version || true # to see if we're using MySQL or MariaDB
185
+ - name: Build
186
+ run: |
187
+ rake jar
188
+ - name: Run tests
189
+ run: |
190
+ bundle exec rake ${{ matrix.test_targets }}
191
+
192
+ test-arjdbc-pgsql:
193
+
194
+ name: ARJDBC Tests (Postgres)
195
+ runs-on: ubuntu-latest
196
+ strategy:
197
+ fail-fast: false
198
+ matrix:
199
+ ruby-version: ['jruby-9.3.13.0']
200
+ db: ['postgresql']
201
+ test_targets: ["db:postgresql test_postgresql"]
202
+ prepared_statements: ['false', 'true']
203
+ insert_returning: ['false', 'true']
204
+
205
+ services:
206
+ postgres:
207
+ image: postgres:10
208
+ env:
209
+ POSTGRES_PASSWORD: postgres
210
+ POSTGRES_HOST_AUTH_METHOD: trust
211
+ ports:
212
+ - 5432:5432
213
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
214
+
215
+ env:
216
+ DB: ${{ matrix.db }}
217
+ DRIVER: ${{ matrix.driver }}
218
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
219
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
220
+ INSERT_RETURNING: ${{ matrix.insert_returning }}
221
+ PGHOST: localhost
222
+ PGPORT: 5432
223
+ PGUSER: postgres
224
+
225
+ steps:
226
+ - uses: actions/checkout@v3
227
+ - name: Set up Ruby
228
+ uses: ruby/setup-ruby@v1
229
+ with:
230
+ ruby-version: ${{ matrix.ruby-version }}
231
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
232
+ - name: Build
233
+ run: |
234
+ rake jar
235
+ - name: Run tests
236
+ run: |
237
+ bundle exec rake ${{ matrix.test_targets }}
238
+
239
+ test-arjdbc-sqlite:
240
+
241
+ name: ARJDBC Tests (SQLite)
242
+ runs-on: ubuntu-latest
243
+ strategy:
244
+ fail-fast: false
245
+ matrix:
246
+ ruby-version: ['jruby-9.3.13.0']
247
+ db: ['sqlite3']
248
+ test_targets: ['test_sqlite3']
249
+
250
+ env:
251
+ DB: ${{ matrix.db }}
252
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
253
+
254
+ steps:
255
+ - uses: actions/checkout@v3
256
+ - name: Set up Ruby
257
+ uses: ruby/setup-ruby@v1
258
+ with:
259
+ ruby-version: ${{ matrix.ruby-version }}
260
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
261
+ - name: Build
262
+ run: |
263
+ rake jar
264
+ - name: Run tests
265
+ run: |
266
+ bundle exec rake ${{ matrix.test_targets }}
data/.travis.yml CHANGED
@@ -9,13 +9,14 @@ before_install:
9
9
  - rvm @default,@global do gem uninstall bundler -a -x -I || true
10
10
  - gem install bundler -v "~>1.17.3"
11
11
  install:
12
- - bundle install --retry 3 --without development
12
+ - bundle config set --local without 'development'
13
+ - bundle install
13
14
  # to fix this issue: https://travis-ci.community/t/mariadb-10-1-fails-to-install-on-xenial/3151/3
14
15
  - mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;' || true
15
16
 
16
17
  language: ruby
17
18
  rvm:
18
- - jruby-9.2.14.0
19
+ - jruby-9.2.19.0
19
20
  jdk:
20
21
  - openjdk8
21
22
 
@@ -48,7 +49,7 @@ before_script:
48
49
 
49
50
  env:
50
51
  global:
51
- - AR_VERSION="master"
52
+ - AR_VERSION="6-1-stable"
52
53
  matrix:
53
54
  allow_failures:
54
55
  - rvm: jruby-head
Binary file
@@ -2,7 +2,9 @@
2
2
 
3
3
  module ActiveRecord
4
4
 
5
- if defined? ConnectionAdapters::ConnectionSpecification::Resolver # 4.0
5
+ if defined? ConnectionAdapters::ConnectionHandler # 6.1
6
+ ConnectionAdapters::ConnectionHandler
7
+ elsif defined? ConnectionAdapters::ConnectionSpecification::Resolver # 4.0, # 5.x, # 6.0
6
8
  ConnectionAdapters::ConnectionSpecification::Resolver
7
9
  elsif defined? Base::ConnectionSpecification::Resolver # 3.2
8
10
  Base::ConnectionSpecification::Resolver
@@ -126,51 +126,52 @@ ArJdbc::ConnectionMethods.module_eval do
126
126
 
127
127
  private
128
128
 
129
- @@mysql_encodings = nil
129
+ MYSQL_ENCODINGS = {
130
+ "big5" => "Big5",
131
+ "dec8" => nil,
132
+ #"cp850" => "Cp850",
133
+ "hp8" => nil,
134
+ #"koi8r" => "KOI8-R",
135
+ "latin1" => "Cp1252",
136
+ "latin2" => "ISO8859_2",
137
+ "swe7" => nil,
138
+ "ascii" => "US-ASCII",
139
+ "ujis" => "EUC_JP",
140
+ "sjis" => "SJIS",
141
+ "hebrew" => "ISO8859_8",
142
+ "tis620" => "TIS620",
143
+ "euckr" => "EUC_KR",
144
+ #"koi8u" => "KOI8-R",
145
+ "gb2312" => "EUC_CN",
146
+ "greek" => "ISO8859_7",
147
+ "cp1250" => "Cp1250",
148
+ "gbk" => "GBK",
149
+ #"latin5" => "ISO-8859-9",
150
+ "armscii8" => nil,
151
+ "ucs2" => "UnicodeBig",
152
+ "cp866" => "Cp866",
153
+ "keybcs2" => nil,
154
+ "macce" => "MacCentralEurope",
155
+ "macroman" => "MacRoman",
156
+ #"cp852" => "CP852",
157
+ #"latin7" => "ISO-8859-13",
158
+ "cp1251" => "Cp1251",
159
+ "cp1256" => "Cp1256",
160
+ "cp1257" => "Cp1257",
161
+ "binary" => false,
162
+ "geostd8" => nil,
163
+ "cp932" => "Cp932",
164
+ #"eucjpms" => "eucJP-ms"
165
+ "utf8" => "UTF-8",
166
+ "utf8mb4" => false,
167
+ "utf16" => false,
168
+ "utf32" => false,
169
+ }
170
+
130
171
 
131
172
  # @see https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-charsets.html
132
173
  def convert_mysql_encoding(encoding) # to charset-name (characterEncoding=...)
133
- ( @@mysql_encodings ||= {
134
- "big5" => "Big5",
135
- "dec8" => nil,
136
- #"cp850" => "Cp850",
137
- "hp8" => nil,
138
- #"koi8r" => "KOI8-R",
139
- "latin1" => "Cp1252",
140
- "latin2" => "ISO8859_2",
141
- "swe7" => nil,
142
- "ascii" => "US-ASCII",
143
- "ujis" => "EUC_JP",
144
- "sjis" => "SJIS",
145
- "hebrew" => "ISO8859_8",
146
- "tis620" => "TIS620",
147
- "euckr" => "EUC_KR",
148
- #"koi8u" => "KOI8-R",
149
- "gb2312" => "EUC_CN",
150
- "greek" => "ISO8859_7",
151
- "cp1250" => "Cp1250",
152
- "gbk" => "GBK",
153
- #"latin5" => "ISO-8859-9",
154
- "armscii8" => nil,
155
- "ucs2" => "UnicodeBig",
156
- "cp866" => "Cp866",
157
- "keybcs2" => nil,
158
- "macce" => "MacCentralEurope",
159
- "macroman" => "MacRoman",
160
- #"cp852" => "CP852",
161
- #"latin7" => "ISO-8859-13",
162
- "cp1251" => "Cp1251",
163
- "cp1256" => "Cp1256",
164
- "cp1257" => "Cp1257",
165
- "binary" => false,
166
- "geostd8" => nil,
167
- "cp932" => "Cp932",
168
- #"eucjpms" => "eucJP-ms"
169
- "utf8" => "UTF-8",
170
- "utf8mb4" => false,
171
- "utf16" => false,
172
- "utf32" => false,
173
- } )[ encoding ]
174
+ MYSQL_ENCODINGS[ encoding ]
174
175
  end
175
176
 
176
177
  end
@@ -1,3 +1,3 @@
1
1
  module ArJdbc
2
- VERSION = '61.1'
2
+ VERSION = '61.3'
3
3
  end
@@ -2712,7 +2712,7 @@ public class RubyJdbcConnection extends RubyObject {
2712
2712
  }
2713
2713
  else { // e.g. `BigDecimal '42.00000000000000000001'`
2714
2714
  statement.setBigDecimal(index,
2715
- RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value).getValue());
2715
+ RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE)).getValue());
2716
2716
  }
2717
2717
  }
2718
2718
 
@@ -478,7 +478,7 @@ public class SQLite3RubyJdbcConnection extends RubyJdbcConnection {
478
478
  statement.setDouble(index, ((RubyNumeric) value).getDoubleValue());
479
479
  }
480
480
  else { // e.g. `BigDecimal '42.00000000000000000001'`
481
- RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value);
481
+ RubyBigDecimal val = RubyBigDecimal.newInstance(context, context.runtime.getModule("BigDecimal"), value, RubyFixnum.newFixnum(context.runtime, Integer.MAX_VALUE));
482
482
  statement.setString(index, val.getValue().toString());
483
483
  }
484
484
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '61.1'
4
+ version: '61.3'
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-29 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -17,8 +17,8 @@ dependencies:
17
17
  - !ruby/object:Gem::Version
18
18
  version: 6.1.0
19
19
  name: activerecord
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
@@ -35,6 +35,7 @@ executables: []
35
35
  extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
+ - ".github/workflows/ruby.yml"
38
39
  - ".gitignore"
39
40
  - ".travis.yml"
40
41
  - ".yardopts"
@@ -230,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
231
  - !ruby/object:Gem::Version
231
232
  version: '0'
232
233
  requirements: []
233
- rubygems_version: 3.2.14
234
+ rubygems_version: 3.3.26
234
235
  signing_key:
235
236
  specification_version: 4
236
237
  summary: JDBC adapter for ActiveRecord, for use within JRuby on Rails.