activerecord-jdbc-adapter 1.3.13 → 1.3.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,16 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  bundler_args: --without development
3
4
  script: bundle exec rake test_$DB
4
- before_script: export JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false"
5
+ before_script:
6
+ - export JRUBY_OPTS="--server" # -Xcompile.invokedynamic=false
5
7
  before_install:
6
- - jruby --1.9 -S gem update --system 2.1.11
8
+ - ((jruby -v | grep 1.8.7) && jruby --1.9 -S gem update --system 2.1.11) || true
7
9
  rvm:
8
- - jruby
10
+ - jruby-1.7.18
11
+ #- jruby-head # 9000 ignores --1.8 and --1.9 switches
12
+ jdk:
13
+ - openjdk6
9
14
  gemfile:
10
15
  - gemfiles/rails23.gemfile
11
16
  - gemfiles/rails30.gemfile
@@ -32,93 +37,267 @@ env:
32
37
  - JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=hsqldb PREPARED_STATEMENTS=true
33
38
  - JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
34
39
  - JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=jndi PREPARED_STATEMENTS=true
35
- # TODO: not sure why it can't connect :
36
- #- JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
37
- #- JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=jdbc
38
- jdk:
39
- - openjdk6
40
+ - JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
41
+ - JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=jdbc PREPARED_STATEMENTS=true
40
42
  branches:
41
43
  only:
42
44
  - master
43
45
  - /.*-stable$/
44
- - next
45
46
  - /^test-.*/
46
47
  matrix:
47
48
  allow_failures:
48
49
  - gemfile: gemfiles/rails42.gemfile
50
+ - env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
51
+ - env: JRUBY_OPTS="--1.9 $JRUBY_OPTS" DB=jdbc PREPARED_STATEMENTS=true
49
52
  exclude:
50
53
  # Rails 4 prefers Ruby 2.0 (or at least >= 1.9.3) :
51
- - rvm: jruby
54
+ - rvm: jruby-1.7.18
52
55
  gemfile: gemfiles/rails40.gemfile
53
56
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
54
- - rvm: jruby
57
+ - rvm: jruby-1.7.18
55
58
  gemfile: gemfiles/rails40.gemfile
56
59
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
57
- - rvm: jruby
60
+ - rvm: jruby-1.7.18
58
61
  gemfile: gemfiles/rails40.gemfile
59
62
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
60
- - rvm: jruby
63
+ - rvm: jruby-1.7.18
61
64
  gemfile: gemfiles/rails40.gemfile
62
65
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
63
- - rvm: jruby
66
+ - rvm: jruby-1.7.18
64
67
  gemfile: gemfiles/rails40.gemfile
65
68
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
66
- - rvm: jruby
69
+ - rvm: jruby-1.7.18
67
70
  gemfile: gemfiles/rails40.gemfile
68
71
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
69
- - rvm: jruby
72
+ - rvm: jruby-1.7.18
70
73
  gemfile: gemfiles/rails40.gemfile
71
74
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
72
- - rvm: jruby
75
+ - rvm: jruby-1.7.18
73
76
  gemfile: gemfiles/rails40.gemfile
74
77
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
75
78
  # Rails 4.1 does not support Ruby 1.8 :
76
- - rvm: jruby
79
+ - rvm: jruby-1.7.18
77
80
  gemfile: gemfiles/rails41.gemfile
78
81
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
79
- - rvm: jruby
82
+ - rvm: jruby-1.7.18
80
83
  gemfile: gemfiles/rails41.gemfile
81
84
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
82
- - rvm: jruby
85
+ - rvm: jruby-1.7.18
83
86
  gemfile: gemfiles/rails41.gemfile
84
87
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
85
- - rvm: jruby
88
+ - rvm: jruby-1.7.18
86
89
  gemfile: gemfiles/rails41.gemfile
87
90
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
88
- - rvm: jruby
91
+ - rvm: jruby-1.7.18
89
92
  gemfile: gemfiles/rails41.gemfile
90
93
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
91
- - rvm: jruby
94
+ - rvm: jruby-1.7.18
92
95
  gemfile: gemfiles/rails41.gemfile
93
96
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
94
- - rvm: jruby
97
+ - rvm: jruby-1.7.18
95
98
  gemfile: gemfiles/rails41.gemfile
96
99
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
97
- - rvm: jruby
100
+ - rvm: jruby-1.7.18
98
101
  gemfile: gemfiles/rails41.gemfile
99
102
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
100
103
  # Rails 4.2 will not support Ruby 1.8 :
101
- - rvm: jruby
104
+ - rvm: jruby-1.7.18
105
+ gemfile: gemfiles/rails42.gemfile
106
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
107
+ - rvm: jruby-1.7.18
108
+ gemfile: gemfiles/rails42.gemfile
109
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
110
+ - rvm: jruby-1.7.18
111
+ gemfile: gemfiles/rails42.gemfile
112
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
113
+ - rvm: jruby-1.7.18
114
+ gemfile: gemfiles/rails42.gemfile
115
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
116
+ - rvm: jruby-1.7.18
117
+ gemfile: gemfiles/rails42.gemfile
118
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
119
+ - rvm: jruby-1.7.18
120
+ gemfile: gemfiles/rails42.gemfile
121
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
122
+ - rvm: jruby-1.7.18
123
+ gemfile: gemfiles/rails42.gemfile
124
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
125
+ - rvm: jruby-1.7.18
126
+ gemfile: gemfiles/rails42.gemfile
127
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
128
+ ## JRuby 9K :
129
+ # Rails 2.3 (JRuby 9K) NOTE we should exclude all :
130
+ - rvm: jruby-head
131
+ gemfile: gemfiles/rails23.gemfile
132
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
133
+ - rvm: jruby-head
134
+ gemfile: gemfiles/rails23.gemfile
135
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
136
+ - rvm: jruby-head
137
+ gemfile: gemfiles/rails23.gemfile
138
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
139
+ - rvm: jruby-head
140
+ gemfile: gemfiles/rails23.gemfile
141
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
142
+ - rvm: jruby-head
143
+ gemfile: gemfiles/rails23.gemfile
144
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
145
+ - rvm: jruby-head
146
+ gemfile: gemfiles/rails23.gemfile
147
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
148
+ - rvm: jruby-head
149
+ gemfile: gemfiles/rails23.gemfile
150
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
151
+ - rvm: jruby-head
152
+ gemfile: gemfiles/rails23.gemfile
153
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
154
+ # Rails 3.0 (JRuby 9K) NOTE we should exclude all :
155
+ - rvm: jruby-head
156
+ gemfile: gemfiles/rails30.gemfile
157
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
158
+ - rvm: jruby-head
159
+ gemfile: gemfiles/rails30.gemfile
160
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
161
+ - rvm: jruby-head
162
+ gemfile: gemfiles/rails30.gemfile
163
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
164
+ - rvm: jruby-head
165
+ gemfile: gemfiles/rails30.gemfile
166
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
167
+ - rvm: jruby-head
168
+ gemfile: gemfiles/rails30.gemfile
169
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
170
+ - rvm: jruby-head
171
+ gemfile: gemfiles/rails30.gemfile
172
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
173
+ - rvm: jruby-head
174
+ gemfile: gemfiles/rails30.gemfile
175
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
176
+ - rvm: jruby-head
177
+ gemfile: gemfiles/rails30.gemfile
178
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
179
+ # Rails 3.1 (JRuby 9K) NOTE we should exclude all :
180
+ - rvm: jruby-head
181
+ gemfile: gemfiles/rails31.gemfile
182
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
183
+ - rvm: jruby-head
184
+ gemfile: gemfiles/rails31.gemfile
185
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
186
+ - rvm: jruby-head
187
+ gemfile: gemfiles/rails31.gemfile
188
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
189
+ - rvm: jruby-head
190
+ gemfile: gemfiles/rails31.gemfile
191
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
192
+ - rvm: jruby-head
193
+ gemfile: gemfiles/rails31.gemfile
194
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
195
+ - rvm: jruby-head
196
+ gemfile: gemfiles/rails31.gemfile
197
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
198
+ - rvm: jruby-head
199
+ gemfile: gemfiles/rails31.gemfile
200
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
201
+ - rvm: jruby-head
202
+ gemfile: gemfiles/rails31.gemfile
203
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
204
+ # Rails 3.2 (JRuby 9K) :
205
+ - rvm: jruby-head
206
+ gemfile: gemfiles/rails32.gemfile
207
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
208
+ - rvm: jruby-head
209
+ gemfile: gemfiles/rails32.gemfile
210
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
211
+ - rvm: jruby-head
212
+ gemfile: gemfiles/rails32.gemfile
213
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
214
+ - rvm: jruby-head
215
+ gemfile: gemfiles/rails32.gemfile
216
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
217
+ - rvm: jruby-head
218
+ gemfile: gemfiles/rails32.gemfile
219
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
220
+ - rvm: jruby-head
221
+ gemfile: gemfiles/rails32.gemfile
222
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
223
+ - rvm: jruby-head
224
+ gemfile: gemfiles/rails32.gemfile
225
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
226
+ - rvm: jruby-head
227
+ gemfile: gemfiles/rails32.gemfile
228
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
229
+ # Rails 4.0 (JRuby 9K) :
230
+ - rvm: jruby-head
231
+ gemfile: gemfiles/rails40.gemfile
232
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
233
+ - rvm: jruby-head
234
+ gemfile: gemfiles/rails40.gemfile
235
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
236
+ - rvm: jruby-head
237
+ gemfile: gemfiles/rails40.gemfile
238
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
239
+ - rvm: jruby-head
240
+ gemfile: gemfiles/rails40.gemfile
241
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
242
+ - rvm: jruby-head
243
+ gemfile: gemfiles/rails40.gemfile
244
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
245
+ - rvm: jruby-head
246
+ gemfile: gemfiles/rails40.gemfile
247
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
248
+ - rvm: jruby-head
249
+ gemfile: gemfiles/rails40.gemfile
250
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
251
+ - rvm: jruby-head
252
+ gemfile: gemfiles/rails40.gemfile
253
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
254
+ # Rails 4.1 (JRuby 9K) :
255
+ - rvm: jruby-head
256
+ gemfile: gemfiles/rails41.gemfile
257
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
258
+ - rvm: jruby-head
259
+ gemfile: gemfiles/rails41.gemfile
260
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
261
+ - rvm: jruby-head
262
+ gemfile: gemfiles/rails41.gemfile
263
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
264
+ - rvm: jruby-1.7.18
265
+ gemfile: gemfiles/rails41.gemfile
266
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
267
+ - rvm: jruby-1.7.18
268
+ gemfile: gemfiles/rails41.gemfile
269
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
270
+ - rvm: jruby-1.7.18
271
+ gemfile: gemfiles/rails41.gemfile
272
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
273
+ - rvm: jruby-1.7.18
274
+ gemfile: gemfiles/rails41.gemfile
275
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
276
+ - rvm: jruby-1.7.18
277
+ gemfile: gemfiles/rails41.gemfile
278
+ env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
279
+ # Rails 4.2 (JRuby 9K) :
280
+ - rvm: jruby-head
102
281
  gemfile: gemfiles/rails42.gemfile
103
282
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=mysql
104
- - rvm: jruby
283
+ - rvm: jruby-head
105
284
  gemfile: gemfiles/rails42.gemfile
106
285
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=postgresql
107
- - rvm: jruby
286
+ - rvm: jruby-head
108
287
  gemfile: gemfiles/rails42.gemfile
109
288
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=sqlite3
110
- - rvm: jruby
289
+ - rvm: jruby-head
111
290
  gemfile: gemfiles/rails42.gemfile
112
291
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=derby
113
- - rvm: jruby
292
+ - rvm: jruby-head
114
293
  gemfile: gemfiles/rails42.gemfile
115
294
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=h2
116
- - rvm: jruby
295
+ - rvm: jruby-head
117
296
  gemfile: gemfiles/rails42.gemfile
118
297
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=hsqldb
119
- - rvm: jruby
298
+ - rvm: jruby-head
120
299
  gemfile: gemfiles/rails42.gemfile
121
300
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jndi
122
- - rvm: jruby
301
+ - rvm: jruby-head
123
302
  gemfile: gemfiles/rails42.gemfile
124
303
  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS" DB=jdbc
data/Appraisals CHANGED
@@ -16,22 +16,20 @@ appraise "rails32" do
16
16
  end
17
17
 
18
18
  appraise "rails40" do
19
- # NOTE: make sure you're using --1.9 with AR-4.0
20
- gem "activerecord", "~> 4.0.10", :require => false
19
+ gem "activerecord", "~> 4.0.12", :require => false
21
20
  end
22
21
 
23
22
  appraise "rails41" do
24
- # NOTE: make sure you're using --1.9 with AR-4.0
25
- gem "activerecord", "~> 4.1.7", :require => false
23
+ gem "activerecord", "~> 4.1.8", :require => false
26
24
  end
27
25
 
28
26
  appraise "rails42" do
29
- # NOTE: make sure you're using --1.9 with AR-4.0
30
- if branch = ( ENV['rails_branch'] || 'master' )
31
- gem "activerecord", :github => 'rails/rails', :branch => branch, :require => false
32
- gem 'rails', :github => 'rails/rails', :branch => branch
33
- gem 'arel', :github => 'rails/arel', :branch => 'master'
34
- else
35
- # gem "activerecord", '4.2.0.rc1', :require => false
36
- end
27
+ gem "activerecord", "~> 4.2.0", :require => false
28
+ end
29
+
30
+ appraise "railsNG" do
31
+ branch = ( ENV['rails_branch'] || 'master' )
32
+ gem "activerecord", :github => 'rails/rails', :branch => branch, :require => false
33
+ gem 'rails', :github => 'rails/rails', :branch => branch
34
+ gem 'arel', :github => 'rails/arel', :branch => 'master'
37
35
  end
data/History.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 1.3.14 (01/28/15)
2
+
3
+ - [mysql] Fixed an undefined exception error in type_to_sql for MySQL (#616)
4
+ - [derby] support for empty insert statements (e.g. `DbModel.create!`) on AR 4.x
5
+ - [db2] revert limit/offset OVER( ORDER BY ) matching as it was not complete (#606)
6
+ - [db2] handle empty INSERT statement (default) VALUES in a way that works on AR 4.x
7
+ - [db2] `select` return value should be the same as core AR (Array on 3.2) (#607)
8
+ - [mysql] backport bulk change & schema-creation to be compatible with AR 4.x
9
+ - handle possible null values while extracting from XML columns (#615)
10
+ - DateTime columns are returned always as nil values (on Rails 4.2 #613)
11
+ - [oracle] do not override primary= within column methods on AR 4.2
12
+ - handle removed AR `Column#primary=` method on 4.2 (#609)
13
+ - [oracle] fix missing sequence_name_length method when doing a rename_table
14
+ - [mysql] do not force *DEFAULT CHARSET=utf8* when creating new tables
15
+ - [postgres] rename the primary key index when renaming a table in pg
16
+ - [db2] improve create_table on Z/OS (now supporting AR 4.x TableDefinition) (#581)
17
+
1
18
  ## 1.3.13 (11/21/14)
2
19
 
3
20
  - handle ("hacked") date/time/timestamp conversion from the JDBC side on 4.2
@@ -10,11 +10,34 @@ module Arel
10
10
  add_limit_offset(sql, o)
11
11
  end
12
12
 
13
+ def visit_Arel_Nodes_InsertStatement o, a = nil
14
+ sql = "INSERT INTO "
15
+ sql << visit(o.relation, a)
16
+
17
+ values = o.values
18
+
19
+ if o.columns.any?
20
+ cols = o.columns.map { |x| quote_column_name x.name }
21
+ sql << ' (' << cols.join(', ') << ') '
22
+ # should depend the other way around but who cares it's AR
23
+ elsif o.values.eql? ArJdbc::DB2::VALUES_DEFAULT
24
+ cols = o.relation.engine.columns.map { |c| c.name }
25
+ sql << ' (' << cols.join(', ') << ')'
26
+ sql << ' VALUES '
27
+ sql << ' (' << cols.map { 'DEFAULT' }.join(', ') << ')'
28
+ values = nil
29
+ end
30
+
31
+ sql << visit(values, a) if values
32
+
33
+ sql
34
+ end if Arel::VERSION >= '4.0' # AR 4.0 ... AREL 5.0 since AR >= 4.1
35
+
13
36
  private
14
37
 
15
38
  def add_limit_offset(sql, o)
16
39
  if o.offset && o.offset.value && o.limit && o.limit.value
17
- @connection.replace_limit_offset_for_arel! o, sql
40
+ @connection.replace_limit_offset_with_ordering! sql, o.limit.value, o.offset.value, o.orders
18
41
  else
19
42
  @connection.replace_limit_offset! sql, limit_for(o.limit), o.offset && o.offset.value
20
43
  end
@@ -28,6 +28,30 @@ module Arel
28
28
  do_visit o.expr, a
29
29
  end
30
30
 
31
+ # @private
32
+ VALUES_DEFAULT = 'VALUES ( DEFAULT )' # NOTE: marker set by ArJdbc::Derby
33
+
34
+ def visit_Arel_Nodes_InsertStatement o, a = nil
35
+ sql = "INSERT INTO "
36
+ sql << visit(o.relation, a)
37
+
38
+ values = o.values
39
+
40
+ if o.columns.any?
41
+ cols = o.columns.map { |x| quote_column_name x.name }
42
+ sql << ' (' << cols.join(', ') << ') '
43
+ elsif o.values.eql? VALUES_DEFAULT
44
+ cols = o.relation.engine.columns.map { |c| c.name }
45
+ sql << ' (' << cols.join(', ') << ')'
46
+ sql << ' VALUES '
47
+ sql << ' (' << cols.map { 'DEFAULT' }.join(', ') << ')'
48
+ values = false
49
+ end
50
+
51
+ sql << visit(values, a) if values
52
+ sql
53
+ end if Arel::VERSION >= '4.0' # AR 4.0 ... AREL 5.0 since AR >= 4.1
54
+
31
55
  end
32
56
  end
33
57
  end
@@ -17,3 +17,9 @@ else
17
17
  end
18
18
 
19
19
  require 'arjdbc/version'
20
+
21
+ # TODO: remove this "HINT" once AR 4.2 is working ~ fairly reliable :
22
+ if ActiveRecord::VERSION::STRING[0, 3] == '4.2' && ENV['AR_JDBC_42'] != 'true'
23
+ ArJdbc.warn "NOTE: ActiveRecord 4.2 is not (yet) fully supported by AR-JDBC," <<
24
+ " please help us finish 4.2 support - check http://bit.ly/jruby-42 for starters"
25
+ end