activerecord-jdbc-adapter 51.3-java → 51.4-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +22 -18
- data/Rakefile +1 -1
- data/lib/arjdbc/mysql/connection_methods.rb +12 -7
- data/lib/arjdbc/postgresql/connection_methods.rb +2 -1
- data/lib/arjdbc/version.rb +1 -1
- data/src/java/arjdbc/util/DateTimeUtils.java +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63cf6264259b636000fa1b17e13d555ca97d91aa9e237026bb81bac717b3130f
|
4
|
+
data.tar.gz: ca5867009951cda63cccf434b87ec38fc0b541cd8a206899ed9ba23841ceb0c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a762d4f3877d7c834da321fa67784cee8ca8999c22ac3ec9d9e3f5f65df0d52ed2261dde7a91287c4b9cd0d5641f6786e26e0ab470d1b4c4c6527624163bbaf5
|
7
|
+
data.tar.gz: 5fb6ee5eafa8a10a7389f7c4a471061553e5ca97e9347b2f78f69d94ec2fca28277f109eeeebe636de053324a346dcab25eab379351e46afd475855296bd3ae4
|
data/.travis.yml
CHANGED
@@ -1,18 +1,27 @@
|
|
1
|
-
language: ruby
|
2
1
|
sudo: false
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
bundler_args: --without development
|
11
|
-
script: bundle exec rake ${TEST_PREFIX}test_$DB
|
2
|
+
dist: xenial
|
3
|
+
|
4
|
+
services:
|
5
|
+
- mysql
|
6
|
+
addons:
|
7
|
+
postgresql: 9.4
|
8
|
+
|
12
9
|
before_install:
|
13
10
|
- unset _JAVA_OPTIONS
|
14
11
|
- rvm @default,@global do gem uninstall bundler -a -x -I || true
|
15
12
|
- gem install bundler -v "~>1.17.3"
|
13
|
+
install:
|
14
|
+
- bundle install --retry 3 --without development
|
15
|
+
# to fix this issue: https://travis-ci.community/t/mariadb-10-1-fails-to-install-on-xenial/3151/3
|
16
|
+
- mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;' || true
|
17
|
+
|
18
|
+
language: ruby
|
19
|
+
rvm:
|
20
|
+
- jruby-9.1.16.0
|
21
|
+
jdk:
|
22
|
+
- openjdk8
|
23
|
+
|
24
|
+
script: bundle exec rake ${TEST_PREFIX}test_$DB
|
16
25
|
before_script:
|
17
26
|
- echo "JAVA_OPTS=$JAVA_OPTS"
|
18
27
|
- export JRUBY_OPTS="-J-Xms64M -J-Xmx1024M"
|
@@ -38,12 +47,7 @@ before_script:
|
|
38
47
|
psql -c "create database activerecord_unittest;" -U postgres && \
|
39
48
|
psql -c "create database activerecord_unittest2;" -U postgres \
|
40
49
|
|| true
|
41
|
-
|
42
|
-
- jruby-9.1.16.0
|
43
|
-
jdk:
|
44
|
-
- openjdk8
|
45
|
-
addons:
|
46
|
-
postgresql: "9.4"
|
50
|
+
|
47
51
|
env:
|
48
52
|
- DB=mysql2 PREPARED_STATEMENTS=false
|
49
53
|
- DB=mysql2 PREPARED_STATEMENTS=true
|
@@ -86,10 +90,10 @@ matrix:
|
|
86
90
|
env: DB=sqlite3
|
87
91
|
# testing against MariaDB
|
88
92
|
- addons:
|
89
|
-
mariadb:
|
93
|
+
mariadb: 10.2
|
90
94
|
env: DB=mariadb PREPARED_STATEMENTS=false
|
91
95
|
- addons:
|
92
|
-
mariadb:
|
96
|
+
mariadb: 10.3
|
93
97
|
env: DB=mariadb PREPARED_STATEMENTS=true
|
94
98
|
# Rails test-suite :
|
95
99
|
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="v5.1.7" # PS off by default
|
data/Rakefile
CHANGED
@@ -257,7 +257,7 @@ if defined? JRUBY_VERSION
|
|
257
257
|
begin
|
258
258
|
require 'arjdbc/version'
|
259
259
|
rescue LoadError
|
260
|
-
path = File.expand_path('
|
260
|
+
path = File.expand_path('lib', File.dirname(__FILE__))
|
261
261
|
unless $LOAD_PATH.include?(path)
|
262
262
|
$LOAD_PATH << path; retry
|
263
263
|
end
|
@@ -10,11 +10,9 @@ ArJdbc::ConnectionMethods.module_eval do
|
|
10
10
|
|
11
11
|
return jndi_connection(config) if jndi_config?(config)
|
12
12
|
|
13
|
-
driver = config[:driver]
|
14
|
-
|
15
|
-
|
16
|
-
mysql_driver = driver.start_with?('com.mysql.')
|
17
|
-
mariadb_driver = ! mysql_driver && driver.start_with?('org.mariadb.')
|
13
|
+
driver = config[:driver]
|
14
|
+
mysql_driver = driver.nil? || driver.to_s.start_with?('com.mysql.')
|
15
|
+
mariadb_driver = ! mysql_driver && driver.to_s.start_with?('org.mariadb.')
|
18
16
|
|
19
17
|
begin
|
20
18
|
require 'jdbc/mysql'
|
@@ -22,6 +20,11 @@ ArJdbc::ConnectionMethods.module_eval do
|
|
22
20
|
rescue LoadError # assuming driver.jar is on the class-path
|
23
21
|
end if mysql_driver
|
24
22
|
|
23
|
+
if driver.nil?
|
24
|
+
config[:driver] ||=
|
25
|
+
defined?(::Jdbc::MySQL.driver_name) ? ::Jdbc::MySQL.driver_name : 'com.mysql.jdbc.Driver'
|
26
|
+
end
|
27
|
+
|
25
28
|
config[:username] = 'root' unless config.key?(:username)
|
26
29
|
# jdbc:mysql://[host][,failoverhost...][:port]/[database]
|
27
30
|
# - if the host name is not specified, it defaults to 127.0.0.1
|
@@ -36,7 +39,8 @@ ArJdbc::ConnectionMethods.module_eval do
|
|
36
39
|
|
37
40
|
properties = ( config[:properties] ||= {} )
|
38
41
|
if mysql_driver
|
39
|
-
properties['zeroDateTimeBehavior'] ||=
|
42
|
+
properties['zeroDateTimeBehavior'] ||=
|
43
|
+
config[:driver].to_s.start_with?('com.mysql.cj.') ? 'CONVERT_TO_NULL' : 'convertToNull'
|
40
44
|
properties['jdbcCompliantTruncation'] ||= false
|
41
45
|
# NOTE: this is "better" than passing what users are used to set on MRI
|
42
46
|
# e.g. 'utf8mb4' will fail cause the driver will check for a Java charset
|
@@ -108,7 +112,8 @@ ArJdbc::ConnectionMethods.module_eval do
|
|
108
112
|
rescue LoadError # assuming driver.jar is on the class-path
|
109
113
|
end
|
110
114
|
|
111
|
-
config[:driver] ||=
|
115
|
+
config[:driver] ||=
|
116
|
+
defined?(::Jdbc::MariaDB.driver_name) ? ::Jdbc::MariaDB.driver_name : 'org.mariadb.jdbc.Driver'
|
112
117
|
|
113
118
|
mysql_connection(config)
|
114
119
|
end
|
@@ -16,7 +16,8 @@ ArJdbc::ConnectionMethods.module_eval do
|
|
16
16
|
::Jdbc::Postgres.load_driver(:require) if defined?(::Jdbc::Postgres.load_driver)
|
17
17
|
rescue LoadError # assuming driver.jar is on the class-path
|
18
18
|
end
|
19
|
-
driver = config[:driver] ||=
|
19
|
+
driver = (config[:driver] ||=
|
20
|
+
defined?(::Jdbc::Postgres.driver_name) ? ::Jdbc::Postgres.driver_name : 'org.postgresql.Driver')
|
20
21
|
|
21
22
|
host = config[:host] ||= ( config[:hostaddr] || ENV['PGHOST'] || 'localhost' )
|
22
23
|
port = config[:port] ||= ( ENV['PGPORT'] || 5432 )
|
data/lib/arjdbc/version.rb
CHANGED
@@ -217,9 +217,11 @@ public abstract class DateTimeUtils {
|
|
217
217
|
final int hours = time.getHours();
|
218
218
|
final int minutes = time.getMinutes();
|
219
219
|
final int seconds = time.getSeconds();
|
220
|
-
|
220
|
+
int nanos = time.getNanos(); // max 999-999-999
|
221
|
+
final int millis = nanos / 1000000;
|
222
|
+
nanos = nanos % 1000000;
|
221
223
|
|
222
|
-
DateTime dateTime = new DateTime(2000, 1, 1, hours, minutes, seconds, defaultZone);
|
224
|
+
DateTime dateTime = new DateTime(2000, 1, 1, hours, minutes, seconds, millis, defaultZone);
|
223
225
|
return RubyTime.newTime(context.runtime, dateTime, nanos);
|
224
226
|
}
|
225
227
|
|
@@ -232,9 +234,11 @@ public abstract class DateTimeUtils {
|
|
232
234
|
final int hours = timestamp.getHours();
|
233
235
|
final int minutes = timestamp.getMinutes();
|
234
236
|
final int seconds = timestamp.getSeconds();
|
235
|
-
|
237
|
+
int nanos = timestamp.getNanos(); // max 999-999-999
|
238
|
+
final int millis = nanos / 1000000;
|
239
|
+
nanos = nanos % 1000000;
|
236
240
|
|
237
|
-
DateTime dateTime = new DateTime(year, month, day, hours, minutes, seconds,
|
241
|
+
DateTime dateTime = new DateTime(year, month, day, hours, minutes, seconds, millis, defaultZone);
|
238
242
|
return RubyTime.newTime(context.runtime, dateTime, nanos);
|
239
243
|
}
|
240
244
|
|
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: '51.
|
4
|
+
version: '51.4'
|
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: 2019-
|
11
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|