public
Fork of nicksieger/activerecord-jdbc-adapter
Description: ActiveRecord adapter for JDBC and JRuby
Homepage: http://jruby-extras.rubyforge.org/activerecord-jdbc-adapter
Clone URL: git://github.com/abedra/activerecord-jdbc-adapter.git
merging updates from nicksieger
abedra (author)
Tue Jul 15 07:19:04 -0700 2008
commit  ea6501552626c443b4b832d9f31e37a3a671225a
tree    01d7a74da9060710862be03b31010540703e8f06
parent  85ce028c147172a6fd3f1127d3b96f077f720546
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
0
@@ -1,3 +1,35 @@
0
+== 0.8.2
0
+
0
+- Added an optional config key called :dialect. Using :dialect allows you to
0
+ override the default SQL dialect for the driver class being used. There are
0
+ a few cases for this:
0
+ - Using using Sybase w/ the jTDS driver.
0
+ - Using rebranded drivers.
0
+ - It makes more sense to use :dialect, rather then :driver when using JNDI.
0
+- JRUBY-2619: Typo with :test config causing problems with dev database (Igor Minar)
0
+- 20524, JRUBY-2612: Since when did I think that there was a #true? method on Object?
0
+
0
+== 0.8.1
0
+
0
+- Now sporting a JDBC sqlite3 adapter! Thanks Joseph Athman.
0
+- Added support for InterSystems Cache database (Ryan Bell)
0
+- Fix for JRUBY-2256
0
+- JRUBY-1638, JRUBY-2404, JRUBY-2463: schema.table handling and Oracle NUMBER fixes (Darcy Schultz & Jesse Hu)
0
+- Add structure dump and other DDL-ish for DB2 (courtesy abedra and stuarthalloway)
0
+- Fix missing quote_table_name function under Rails 1.2.6 and earlier
0
+- Small tweaks to jdbc.rake to select proper config
0
+- JRUBY-2011: Fix MSSQL string un-quoting issue (Silvio Fonseca)
0
+- JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
0
+- 20479: Improve get_table_name for MSSQL (Aslak Hellesøy)
0
+- 20243: numerics improvements for MSSQL (Aslak Hellesøy)
0
+- 20172: don't quote table names for MSSQL (Thor Marius Henrichsen)
0
+- 19729: check for primary key existence in postgres during insert (Martin Luder)
0
+- JRUBY-2297, 18846: retrying failing SQL statements is harmful when not autocommitting (Craig McMillan)
0
+- 10021: very preliminary sybase support. (Mark Atkinson) Not usable until collision w/ sqlserver driver is resolved.
0
+- JRUBY-2312, JRUBY-2319, JRUBY-2322: Oracle timestamping issues (Jesse Hu & Michael König)
0
+- JRUBY-2422: Fix MySQL referential integrity and rollback issues
0
+- JRUBY-2382: mysql string quoting fails with ArrayIndexOutofBoundsException
0
+
0
 == 0.8
0
 
0
 - NOTE: This release is only compatible with JRuby 1.1RC3 or later.
...
26
27
28
 
29
30
31
...
26
27
28
29
30
31
32
0
@@ -26,6 +26,7 @@ What's there, and what is not there:
0
   * rename_column
0
 * HSQLDB - Complete
0
 * H2 - Complete
0
+* SQLite3 - work in progress
0
 
0
 Other databases will require testing and likely a custom configuration module. Please join the jruby-extras mailing-list[http://rubyforge.org/mail/?group_id=2014] to help us discover support for more databases.
0
 
...
5
6
7
8
 
 
 
9
10
11
12
13
14
15
 
16
17
18
...
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
45
46
47
...
85
86
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
89
90
...
159
160
161
 
 
 
...
5
6
7
 
8
9
10
11
12
13
14
15
16
 
17
18
19
20
...
27
28
29
 
 
 
 
 
 
 
 
 
 
30
31
32
33
34
35
 
36
37
38
39
...
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
168
169
170
171
172
173
0
@@ -5,14 +5,16 @@ task :default => [:java_compile, :test]
0
 
0
 def java_classpath_arg # myriad of ways to discover JRuby classpath
0
   begin
0
- jruby_cpath = Java::java.lang.System.getProperty('java.class.path')
0
+ cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
0
+ cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
0
+ jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
0
   rescue => e
0
   end
0
   unless jruby_cpath
0
     jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
0
       FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
0
   end
0
- jruby_cpath ? "-cp #{jruby_cpath}" : ""
0
+ jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
0
 end
0
 
0
 desc "Compile the native Java code."
0
@@ -25,23 +27,13 @@ task :java_compile do
0
 end
0
 file "lib/jdbc_adapter/jdbc_adapter_internal.jar" => :java_compile
0
 
0
-task :more_clean do
0
- rm_rf FileList['derby*']
0
- rm_rf FileList['test.db.*']
0
- rm_rf "test/reports"
0
- rm_f FileList['lib/**/*.jar']
0
- rm_f "manifest.mf"
0
-end
0
-
0
-task :clean => :more_clean
0
-
0
 task :filelist do
0
   puts FileList['pkg/**/*'].inspect
0
 end
0
 
0
 if RUBY_PLATFORM =~ /java/
0
   # TODO: add more databases into the standard tests here.
0
- task :test => [:test_mysql, :test_jdbc, :test_derby, :test_hsqldb, :test_h2]
0
+ task :test => [:test_mysql, :test_jdbc, :test_derby, :test_hsqldb, :test_h2, :test_sqlite3]
0
 else
0
   task :test => [:test_mysql]
0
 end
0
@@ -85,6 +77,23 @@ Rake::TestTask.new(:test_db2) do |t|
0
   t.libs << 'test'
0
 end
0
 
0
+# Ensure InterSystems CacheDB driver is on your classpath before launching rake
0
+Rake::TestTask.new(:test_cachedb) do | t |
0
+ t.test_files = FileList[ 'test/cachedb_simple_test.rb' ]
0
+ t.libs << 'test'
0
+end
0
+
0
+# Ensure that the jTDS driver in on your classpath before launching rake
0
+Rake::TestTask.new(:test_mssql) do | t |
0
+ t.test_files = FileList[ 'test/mssql_simple_test.rb' ]
0
+ t.libs << 'test'
0
+end
0
+
0
+# Tests for JDBC adapters that don't require a database.
0
+Rake::TestTask.new(:test_jdbc_adapters) do | t |
0
+ t.test_files = FileList[ 'test/jdbc_adapter/jdbc_sybase_test.rb' ]
0
+ t.libs << 'test'
0
+end
0
 
0
 MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt",
0
   "Rakefile", "LICENSE.txt", "lib/**/*.rb", "lib/jdbc_adapter/jdbc_adapter_internal.jar", "test/**/*.rb",
0
@@ -159,3 +168,6 @@ end
0
     task "all:release" => "#{prefix}:release"
0
   end
0
 end
0
+
0
+require 'rake/clean'
0
+CLEAN.include 'derby*', 'test.db.*','test/reports', 'test.sqlite3','lib/**/*.jar','manifest.mf'
...
135
136
137
 
138
139
140
...
146
147
148
149
 
 
150
151
152
153
 
 
154
155
156
 
 
157
158
159
 
 
160
161
162
...
166
167
168
169
 
 
170
171
172
...
263
264
265
266
 
267
268
 
269
270
271
...
414
415
416
 
 
 
 
 
 
 
 
 
 
417
418
 
419
420
421
...
428
429
430
431
 
432
433
 
434
435
436
...
135
136
137
138
139
140
141
...
147
148
149
 
150
151
152
153
154
 
155
156
157
158
 
159
160
161
162
 
163
164
165
166
167
...
171
172
173
 
174
175
176
177
178
...
269
270
271
 
272
273
 
274
275
276
277
...
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
...
445
446
447
 
448
449
 
450
451
452
453
0
@@ -135,6 +135,7 @@ module ActiveRecord
0
                           lambda {|r| r['type_name'] =~ /^decimal$/i},
0
                           lambda {|r| r['type_name'] =~ /^numeric$/i},
0
                           lambda {|r| r['type_name'] =~ /^number$/i},
0
+ lambda {|r| r['type_name'] =~ /^real$/i},
0
                           lambda {|r| r['precision'] == '38'},
0
                           lambda {|r| r['data_type'] == '2'}],
0
         :float => [ lambda {|r| [Jdbc::Types::FLOAT,Jdbc::Types::DOUBLE, Jdbc::Types::REAL].include?(r['data_type'].to_i)},
0
@@ -146,17 +147,21 @@ module ActiveRecord
0
         :datetime => [ lambda {|r| Jdbc::Types::TIMESTAMP == r['data_type'].to_i},
0
                           lambda {|r| r['type_name'] =~ /^datetime$/i},
0
                           lambda {|r| r['type_name'] =~ /^timestamp$/i},
0
- lambda {|r| r['type_name'] =~ /^date/i}],
0
+ lambda {|r| r['type_name'] =~ /^date/i},
0
+ lambda {|r| r['type_name'] =~ /^integer/i}], #Num of milliseconds for SQLite3 JDBC Driver
0
         :timestamp => [ lambda {|r| Jdbc::Types::TIMESTAMP == r['data_type'].to_i},
0
                           lambda {|r| r['type_name'] =~ /^timestamp$/i},
0
                           lambda {|r| r['type_name'] =~ /^datetime/i},
0
- lambda {|r| r['type_name'] =~ /^date/i}],
0
+ lambda {|r| r['type_name'] =~ /^date/i},
0
+ lambda {|r| r['type_name'] =~ /^integer/i}], #Num of milliseconds for SQLite3 JDBC Driver
0
         :time => [ lambda {|r| Jdbc::Types::TIME == r['data_type'].to_i},
0
                           lambda {|r| r['type_name'] =~ /^time$/i},
0
- lambda {|r| r['type_name'] =~ /^date/i}],
0
+ lambda {|r| r['type_name'] =~ /^date/i},
0
+ lambda {|r| r['type_name'] =~ /^integer/i}], #Num of milliseconds for SQLite3 JDBC Driver
0
         :date => [ lambda {|r| Jdbc::Types::DATE == r['data_type'].to_i},
0
                           lambda {|r| r['type_name'] =~ /^date$/i},
0
- lambda {|r| r['type_name'] =~ /^date/i}],
0
+ lambda {|r| r['type_name'] =~ /^date/i},
0
+ lambda {|r| r['type_name'] =~ /^integer/i}], #Num of milliseconds for SQLite3 JDBC Driver3
0
         :binary => [ lambda {|r| [Jdbc::Types::LONGVARBINARY,Jdbc::Types::BINARY,Jdbc::Types::BLOB].include?(r['data_type'].to_i)},
0
                           lambda {|r| r['type_name'] =~ /^blob/i},
0
                           lambda {|r| r['type_name'] =~ /sub_type 0$/i}, # For FireBird
0
@@ -166,7 +171,8 @@ module ActiveRecord
0
                           lambda {|r| r['type_name'] =~ /^bool/i},
0
                           lambda {|r| r['data_type'] == '-7'},
0
                           lambda {|r| r['type_name'] =~ /^tinyint$/i},
0
- lambda {|r| r['type_name'] =~ /^decimal$/i}]
0
+ lambda {|r| r['type_name'] =~ /^decimal$/i},
0
+ lambda {|r| r['type_name'] =~ /^integer$/i}]
0
       }
0
 
0
       def initialize(types)
0
@@ -263,9 +269,9 @@ module ActiveRecord
0
         h[val[0]] = val[1]; h }
0
 
0
       def initialize(config, name, default, *args)
0
- ds = config[:driver].to_s
0
+ dialect = config[:dialect] || config[:driver]
0
         for reg, func in COLUMN_TYPES
0
- if reg === ds
0
+ if reg === dialect.to_s
0
             func.call(config,self)
0
           end
0
         end
0
@@ -414,8 +420,19 @@ module ActiveRecord
0
       end
0
     end
0
 
0
+ module CompatibilityMethods
0
+ def self.needed?(base)
0
+ !base.instance_methods.include?("quote_table_name")
0
+ end
0
+
0
+ def quote_table_name(name)
0
+ quote_column_name(name)
0
+ end
0
+ end
0
+
0
     class JdbcAdapter < AbstractAdapter
0
       extend ShadowCoreMethods
0
+ include CompatibilityMethods if CompatibilityMethods.needed?(self)
0
 
0
       attr_reader :config
0
 
0
@@ -428,9 +445,9 @@ module ActiveRecord
0
       def initialize(connection, logger, config)
0
         super(connection, logger)
0
         @config = config
0
- ds = config[:driver].to_s
0
+ dialect = config[:dialect] || config[:driver]
0
         for reg, func in ADAPTER_TYPES
0
- if reg === ds
0
+ if reg === dialect.to_s
0
             func.call(@config,self)
0
           end
0
         end
...
8
9
10
 
 
 
...
8
9
10
11
12
13
0
@@ -8,3 +8,6 @@ require 'jdbc_adapter/jdbc_derby'
0
 require 'jdbc_adapter/jdbc_firebird'
0
 require 'jdbc_adapter/jdbc_db2'
0
 require 'jdbc_adapter/jdbc_mssql'
0
+require 'jdbc_adapter/jdbc_cachedb'
0
+require 'jdbc_adapter/jdbc_sqlite3'
0
+require 'jdbc_adapter/jdbc_sybase'
...
10
11
12
13
 
14
15
16
...
60
61
62
 
63
64
65
66
 
67
68
69
...
72
73
74
75
 
76
77
78
...
10
11
12
 
13
14
15
16
...
60
61
62
63
64
65
66
 
67
68
69
70
...
73
74
75
 
76
77
78
79
0
@@ -10,7 +10,7 @@ def redefine_task(*args, &block)
0
 end
0
 
0
 namespace :db do
0
- if respond_to?(:create_database)
0
+ if Rake::Task["db:create"]
0
     redefine_task :create => :environment do
0
       create_database(ActiveRecord::Base.configurations[RAILS_ENV])
0
     end
0
@@ -60,10 +60,11 @@ namespace :db do
0
       end
0
     end
0
   end
0
+
0
   namespace :test do
0
     redefine_task :clone_structure => [ "db:structure:dump", "db:test:purge" ] do
0
       abcs = ActiveRecord::Base.configurations
0
- ActiveRecord::Base.establish_connection(:test)
0
+ ActiveRecord::Base.establish_connection(abcs["test"])
0
       ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0') if abcs["test"]["adapter"] =~ /mysql/i
0
       IO.readlines("db/#{RAILS_ENV}_structure.sql").join.split(";\n\n").each do |ddl|
0
         ActiveRecord::Base.connection.execute(ddl)
0
@@ -72,7 +73,7 @@ namespace :db do
0
 
0
     redefine_task :purge => :environment do
0
       abcs = ActiveRecord::Base.configurations
0
- ActiveRecord::Base.establish_connection(:test)
0
+ ActiveRecord::Base.establish_connection(abcs["test"])
0
       db = ActiveRecord::Base.connection.database_name
0
       ActiveRecord::Base.connection.recreate_database(db)
0
     end
...
7
8
9
10
 
11
12
13
...
17
18
19
20
 
21
22
23
 
24
25
26
...
32
33
34
35
 
36
37
38
...
46
47
48
49
 
50
51
52
53
54
 
55
56
57
...
71
72
73
74
 
75
76
77
78
79
80
81
 
82
83
84
...
86
87
88
89
 
 
 
 
 
 
 
 
90
91
92
...
94
95
96
97
 
98
99
 
100
101
102
...
105
106
107
108
 
109
110
111
...
117
118
119
120
 
121
122
123
...
129
130
131
132
 
133
134
135
...
140
141
142
143
 
144
145
146
...
224
225
226
227
 
228
229
 
230
231
232
...
244
245
246
247
 
248
249
250
251
252
 
 
253
254
 
255
256
257
...
259
260
261
262
 
263
264
 
265
266
267
268
269
270
271
 
272
273
274
275
276
277
278
 
279
280
281
...
285
286
287
288
 
289
290
291
...
338
339
340
341
 
342
343
344
...
364
365
366
367
 
368
369
370
...
7
8
9
 
10
11
12
13
...
17
18
19
 
20
21
22
 
23
24
25
26
...
32
33
34
 
35
36
37
38
...
46
47
48
 
49
50
51
52
53
 
54
55
56
57
...
71
72
73
 
74
75
76
77
78
79
80
 
81
82
83
84
...
86
87
88
 
89
90
91
92
93
94
95
96
97
98
99
...
101
102
103
 
104
105
 
106
107
108
109
...
112
113
114
 
115
116
117
118
...
124
125
126
 
127
128
129
130
...
136
137
138
 
139
140
141
142
...
147
148
149
 
150
151
152
153
...
231
232
233
 
234
235
 
236
237
238
239
...
251
252
253
 
254
255
256
257
 
 
258
259
260
 
261
262
263
264
...
266
267
268
 
269
270
 
271
272
273
274
275
276
277
 
278
279
280
281
282
283
284
 
285
286
287
288
...
292
293
294
 
295
296
297
298
...
345
346
347
 
348
349
350
351
...
371
372
373
 
374
375
376
377
0
@@ -7,7 +7,7 @@ module ::JdbcSpec
0
       config[:driver] ||= "org.apache.derby.jdbc.EmbeddedDriver"
0
       embedded_driver(config)
0
     end
0
- end
0
+ end
0
 
0
   module Derby
0
     def self.column_selector
0
@@ -17,10 +17,10 @@ module ::JdbcSpec
0
     def self.adapter_selector
0
       [/derby/i, lambda {|cfg,adapt| adapt.extend(::JdbcSpec::Derby)}]
0
     end
0
-
0
+
0
     def self.monkey_rails
0
       unless @already_monkeyd
0
- # Needed because Rails is broken wrt to quoting of
0
+ # Needed because Rails is broken wrt to quoting of
0
         # some values. Most databases are nice about it,
0
         # but not Derby. The real issue is that you can't
0
         # compare a CHAR value to a NUMBER column.
0
@@ -32,7 +32,7 @@ module ::JdbcSpec
0
                                   construct_finder_sql_for_association_limiting(options, join_dependency),
0
                                   "#{name} Load IDs For Limited Eager Loading"
0
                                   ).collect { |row| connection.quote(row[primary_key], columns_hash[primary_key]) }.join(", ")
0
- end
0
+ end
0
         end
0
 
0
         @already_monkeyd = true
0
@@ -46,12 +46,12 @@ module ::JdbcSpec
0
     def self.included(*args)
0
       monkey_rails
0
     end
0
-
0
+
0
     module Column
0
       def value_to_binary(value)
0
         value.scan(/[0-9A-Fa-f]{2}/).collect {|v| v.to_i(16)}.pack("C*")
0
       end
0
-
0
+
0
       def cast_to_date_or_time(value)
0
         return value if value.is_a? Date
0
         return nil if value.blank?
0
@@ -71,14 +71,14 @@ module ::JdbcSpec
0
       end
0
 
0
       def simplified_type(field_type)
0
- return :boolean if field_type =~ /smallint/i
0
+ return :boolean if field_type =~ /smallint/i
0
         return :float if field_type =~ /real/i
0
         super
0
       end
0
     end
0
 
0
     include JdbcSpec::MissingFunctionalityHelper
0
-
0
+
0
     def modify_types(tp)
0
       tp[:primary_key] = "int generated by default as identity NOT NULL PRIMARY KEY"
0
       tp[:integer][:limit] = nil
0
@@ -86,7 +86,14 @@ module ::JdbcSpec
0
       tp[:boolean] = {:name => "smallint"}
0
       tp
0
     end
0
-
0
+
0
+ # Override default -- fix case where ActiveRecord passes :default => nil, :null => true
0
+ def add_column_options!(sql, options)
0
+ options.delete(:default) if options.has_key?(:default) && options[:default].nil?
0
+ options.delete(:null) if options.has_key?(:null) && (options[:null].nil? || options[:null] == true)
0
+ super
0
+ end
0
+
0
     def classes_for_table_name(table)
0
       ActiveRecord::Base.send(:subclasses).select {|klass| klass.table_name == table}
0
     end
0
@@ -94,9 +101,9 @@ module ::JdbcSpec
0
     # Set the sequence to the max value of the table's column.
0
     def reset_sequence!(table, column, sequence = nil)
0
       mpk = select_value("SELECT MAX(#{quote_column_name column}) FROM #{table}")
0
- execute("ALTER TABLE #{table} ALTER COLUMN #{quote_column_name column} RESTART WITH #{mpk.to_i + 1}")
0
+ execute("ALTER TABLE #{table} ALTER COLUMN #{quote_column_name column} RESTART WITH #{mpk.to_i + 1}")
0
     end
0
-
0
+
0
     def reset_pk_sequence!(table, pk = nil, sequence = nil)
0
       klasses = classes_for_table_name(table)
0
       klass = klasses.nil? ? nil : klasses.first
0
@@ -105,7 +112,7 @@ module ::JdbcSpec
0
         reset_sequence!(klass.table_name, pk)
0
       end
0
     end
0
-
0
+
0
     def primary_key(table_name) #:nodoc:
0
       primary_keys(table_name).first
0
     end
0
@@ -117,7 +124,7 @@ module ::JdbcSpec
0
     def rename_table(name, new_name)
0
       execute "RENAME TABLE #{name} TO #{new_name}"
0
     end
0
-
0
+
0
     COLUMN_INFO_STMT = "SELECT C.COLUMNNAME, C.REFERENCEID, C.COLUMNNUMBER FROM SYS.SYSCOLUMNS C, SYS.SYSTABLES T WHERE T.TABLEID = '%s' AND T.TABLEID = C.REFERENCEID ORDER BY C.COLUMNNUMBER"
0
 
0
     COLUMN_TYPE_STMT = "SELECT COLUMNDATATYPE, COLUMNDEFAULT FROM SYS.SYSCOLUMNS WHERE REFERENCEID = '%s' AND COLUMNNAME = '%s'"
0
@@ -129,7 +136,7 @@ module ::JdbcSpec
0
       return name unless name
0
       %Q{"#{name}"}
0
     end
0
-
0
+
0
     def strip_quotes(str)
0
       return str unless str
0
       return str unless /^(["']).*\1$/ =~ str
0
@@ -140,7 +147,7 @@ module ::JdbcSpec
0
       return name unless name && name['"']
0
       name.gsub(/"/,'""')
0
     end
0
-
0
+
0
     def reinstate_auto_increment(name, refid, coldef)
0
       stmt = AUTO_INC_STMT % [refid, strip_quotes(name)]
0
       data = execute(stmt).first
0
@@ -224,9 +231,9 @@ module ::JdbcSpec
0
       end
0
       coldef
0
     end
0
-
0
+
0
     SIZEABLE = %w(VARCHAR CLOB BLOB)
0
-
0
+
0
     def structure_dump #:nodoc:
0
       definition=""
0
       rs = @connection.connection.meta_data.getTables(nil,nil,nil,["TABLE"].to_java(:string))
0
@@ -244,14 +251,14 @@ module ::JdbcSpec
0
           elsif d1
0
             default = " DEFAULT #{d1}"
0
           end
0
-
0
+
0
           type = rs2.getString(6)
0
           col_size = rs2.getString(7)
0
           nulling = (rs2.getString(18) == 'NO' ? " NOT NULL" : "")
0
- create_col_string = add_quotes(expand_double_quotes(strip_quotes(col_name))) +
0
- " " +
0
+ create_col_string = add_quotes(expand_double_quotes(strip_quotes(col_name))) +
0
+ " " +
0
             type +
0
- (SIZEABLE.include?(type) ? "(#{col_size})" : "") +
0
+ (SIZEABLE.include?(type) ? "(#{col_size})" : "") +
0
             nulling +
0
             default
0
           if !first_col
0
@@ -259,23 +266,23 @@ module ::JdbcSpec
0
           else
0
             create_col_string = " #{create_col_string}"
0
           end
0
-
0
+
0
           definition << create_col_string
0
-
0
+
0
           first_col = false
0
         end
0
         definition << ");\n\n"
0
       end
0
       definition
0
     end
0
-
0
+
0
     # Support for removing columns added via derby bug issue:
0
     # https://issues.apache.org/jira/browse/DERBY-1489
0
     #
0
     # This feature has not made it into a formal release and is not in Java 6.
0
     # If the normal strategy fails we fall back on a strategy by creating a new
0
     # table without the new column and there after moving the data to the new
0
- #
0
+ #
0
     def remove_column(table_name, column_name)
0
       begin
0
         execute "ALTER TABLE #{table_name} DROP COLUMN #{column_name} RESTRICT"
0
@@ -285,7 +292,7 @@ module ::JdbcSpec
0
         end
0
       end
0
     end
0
-
0
+
0
     # Notes about changing in Derby:
0
     # http://db.apache.org/derby/docs/10.2/ref/rrefsqlj81859.html#rrefsqlj81859__rrefsqlj37860)
0
     #
0
@@ -338,7 +345,7 @@ module ::JdbcSpec
0
         alter_table(table_name, :rename => {column_name => new_column_name})
0
       end
0
     end
0
-
0
+
0
     def primary_keys(table_name)
0
       @connection.primary_keys table_name.to_s.upcase
0
     end
0
@@ -364,7 +371,7 @@ module ::JdbcSpec
0
         name
0
       end
0
     end
0
-
0
+
0
     def quoted_true
0
       '1'
0
     end