activerecord-jdbc-adapter 1.3.22 → 1.3.23

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: f59b963d6b856bb7a8ecd3ab0bf506653c04fc50
4
- data.tar.gz: ff0251deca4b0c4dc691cabad8da7a6e63e3a6cd
3
+ metadata.gz: 87ea17eefa2d7db8e501c87fa8a349d93b3b2eeb
4
+ data.tar.gz: af9e8507422e47c0eea8b525b1f797b9ab67bcb7
5
5
  SHA512:
6
- metadata.gz: 68dad2a1551b5c8fe023a0118a68786172a9df1e209261b8b66c47da4bcee33198d8a5640171ce0b9998a021164f0cbcc787e91e0ef9a5f11d3902b113de7153
7
- data.tar.gz: 79d7ea6b89a613c149579e14fb065dee1e24ab93a0dae03513b3a56251edcd1c243f36b245c19de9440c87c69b830ec73336cd9cf1a43dc1651322effac8115a
6
+ metadata.gz: e3d85c46104e42aa4a1439e4a91c929bec9c5af3094c35999c784cfbbba97e837dbabf8d3627a38a5956bf7d69bad950c8621f74241733252582a70650c561d9
7
+ data.tar.gz: 48bbbd8d3cf5647e26378fcf6d7b86d64d877632d5abc0acac694aad1936dcca7656061722eea6b41e3a536c3afad31c96de2c2655aec9c9b75d1cbc899c808a
@@ -46,25 +46,6 @@ branches:
46
46
  - /^test-.*/
47
47
  matrix:
48
48
  allow_failures:
49
- # yet another BC timestamp issue: <Wed, 31 Dec -0001 22:58:59 +0000> expected but was <Fri, 02 Jan 0000 22:58:59 +0000>
50
- - rvm: jruby-9.0.5.0
51
- gemfile: gemfiles/rails41.gemfile
52
- env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
53
- jdk: oraclejdk7
54
- # ``/system call symlink regression (since JRuby 1.7.19)
55
- # + (postgres) database_tasks got updated on 4.2 : https://github.com/rails/rails/commit/07f8a96aa14b642a86
56
- - rvm: jruby-1.7.24
57
- gemfile: gemfiles/rails42.gemfile
58
- env: JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=false INSERT_RETURNING=true
59
- - rvm: jruby-1.7.24
60
- gemfile: gemfiles/rails42.gemfile
61
- env: JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=true
62
- - rvm: jruby-1.7.24
63
- gemfile: gemfiles/rails42.gemfile
64
- env: JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=true INSERT_RETURNING=true
65
- - rvm: jruby-1.7.24
66
- gemfile: gemfiles/rails42.gemfile
67
- env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
68
49
  - env: DB=mariadb
69
50
  - env: DB=mariadb PREPARED_STATEMENTS=true
70
51
  include:
@@ -76,13 +57,13 @@ matrix:
76
57
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
77
58
  jdk: openjdk6
78
59
  - addons:
79
- mariadb: '10.0'
60
+ mariadb: '10.1'
80
61
  rvm: jruby-1.7.24
81
62
  gemfile: gemfiles/rails42.gemfile
82
63
  env: DB=mariadb
83
64
  jdk: openjdk7
84
65
  - addons:
85
- mariadb: '10.0'
66
+ mariadb: '10.1'
86
67
  rvm: jruby-1.7.24
87
68
  gemfile: gemfiles/rails41.gemfile
88
69
  env: DB=mariadb PREPARED_STATEMENTS=true
@@ -113,7 +94,7 @@ matrix:
113
94
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
114
95
  jdk: openjdk6
115
96
  # include testing with JRuby 9K (4.2) :
116
- - rvm: jruby-9.1.6.0
97
+ - rvm: jruby-9.1.8.0
117
98
  gemfile: gemfiles/rails42.gemfile
118
99
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql PREPARED_STATEMENTS=true
119
100
  jdk: oraclejdk7
@@ -121,7 +102,7 @@ matrix:
121
102
  gemfile: gemfiles/rails42.gemfile
122
103
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql PREPARED_STATEMENTS=true
123
104
  jdk: oraclejdk7
124
- - rvm: jruby-9.1.6.0
105
+ - rvm: jruby-9.1.8.0
125
106
  gemfile: gemfiles/rails42.gemfile
126
107
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
127
108
  jdk: oraclejdk7
@@ -129,7 +110,7 @@ matrix:
129
110
  gemfile: gemfiles/rails42.gemfile
130
111
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
131
112
  jdk: oraclejdk8
132
- - rvm: jruby-9.1.6.0
113
+ - rvm: jruby-9.1.8.0
133
114
  gemfile: gemfiles/rails42.gemfile
134
115
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
135
116
  jdk: oraclejdk8
@@ -137,15 +118,15 @@ matrix:
137
118
  gemfile: gemfiles/rails42.gemfile
138
119
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
139
120
  jdk: oraclejdk8
140
- - rvm: jruby-9.1.6.0
121
+ - rvm: jruby-9.1.8.0
141
122
  gemfile: gemfiles/rails42.gemfile
142
123
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=derby
143
124
  jdk: oraclejdk8
144
- - rvm: jruby-9.1.6.0
125
+ - rvm: jruby-9.1.8.0
145
126
  gemfile: gemfiles/rails42.gemfile
146
127
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=h2
147
128
  jdk: oraclejdk8
148
- - rvm: jruby-9.1.6.0
129
+ - rvm: jruby-9.1.8.0
149
130
  gemfile: gemfiles/rails42.gemfile
150
131
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
151
132
  jdk: oraclejdk8
@@ -162,27 +143,27 @@ matrix:
162
143
  gemfile: gemfiles/rails41.gemfile
163
144
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
164
145
  jdk: oraclejdk8
165
- - rvm: jruby-9.0.5.0
146
+ - rvm: jruby-9.1.8.0
166
147
  gemfile: gemfiles/rails41.gemfile
167
148
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=mysql
168
149
  jdk: oraclejdk7
169
- - rvm: jruby-9.0.5.0
150
+ - rvm: jruby-9.1.8.0
170
151
  gemfile: gemfiles/rails41.gemfile
171
152
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=postgresql
172
153
  jdk: oraclejdk7
173
- - rvm: jruby-9.0.5.0
154
+ - rvm: jruby-9.1.8.0
174
155
  gemfile: gemfiles/rails41.gemfile
175
156
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=sqlite3
176
157
  jdk: oraclejdk8
177
- - rvm: jruby-9.0.5.0
158
+ - rvm: jruby-9.1.8.0
178
159
  gemfile: gemfiles/rails41.gemfile
179
160
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=derby
180
161
  jdk: oraclejdk7
181
- - rvm: jruby-9.0.5.0
162
+ - rvm: jruby-9.1.8.0
182
163
  gemfile: gemfiles/rails41.gemfile
183
164
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=h2
184
165
  jdk: oraclejdk7
185
- - rvm: jruby-9.0.5.0
166
+ - rvm: jruby-9.1.8.0
186
167
  gemfile: gemfiles/rails41.gemfile
187
168
  env: JRUBY_OPTS="$JRUBY_OPTS" DB=hsqldb
188
169
  jdk: oraclejdk8
data/Appraisals CHANGED
@@ -21,11 +21,11 @@ appraise "rails40" do
21
21
  end
22
22
 
23
23
  appraise "rails41" do
24
- gem "activerecord", "~> 4.1.8", :require => false
24
+ gem "activerecord", "~> 4.1.11", :require => false
25
25
  end
26
26
 
27
27
  appraise "rails42" do
28
- gem "activerecord", "~> 4.2.0", :require => false
28
+ gem "activerecord", "~> 4.2.6", :require => false
29
29
  end
30
30
 
31
31
  appraise "railsNG" do
data/Gemfile CHANGED
@@ -14,6 +14,10 @@ else
14
14
  gem 'activerecord', :require => nil
15
15
  end
16
16
 
17
+ # NOTE: gem overrides AR internals and assumes it can safely patch adapter classes ...
18
+ # thus it is to be used (in tests) as an optional - tests should roll fine without it!
19
+ gem 'composite_primary_keys', :require => nil unless ENV['COMPOSITE_PK'].eql?('false')
20
+
17
21
  gem 'thread_safe', :require => nil # "optional" - we can roll without it
18
22
 
19
23
  if defined?(JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
data/History.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 1.3.23 (05/14/17)
2
+
3
+ - specify gem 'activerecord' < 5 since 5.x is not supported in 1.3.x
4
+ - [postgres] get non-seq id inserts working when insert_returning: false (#716)
5
+ - [postgres] previously-deprecated -i switch to pg_dump is no longer supported
6
+ (in PostgreSQL 9.5) (#729)
7
+ - [postgres] Assume that primary key can be multiple values (#773)
8
+ - prevent multiple pushes of the adapter file onto $LOADED_FEATURES
9
+
1
10
  ## 1.3.22 (12/23/16)
2
11
 
3
12
  - [postgres] Fix incorrect postgresql_version when running RC (#717)
@@ -29,8 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
30
30
  gem.test_files = gem.files.grep(%r{^test/})
31
31
 
32
- # NOTE: 1.3.0 only supports >= 2.3 but users report it works with 2.2 :
33
- gem.add_dependency 'activerecord', '>= 2.2'
32
+ gem.add_dependency 'activerecord', '>= 2.2', '< 5.0'
34
33
 
35
34
  #gem.add_development_dependency 'test-unit', '2.5.4'
36
35
  #gem.add_development_dependency 'test-unit-context', '>= 0.3.0'
@@ -716,7 +716,7 @@ module ArJdbc
716
716
  # Returns the value of an identity column of the last *INSERT* statement
717
717
  # made over this connection.
718
718
  # @note Check the *IDENTITY_VAL_LOCAL* function for documentation.
719
- # @return [Fixnum]
719
+ # @return [Integer]
720
720
  def last_insert_id
721
721
  @connection.identity_val_local
722
722
  end
@@ -47,7 +47,7 @@ module ArJdbc
47
47
 
48
48
  # @override
49
49
  def type_cast(value)
50
- return nil if value.nil? || value == 'NULL' || value =~ /^\s*NULL\s*$/i
50
+ return nil if value.nil? || value.eql?('NULL') || value =~ /^\s*NULL\s*$/i
51
51
  case type
52
52
  when :string then value
53
53
  when :integer then value.respond_to?(:to_i) ? value.to_i : (value ? 1 : 0)
@@ -511,7 +511,7 @@ module ArJdbc
511
511
  # Returns the value of an identity column of the last *INSERT* statement
512
512
  # made over this connection.
513
513
  # @note Check the *IDENTITY_VAL_LOCAL* function for documentation.
514
- # @return [Fixnum]
514
+ # @return [Integer]
515
515
  def last_insert_id
516
516
  @connection.identity_val_local
517
517
  end
@@ -354,7 +354,7 @@ module ArJdbc
354
354
  when NilClass then 'NULL'
355
355
  when TrueClass then (type == :integer ? '1' : quoted_true)
356
356
  when FalseClass then (type == :integer ? '0' : quoted_false)
357
- when Float, Fixnum, Bignum then value.to_s
357
+ when Float, Integer then value.to_s
358
358
  # BigDecimals need to be output in a non-normalized form and quoted.
359
359
  when BigDecimal then value.to_s('F')
360
360
  when Symbol then "'#{quote_string(value.to_s)}'"
@@ -23,24 +23,43 @@ module ActiveRecord
23
23
  # adapters) would be to mingle with the $LOAD_PATH which seems worse ...
24
24
  case path
25
25
  when 'active_record/connection_adapters/mysql_adapter'
26
- $LOADED_FEATURES << 'active_record/connection_adapters/mysql_adapter.rb'
27
- super('arjdbc/mysql')
26
+ if !$LOADED_FEATURES.include?('active_record/connection_adapters/mysql_adapter.rb')
27
+ $LOADED_FEATURES << 'active_record/connection_adapters/mysql_adapter.rb'
28
+ super('arjdbc/mysql')
29
+ else
30
+ false
31
+ end
28
32
  when 'active_record/connection_adapters/mysql2_adapter'
29
- $LOADED_FEATURES << 'active_record/connection_adapters/mysql2_adapter.rb'
30
- super('arjdbc/mysql')
33
+ if !$LOADED_FEATURES.include?('active_record/connection_adapters/mysql2_adapter.rb')
34
+ $LOADED_FEATURES << 'active_record/connection_adapters/mysql2_adapter.rb'
35
+ super('arjdbc/mysql')
36
+ else
37
+ false
38
+ end
31
39
  when 'active_record/connection_adapters/postgresql_adapter'
32
- $LOADED_FEATURES << 'active_record/connection_adapters/postgresql_adapter.rb'
33
- super('arjdbc/postgresql')
40
+ if !$LOADED_FEATURES.include?('active_record/connection_adapters/postgresql_adapter.rb')
41
+ $LOADED_FEATURES << 'active_record/connection_adapters/postgresql_adapter.rb'
42
+ super('arjdbc/postgresql')
43
+ else
44
+ false
45
+ end
34
46
  when 'active_record/connection_adapters/sqlite_adapter'
35
- $LOADED_FEATURES << 'active_record/connection_adapters/sqlite_adapter.rb'
36
- super('arjdbc/sqlite3')
47
+ if !$LOADED_FEATURES.include?('active_record/connection_adapters/sqlite_adapter.rb')
48
+ $LOADED_FEATURES << 'active_record/connection_adapters/sqlite_adapter.rb'
49
+ super('arjdbc/sqlite3')
50
+ else
51
+ false
52
+ end
37
53
  when 'active_record/connection_adapters/sqlite3_adapter'
38
- $LOADED_FEATURES << 'active_record/connection_adapters/sqlite3_adapter.rb'
39
- super('arjdbc/sqlite3')
54
+ if !$LOADED_FEATURES.include?('active_record/connection_adapters/sqlite3_adapter.rb')
55
+ $LOADED_FEATURES << 'active_record/connection_adapters/sqlite3_adapter.rb'
56
+ super('arjdbc/sqlite3')
57
+ else
58
+ false
59
+ end
40
60
  else super
41
61
  end
42
62
  end
43
-
44
63
  end
45
64
 
46
- end
65
+ end
@@ -49,7 +49,7 @@ module ArJdbc
49
49
  # Increase timeout so the server doesn't disconnect us.
50
50
  wait_timeout = config[:wait_timeout]
51
51
  wait_timeout = self.class.type_cast_config_to_integer(wait_timeout)
52
- variables[:wait_timeout] = wait_timeout.is_a?(Fixnum) ? wait_timeout : 2147483
52
+ variables[:wait_timeout] = wait_timeout.is_a?(Integer) ? wait_timeout : 2147483
53
53
 
54
54
  # Make MySQL reject illegal values rather than truncating or blanking them, see
55
55
  # http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_strict_all_tables
@@ -850,7 +850,7 @@ module ArJdbc
850
850
  case length
851
851
  when Hash
852
852
  column_names.map { |name| length[name] ? "#{quote_column_name(name)}(#{length[name]})" : quote_column_name(name) }
853
- when Fixnum
853
+ when Integer
854
854
  column_names.map { |name| "#{quote_column_name(name)}(#{length})" }
855
855
  else
856
856
  column_names.map { |name| quote_column_name(name) }
@@ -165,7 +165,7 @@ module ArJdbc
165
165
  when 1, 2; 'smallint'
166
166
  when 3, 4; 'integer'
167
167
  when 5..8; 'bigint'
168
- else raise(ActiveRecordError, "No integer type has byte size #{limit}. Use a numeric with precision 0 instead.")
168
+ else raise(ActiveRecordError, "No integer type has byte size #{limit}. Use a numeric with scale 0 instead.")
169
169
  end
170
170
  when 'datetime'
171
171
  return super unless precision
@@ -571,7 +571,8 @@ module ArJdbc
571
571
  end
572
572
 
573
573
  if pk && use_insert_returning?
574
- sql = "#{sql} RETURNING #{quote_column_name(pk)}"
574
+ returning = Array(pk).map(&method(:quote_table_name)).join(', ')
575
+ sql = "#{sql} RETURNING (#{returning})"
575
576
  end
576
577
 
577
578
  [ sql, binds ]
@@ -589,7 +590,7 @@ module ArJdbc
589
590
  exec_query(sql, name, binds) # due RETURNING clause returns a result set
590
591
  else
591
592
  result = super
592
- if pk
593
+ if pk && use_insert_returning?
593
594
  unless sequence_name
594
595
  table_ref = extract_table_ref_from_insert_sql(sql)
595
596
  sequence_name = default_sequence_name(table_ref, pk)
@@ -277,7 +277,7 @@ module ArJdbc
277
277
 
278
278
  # Returns 62. SQLite supports index names up to 64 characters.
279
279
  # The rest is used by Rails internally to perform temporary rename operations.
280
- # @return [Fixnum]
280
+ # @return [Integer]
281
281
  def allowed_index_name_length
282
282
  index_name_length - 2
283
283
  end
@@ -112,7 +112,7 @@ namespace :db do
112
112
  unless search_path.blank?
113
113
  search_path = search_path.split(",").map{ |part| "--schema=#{Shellwords.escape(part.strip)}" }.join(" ")
114
114
  end
115
- sh "pg_dump -i -s -x -O -f #{Shellwords.escape(filename)} #{search_path} #{Shellwords.escape(config['database'])}"
115
+ sh "pg_dump -s -x -O -f #{Shellwords.escape(filename)} #{search_path} #{Shellwords.escape(config['database'])}"
116
116
 
117
117
  File.open(filename, 'a') { |f| f << "SET search_path TO #{ActiveRecord::Base.connection.schema_search_path};\n\n" }
118
118
  when /sqlite/
@@ -1,5 +1,5 @@
1
1
  module ArJdbc
2
- VERSION = "1.3.22"
2
+ VERSION = "1.3.23"
3
3
  # @deprecated
4
4
  module Version
5
5
  # @private 1.2.x compatibility
@@ -7,6 +7,7 @@ namespace :db 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
9
  puts MYSQL_CONFIG.inspect if $VERBOSE
10
+ # DROP USER arjdbc@localhost; __ERROR 1396 (HY000): Operation CREATE USER failed__
10
11
  script = sql_script <<-SQL, 'mysql'
11
12
  DROP DATABASE IF EXISTS `#{MYSQL_CONFIG[:database]}`;
12
13
  CREATE USER #{MYSQL_CONFIG[:username]}@localhost;
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.22
4
+ version: 1.3.23
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-12-23 00:00:00.000000000 Z
11
+ date: 2017-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -16,6 +16,9 @@ dependencies:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: '2.2'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '5.0'
19
22
  name: activerecord
20
23
  prerelease: false
21
24
  type: :runtime
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '2.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
27
33
  description: 'AR-JDBC is a database adapter for Rails'' ActiveRecord component designed
28
34
  to be used with JRuby built upon Java''s JDBC API for database access. Provides
29
35
  (ActiveRecord) built-in adapters: MySQL, PostgreSQL and SQLite3 as well as adapters