activerecord-jdbc-adapter 1.3.21 → 1.3.22

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
  SHA1:
3
- metadata.gz: 9a16ed1301784e24f2d1d4505a56c1d54768fa0e
4
- data.tar.gz: 344788fd381bc29715fd7abe72141f5da22a451e
3
+ metadata.gz: f59b963d6b856bb7a8ecd3ab0bf506653c04fc50
4
+ data.tar.gz: ff0251deca4b0c4dc691cabad8da7a6e63e3a6cd
5
5
  SHA512:
6
- metadata.gz: 5898cba58332cb2e422a6e99543eae59a8e15ce1e5e92b82f2c2f56584f26c0f79a9e5600e43267d8f395d2a29086fec2253d9c003a4bf491e4c5f2914df932c
7
- data.tar.gz: 6b39e4a58254f45f2c66814f844d2f922f4f5a708bb942147b53b59ac61f772344657c6146897be3943733a18dde736fe4dbde9d32e39aeb52d848e44d02c197
6
+ metadata.gz: 68dad2a1551b5c8fe023a0118a68786172a9df1e209261b8b66c47da4bcee33198d8a5640171ce0b9998a021164f0cbcc787e91e0ef9a5f11d3902b113de7153
7
+ data.tar.gz: 79d7ea6b89a613c149579e14fb065dee1e24ab93a0dae03513b3a56251edcd1c243f36b245c19de9440c87c69b830ec73336cd9cf1a43dc1651322effac8115a
@@ -88,64 +88,64 @@ matrix:
88
88
  env: DB=mariadb PREPARED_STATEMENTS=true
89
89
  jdk: oraclejdk8
90
90
  # include some tests on JDK 6 :
91
- - rvm: jruby-1.7.24
91
+ - rvm: jruby-1.7.26
92
92
  gemfile: gemfiles/rails42.gemfile
93
93
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
94
94
  jdk: openjdk6
95
- - rvm: jruby-1.7.24
95
+ - rvm: jruby-1.7.26
96
96
  gemfile: gemfiles/rails42.gemfile
97
97
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
98
98
  jdk: openjdk6
99
- - rvm: jruby-1.7.24
99
+ - rvm: jruby-1.7.26
100
100
  gemfile: gemfiles/rails42.gemfile
101
101
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
102
102
  jdk: openjdk6
103
- - rvm: jruby-1.7.24
103
+ - rvm: jruby-1.7.26
104
104
  gemfile: gemfiles/rails42.gemfile
105
105
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=derby
106
106
  jdk: openjdk6
107
- - rvm: jruby-1.7.24
107
+ - rvm: jruby-1.7.26
108
108
  gemfile: gemfiles/rails42.gemfile
109
109
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=h2
110
110
  jdk: openjdk6
111
- - rvm: jruby-1.7.24
111
+ - rvm: jruby-1.7.26
112
112
  gemfile: gemfiles/rails42.gemfile
113
113
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
114
114
  jdk: openjdk6
115
115
  # include testing with JRuby 9K (4.2) :
116
- - rvm: jruby-9.1.2.0
116
+ - rvm: jruby-9.1.6.0
117
117
  gemfile: gemfiles/rails42.gemfile
118
118
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql PREPARED_STATEMENTS=true
119
119
  jdk: oraclejdk7
120
- - rvm: jruby-9.1.2.0
120
+ - rvm: jruby-9.1.6.0
121
121
  gemfile: gemfiles/rails42.gemfile
122
122
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=true
123
123
  jdk: oraclejdk7
124
- - rvm: jruby-9.1.2.0
124
+ - rvm: jruby-9.1.6.0
125
125
  gemfile: gemfiles/rails42.gemfile
126
126
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
127
127
  jdk: oraclejdk7
128
- - rvm: jruby-9.1.2.0
128
+ - rvm: jruby-9.1.6.0
129
129
  gemfile: gemfiles/rails42.gemfile
130
130
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
131
131
  jdk: oraclejdk8
132
- - rvm: jruby-9.1.2.0
132
+ - rvm: jruby-9.1.6.0
133
133
  gemfile: gemfiles/rails42.gemfile
134
134
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
135
135
  jdk: oraclejdk8
136
- - rvm: jruby-9.1.2.0
136
+ - rvm: jruby-9.1.6.0
137
137
  gemfile: gemfiles/rails42.gemfile
138
138
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
139
139
  jdk: oraclejdk8
140
- - rvm: jruby-9.1.2.0
140
+ - rvm: jruby-9.1.6.0
141
141
  gemfile: gemfiles/rails42.gemfile
142
142
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=derby
143
143
  jdk: oraclejdk8
144
- - rvm: jruby-9.1.2.0
144
+ - rvm: jruby-9.1.6.0
145
145
  gemfile: gemfiles/rails42.gemfile
146
146
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=h2
147
147
  jdk: oraclejdk8
148
- - rvm: jruby-9.1.2.0
148
+ - rvm: jruby-9.1.6.0
149
149
  gemfile: gemfiles/rails42.gemfile
150
150
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
151
151
  jdk: oraclejdk8
data/History.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 1.3.22 (12/23/16)
2
+
3
+ - [postgres] Fix incorrect postgresql_version when running RC (#717)
4
+ - [postgres] fixed insert into partitioned table (#723)
5
+ - [postgres] add ssl support from environment vars (#760)
6
+ - [postgres] Adds citext to AR42 Native database types (#746)
7
+ - [mysql] handle db:create failure compatibly with AR's MySQL tasks
8
+ - [mssql] Changed selects from information schema to uppercase
9
+ in case SQLServer database has case sensitive collation
10
+ - Added long varchar to type converter for legacy sybase DB (#757)
11
+ - [mysql] Don't read mysql binary column as stream (#742)
12
+
13
+ ## 1.3.21 (08/18/16)
14
+
15
+ - check for instanceof RubyArray when extracting binds with stmnts
16
+ (for JRuby 9.1 packed array feature compatibility)
17
+ - default to useSSL=false for MariaDB driver
18
+ - [db2] allow to force zos: true using database config
19
+
1
20
  ## 1.3.20 (03/09/16)
2
21
 
3
22
  - Retrieve AM::Type::Boolean::FALSE_VALUES for Rails 5 (#705)
@@ -34,6 +34,7 @@ module ActiveRecord
34
34
  :text => [ lambda {|r| TEXT_TYPES.include?(r['data_type'].to_i)},
35
35
  lambda {|r| r['type_name'] =~ /^text$/i}, # For Informix
36
36
  lambda {|r| r['type_name'] =~ /sub_type 1$/i}, # For FireBird
37
+ lambda {|r| r['type_name'] =~ /^long varchar$/i}, # Legacy Sybase/SqlAnywhere
37
38
  lambda {|r| r['type_name'] =~ /^(text|clob)$/i},
38
39
  lambda {|r| r['type_name'] =~ /^character large object$/i},
39
40
  lambda {|r| r['sql_data_type'] == 2005}],
@@ -574,7 +574,7 @@ module ArJdbc
574
574
  def remove_check_constraints(table_name, column_name)
575
575
  clear_cached_table(table_name)
576
576
  constraints = select_values "SELECT constraint_name" <<
577
- " FROM information_schema.constraint_column_usage" <<
577
+ " FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE" <<
578
578
  " WHERE table_name = '#{table_name}' AND column_name = '#{column_name}'"
579
579
  constraints.each do |constraint_name|
580
580
  execute "ALTER TABLE #{table_name} DROP CONSTRAINT #{constraint_name}"
@@ -67,7 +67,7 @@ module ArJdbc
67
67
  @postgresql_version ||=
68
68
  begin
69
69
  version = select_version
70
- if version =~ /PostgreSQL (\d+)\.(\d+)\.(\d+)/
70
+ if version =~ /PostgreSQL (\d+)\.(\d+)(?:\.(\d+))?/
71
71
  ($1.to_i * 10000) + ($2.to_i * 100) + $3.to_i
72
72
  else
73
73
  0
@@ -286,7 +286,8 @@ module ArJdbc
286
286
  :bigserial => "bigserial",
287
287
  :bigint => { :name => "bigint" },
288
288
  :bit => { :name => "bit" },
289
- :bit_varying => { :name => "bit varying" }
289
+ :bit_varying => { :name => "bit varying" },
290
+ :citext => { :name => "citext" }
290
291
  ) if AR42
291
292
 
292
293
  def native_database_types
@@ -686,7 +687,8 @@ module ArJdbc
686
687
  return result if result.is_a? Integer
687
688
  # <ActiveRecord::Result @hash_rows=nil, @columns=["id"], @rows=[[3]]>
688
689
  # but it will work with [{ 'id' => 1 }] Hash wrapped results as well
689
- result.first.first[1] # .first = { "id"=>1 } .first = [ "id", 1 ]
690
+ row = result.first
691
+ row && row.first[1] # .first = { "id"=>1 } .first = [ "id", 1 ]
690
692
  end
691
693
 
692
694
  def last_insert_id(table, sequence_name = nil)
@@ -31,13 +31,16 @@ ArJdbc::ConnectionMethods.module_eval do
31
31
  end
32
32
  sslmode = config.key?(:sslmode) ? config[:sslmode] : config[:requiressl]
33
33
  # NOTE: makes not much sense since this needs some JVM options :
34
- # sslmode = ENV['PGSSLMODE'] || ENV['PGREQUIRESSL'] if sslmode.nil?
34
+ sslmode = ENV['PGSSLMODE'] || ENV['PGREQUIRESSL'] if sslmode.nil?
35
35
  unless sslmode.nil? # PG :sslmode - disable|allow|prefer|require
36
36
  # JRuby/JVM needs to be started with :
37
37
  # -Djavax.net.ssl.trustStore=mystore -Djavax.net.ssl.trustStorePassword=...
38
38
  # or a non-validating connection might be used (for testing) :
39
39
  # :sslfactory = 'org.postgresql.ssl.NonValidatingFactory'
40
- properties['ssl'] ||= 'true' if sslmode == true || sslmode.to_s == 'require'
40
+ if sslmode == true || sslmode.to_s == 'require'
41
+ properties['sslfactory'] ||= 'org.postgresql.ssl.NonValidatingFactory'
42
+ properties['ssl'] ||= 'true'
43
+ end
41
44
  end
42
45
  properties['tcpKeepAlive'] ||= config[:keepalives] if config.key?(:keepalives)
43
46
  properties['kerberosServerName'] ||= config[:krbsrvname] if config[:krbsrvname]
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord::Tasks
2
2
 
3
3
  DatabaseTasks.module_eval do
4
-
4
+
5
5
  # patched to adapt jdbc configuration
6
6
  def each_current_configuration(environment)
7
7
  environments = [environment]
@@ -31,9 +31,14 @@ module ActiveRecord::Tasks
31
31
  MySQLDatabaseTasks.class_eval do
32
32
 
33
33
  def error_class
34
- ActiveRecord::JDBCError
34
+ @_error_class ||= begin
35
+ unless ActiveRecord::JDBCError.instance_methods.include?(:error)
36
+ ActiveRecord::JDBCError.send :alias_method, :error, :sql_exception
37
+ end
38
+ ActiveRecord::JDBCError
39
+ end
35
40
  end
36
41
 
37
42
  end
38
-
43
+
39
44
  end
@@ -1,5 +1,5 @@
1
1
  module ArJdbc
2
- VERSION = "1.3.21"
2
+ VERSION = "1.3.22"
3
3
  # @deprecated
4
4
  module Version
5
5
  # @private 1.2.x compatibility
@@ -54,6 +54,7 @@ import org.jruby.exceptions.RaiseException;
54
54
  import org.jruby.runtime.ObjectAllocator;
55
55
  import org.jruby.runtime.ThreadContext;
56
56
  import org.jruby.runtime.builtin.IRubyObject;
57
+ import org.jruby.util.ByteList;
57
58
 
58
59
  /**
59
60
  *
@@ -102,6 +103,12 @@ public class MySQLRubyJdbcConnection extends RubyJdbcConnection {
102
103
  final int value = resultSet.getInt(column);
103
104
  return resultSet.wasNull() ? runtime.getNil() : runtime.newFixnum(value);
104
105
  }
106
+ else if ( type == Types.BINARY || type == Types.VARBINARY) {
107
+ final byte[] bytes = resultSet.getBytes(column);
108
+ if ( bytes == null || resultSet.wasNull() ) return runtime.getNil();
109
+ final ByteList byteList = new ByteList(bytes, false);
110
+ return new RubyString(runtime, runtime.getString(), byteList);
111
+ }
105
112
  return super.jdbcToRuby(context, runtime, column, type, resultSet);
106
113
  }
107
114
 
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: 1.3.21
4
+ version: 1.3.22
5
5
  platform: ruby
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: 2016-08-18 00:00:00.000000000 Z
11
+ date: 2016-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement