activerecord-jdbc-adapter 1.3.20 → 1.3.21

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: 82589d846e5ee11d8bd85ffb825c8b58571ef837
4
- data.tar.gz: 9bda0dc210283b928b1c97a8b66e72b17348635c
3
+ metadata.gz: 9a16ed1301784e24f2d1d4505a56c1d54768fa0e
4
+ data.tar.gz: 344788fd381bc29715fd7abe72141f5da22a451e
5
5
  SHA512:
6
- metadata.gz: 914c271374806217b3e5396036d5e147c7dd56f6fc06515c121715e9abce9a4b91dd70daf91423029d35380d43d20938fd6d75aa9c8295079a0844e93e32202b
7
- data.tar.gz: 511b7f9fe9adbc153cf2d1fca7992f63341db16097abeba55563b465e81634429460d35e1118864098e53459192ad07e5fd3c3121c61c6e5f24b7e21a3c00711
6
+ metadata.gz: 5898cba58332cb2e422a6e99543eae59a8e15ce1e5e92b82f2c2f56584f26c0f79a9e5600e43267d8f395d2a29086fec2253d9c003a4bf491e4c5f2914df932c
7
+ data.tar.gz: 6b39e4a58254f45f2c66814f844d2f922f4f5a708bb942147b53b59ac61f772344657c6146897be3943733a18dde736fe4dbde9d32e39aeb52d848e44d02c197
@@ -65,6 +65,8 @@ matrix:
65
65
  - rvm: jruby-1.7.24
66
66
  gemfile: gemfiles/rails42.gemfile
67
67
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
68
+ - env: DB=mariadb
69
+ - env: DB=mariadb PREPARED_STATEMENTS=true
68
70
  include:
69
71
  # testing against MariaDB
70
72
  - addons:
@@ -76,14 +78,14 @@ matrix:
76
78
  - addons:
77
79
  mariadb: '10.0'
78
80
  rvm: jruby-1.7.24
79
- gemfile: gemfiles/rails40.gemfile
80
- env: JRUBY_OPTS="$JRUBY_OPTS" DB=mariadb
81
+ gemfile: gemfiles/rails42.gemfile
82
+ env: DB=mariadb
81
83
  jdk: openjdk7
82
84
  - addons:
83
85
  mariadb: '10.0'
84
86
  rvm: jruby-1.7.24
85
87
  gemfile: gemfiles/rails41.gemfile
86
- env: JRUBY_OPTS="$JRUBY_OPTS" DB=mariadb PREPARED_STATEMENTS=true
88
+ env: DB=mariadb PREPARED_STATEMENTS=true
87
89
  jdk: oraclejdk8
88
90
  # include some tests on JDK 6 :
89
91
  - rvm: jruby-1.7.24
@@ -111,39 +113,39 @@ matrix:
111
113
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
112
114
  jdk: openjdk6
113
115
  # include testing with JRuby 9K (4.2) :
114
- - rvm: jruby-9.0.5.0
116
+ - rvm: jruby-9.1.2.0
115
117
  gemfile: gemfiles/rails42.gemfile
116
118
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql PREPARED_STATEMENTS=true
117
119
  jdk: oraclejdk7
118
- - rvm: jruby-9.0.5.0
120
+ - rvm: jruby-9.1.2.0
119
121
  gemfile: gemfiles/rails42.gemfile
120
122
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=true
121
123
  jdk: oraclejdk7
122
- - rvm: jruby-9.0.5.0
124
+ - rvm: jruby-9.1.2.0
123
125
  gemfile: gemfiles/rails42.gemfile
124
126
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
125
127
  jdk: oraclejdk7
126
- - rvm: jruby-9.0.5.0
128
+ - rvm: jruby-9.1.2.0
127
129
  gemfile: gemfiles/rails42.gemfile
128
130
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
129
131
  jdk: oraclejdk8
130
- - rvm: jruby-9.0.5.0
132
+ - rvm: jruby-9.1.2.0
131
133
  gemfile: gemfiles/rails42.gemfile
132
134
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
133
135
  jdk: oraclejdk8
134
- - rvm: jruby-9.0.5.0
136
+ - rvm: jruby-9.1.2.0
135
137
  gemfile: gemfiles/rails42.gemfile
136
138
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
137
139
  jdk: oraclejdk8
138
- - rvm: jruby-9.0.5.0
140
+ - rvm: jruby-9.1.2.0
139
141
  gemfile: gemfiles/rails42.gemfile
140
142
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=derby
141
143
  jdk: oraclejdk8
142
- - rvm: jruby-9.0.5.0
144
+ - rvm: jruby-9.1.2.0
143
145
  gemfile: gemfiles/rails42.gemfile
144
146
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=h2
145
147
  jdk: oraclejdk8
146
- - rvm: jruby-9.0.5.0
148
+ - rvm: jruby-9.1.2.0
147
149
  gemfile: gemfiles/rails42.gemfile
148
150
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
149
151
  jdk: oraclejdk8
data/Gemfile CHANGED
@@ -34,7 +34,7 @@ gem 'bcrypt-ruby', '~> 3.0.0', :require => nil, :group => :test
34
34
  #gem 'trinidad_dbpool', :require => nil, :group => :test
35
35
 
36
36
  group :development do
37
- gem 'ruby-debug', :require => nil # if ENV['DEBUG']
37
+ gem 'ruby-debug', :require => nil if ENV['DEBUG']
38
38
  group :doc do
39
39
  gem 'yard', :require => nil
40
40
  gem 'yard-method-overrides', :github => 'kares/yard-method-overrides', :require => nil
@@ -579,6 +579,7 @@ module ArJdbc
579
579
  end
580
580
 
581
581
  def change_column_null(table_name, column_name, null)
582
+ raise NotImplementedError, "DB2 for zOS does not support changing the column's nullability" if zos?
582
583
  if null
583
584
  sql = "ALTER TABLE #{table_name} ALTER COLUMN #{column_name} DROP NOT NULL"
584
585
  else
@@ -589,6 +590,7 @@ module ArJdbc
589
590
 
590
591
  def change_column_default(table_name, column_name, default)
591
592
  if default.nil?
593
+ raise NotImplementedError, "DB2 for zOS does not support changing the column default to NULL" if zos?
592
594
  sql = "ALTER TABLE #{table_name} ALTER COLUMN #{column_name} DROP DEFAULT"
593
595
  else
594
596
  sql = "ALTER TABLE #{table_name} ALTER COLUMN #{column_name} SET WITH DEFAULT #{quote(default)}"
@@ -691,6 +693,12 @@ module ArJdbc
691
693
  # @override
692
694
  def supports_views?; true end
693
695
 
696
+ # @override
697
+ def supports_foreign_keys?; true end
698
+
699
+ # @override
700
+ def supports_ddl_transactions?; true end
701
+
694
702
  def execute_table_change(sql, table_name, name = nil)
695
703
  outcome = execute(sql, name)
696
704
  reorg_table(table_name, name)
@@ -737,11 +745,14 @@ module ArJdbc
737
745
 
738
746
  # @private
739
747
  def zos?
740
- @zos = nil unless defined? @zos
748
+ @zos = config[:zos] unless defined? @zos
741
749
  return @zos unless @zos.nil?
750
+ # jdbc:db2: - connection to a DB2 for z/OS, DB2 for Linux, UNIX, and Windows
751
+ # jdbc:db2j:net: - connection is to a remote IBM Cloudscape server
752
+ # jdbc:ids: - informix (not supported)
742
753
  @zos =
743
754
  if url = config[:url]
744
- !!( url =~ /^jdbc:db2j:net:/ && config[:driver] == DRIVER_NAME )
755
+ !!( config[:driver] == DRIVER_NAME && url =~ /^jdbc:db2j:net:/ )
745
756
  else
746
757
  nil
747
758
  end
@@ -10,6 +10,11 @@ module ArJdbc
10
10
  ::ActiveRecord::ConnectionAdapters::H2JdbcConnection
11
11
  end
12
12
 
13
+ # @see ActiveRecord::ConnectionAdapters::JdbcAdapter#jdbc_column_class
14
+ def jdbc_column_class
15
+ ::ActiveRecord::ConnectionAdapters::H2Column
16
+ end
17
+
13
18
  # @see ActiveRecord::ConnectionAdapters::JdbcColumn#column_types
14
19
  def self.column_selector
15
20
  [ /\.h2\./i, lambda { |config, column| column.extend(Column) } ]
@@ -300,4 +305,8 @@ module ActiveRecord::ConnectionAdapters
300
305
  include ArJdbc::H2
301
306
  end
302
307
 
308
+ class H2Column < JdbcColumn
309
+ include ::ArJdbc::H2::Column
310
+ end
311
+
303
312
  end
@@ -826,13 +826,13 @@ module ActiveRecord
826
826
  false # off by default - NOTE: on AR 4.x it's on by default !?
827
827
  end
828
828
 
829
- if @@suble_binds = Java::JavaLang::System.getProperty('arjdbc.adapter.suble_binds')
829
+ if @@suble_binds = ENV_JAVA['arjdbc.adapter.suble_binds']
830
830
  @@suble_binds = Java::JavaLang::Boolean.parseBoolean(@@suble_binds)
831
831
  else
832
832
  @@suble_binds = ActiveRecord::VERSION::MAJOR < 4 # due compatibility
833
833
  end
834
834
  def self.suble_binds?; @@suble_binds; end
835
- def self.suble_binds=(flag); @@suble_binds = flag; end
835
+ def self.suble_binds=(flag); @@suble_binds = flag; end # remove on 1.4
836
836
 
837
837
  private
838
838
 
@@ -63,9 +63,11 @@ ArJdbc::ConnectionMethods.module_eval do
63
63
  properties['verifyServerCertificate'] ||= false if mysql_driver
64
64
  end
65
65
  end
66
- if mariadb_driver
67
- properties['verifyServerCertificate'] ||= false
68
- end
66
+ properties['verifyServerCertificate'] ||= false if mariadb_driver
67
+ else
68
+ # According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection
69
+ # must be established by default if explicit option isn't set :
70
+ properties['useSSL'] ||= false
69
71
  end
70
72
  if socket = config[:socket]
71
73
  properties['localSocket'] ||= socket if mariadb_driver
@@ -1,5 +1,5 @@
1
1
  module ArJdbc
2
- VERSION = "1.3.20"
2
+ VERSION = "1.3.21"
3
3
  # @deprecated
4
4
  module Version
5
5
  # @private 1.2.x compatibility
@@ -6,21 +6,23 @@ namespace :db do
6
6
  task :mysql do
7
7
  fail "could not create test database: mysql executable not found" unless mysql = which('mysql')
8
8
  load 'test/db/mysql_config.rb' # rescue nil
9
+ puts MYSQL_CONFIG.inspect if $VERBOSE
9
10
  script = sql_script <<-SQL, 'mysql'
10
11
  DROP DATABASE IF EXISTS `#{MYSQL_CONFIG[:database]}`;
12
+ CREATE USER #{MYSQL_CONFIG[:username]}@localhost;
11
13
  CREATE DATABASE `#{MYSQL_CONFIG[:database]}` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
12
14
  GRANT ALL PRIVILEGES ON `#{MYSQL_CONFIG[:database]}`.* TO #{MYSQL_CONFIG[:username]}@localhost;
13
15
  GRANT ALL PRIVILEGES ON `test\_%`.* TO #{MYSQL_CONFIG[:username]}@localhost;
14
16
  SET PASSWORD FOR #{MYSQL_CONFIG[:username]}@localhost = PASSWORD('#{MYSQL_CONFIG[:password]}');
15
17
  SQL
16
18
  params = { '-u' => 'root' }
17
- if ENV['DATABASE_YML']
18
- require 'yaml'
19
- password = YAML.load(File.new(ENV['DATABASE_YML']))["production"]["password"]
20
- params['--password'] = password
19
+ if ENV['DATABASE_YML']; require 'yaml'
20
+ params['-p'] = YAML.load(File.new(ENV['DATABASE_YML']))["production"]["password"]
21
21
  end
22
+ params['-u'] = ENV['MY_USER'] if ENV['MY_USER']
23
+ params['-p'] = ENV['MY_PASSWORD'] if ENV['MY_PASSWORD']
22
24
  puts "Creating MySQL (test) database: #{MYSQL_CONFIG[:database]}"
23
- sh "cat #{script.path} | #{mysql} #{params.to_a.join(' ')}", :verbose => $VERBOSE # so password is not echoed
25
+ sh "cat #{script.path} | #{mysql} -f #{params.map {|k, v| "#{k}#{v}"}.join(' ')}", :verbose => $VERBOSE # so password is not echoed
24
26
  end
25
27
 
26
28
  desc "Creates the test database for PostgreSQL"
@@ -28,6 +30,7 @@ SQL
28
30
  fail 'could not create test database: psql executable not found' unless psql = which('psql')
29
31
  fail 'could not create test database: missing "postgres" role' unless PostgresHelper.postgres_role?
30
32
  load 'test/db/postgres_config.rb' # rescue nil
33
+ puts POSTGRES_CONFIG.inspect if $VERBOSE
31
34
  script = sql_script <<-SQL, 'psql'
32
35
  DROP DATABASE IF EXISTS #{POSTGRES_CONFIG[:database]};
33
36
  DROP USER IF EXISTS #{POSTGRES_CONFIG[:username]};
@@ -2146,7 +2146,7 @@ public class RubyJdbcConnection extends RubyObject {
2146
2146
  for ( int i = 0; i < binds.size(); i++ ) {
2147
2147
  // [ [ column1, param1 ], [ column2, param2 ], ... ]
2148
2148
  Object param = binds.get(i); IRubyObject column = null;
2149
- if ( param.getClass() == RubyArray.class ) {
2149
+ if ( param instanceof RubyArray ) {
2150
2150
  final RubyArray _param = (RubyArray) param;
2151
2151
  column = _param.eltInternal(0); param = _param.eltInternal(1);
2152
2152
  }
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.20
4
+ version: 1.3.21
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-03-10 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -215,16 +215,13 @@ files:
215
215
  - src/java/arjdbc/jdbc/SQLBlock.java
216
216
  - src/java/arjdbc/mssql/MSSQLModule.java
217
217
  - src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java
218
- - src/java/arjdbc/mssql/MssqlRubyJdbcConnection.java
219
218
  - src/java/arjdbc/mysql/MySQLModule.java
220
219
  - src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java
221
220
  - src/java/arjdbc/oracle/OracleModule.java
222
221
  - src/java/arjdbc/oracle/OracleRubyJdbcConnection.java
223
222
  - src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java
224
- - src/java/arjdbc/postgresql/PostgresqlRubyJdbcConnection.java
225
223
  - src/java/arjdbc/sqlite3/SQLite3Module.java
226
224
  - src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java
227
- - src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java
228
225
  - src/java/arjdbc/util/CallResultSet.java
229
226
  - src/java/arjdbc/util/QuotingUtils.java
230
227
  homepage: https://github.com/jruby/activerecord-jdbc-adapter
@@ -1,40 +0,0 @@
1
- /*
2
- * The MIT License
3
- *
4
- * Copyright 2013 Karol Bucek.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- */
24
- package arjdbc.mssql;
25
-
26
- import org.jruby.Ruby;
27
- import org.jruby.RubyClass;
28
-
29
- /**
30
- * @see MSSQLRubyJdbcConnection
31
- * @deprecated only for Java API backwards-compatibility
32
- */
33
- @Deprecated
34
- public class MssqlRubyJdbcConnection extends MSSQLRubyJdbcConnection {
35
-
36
- protected MssqlRubyJdbcConnection(Ruby runtime, RubyClass metaClass) {
37
- super(runtime, metaClass);
38
- }
39
-
40
- }
@@ -1,40 +0,0 @@
1
- /*
2
- * The MIT License
3
- *
4
- * Copyright 2013 Karol Bucek.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- */
24
- package arjdbc.postgresql;
25
-
26
- import org.jruby.Ruby;
27
- import org.jruby.RubyClass;
28
-
29
- /**
30
- * @see PostgreSQLRubyJdbcConnection
31
- * @deprecated only for Java API backwards-compatibility
32
- */
33
- @Deprecated
34
- public class PostgresqlRubyJdbcConnection extends PostgreSQLRubyJdbcConnection {
35
-
36
- protected PostgresqlRubyJdbcConnection(Ruby runtime, RubyClass metaClass) {
37
- super(runtime, metaClass);
38
- }
39
-
40
- }
@@ -1,40 +0,0 @@
1
- /*
2
- * The MIT License
3
- *
4
- * Copyright 2013 Karol Bucek.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- */
24
- package arjdbc.sqlite3;
25
-
26
- import org.jruby.Ruby;
27
- import org.jruby.RubyClass;
28
-
29
- /**
30
- * @see SQLite3RubyJdbcConnection
31
- * @deprecated only for Java API backwards-compatibility
32
- */
33
- @Deprecated
34
- public class Sqlite3RubyJdbcConnection extends SQLite3RubyJdbcConnection {
35
-
36
- protected Sqlite3RubyJdbcConnection(Ruby runtime, RubyClass metaClass) {
37
- super(runtime, metaClass);
38
- }
39
-
40
- }