ibm_db 2.5.12 → 2.5.14a

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 20e6030d874bf2e641312aacdfa89f43bcfd3083
4
+ data.tar.gz: 09c56bf870da5f872d4df7a7d2b9b5aa26e9e48d
5
+ SHA512:
6
+ metadata.gz: fff0a2fed8dfbc4c76dad9159c479dc60e255a0d926fdbf0db01c31148d9cc48141a618169b448e5b2e59632c414e7f82b7204a04261feed5a366574e308cba2
7
+ data.tar.gz: d9d1c2a37ebd1cfb6e294a3edefaf40244fa5f0c478a13adadf9bca3bf71b993103246b6952b0be9a037c0b492a45eb80ad912b39c9a537b0430a97e63c60b81
data/CHANGES CHANGED
@@ -1,8 +1,12 @@
1
1
  Change Log
2
2
  ==============
3
+ 2014/02/11 (IBM_DB adapter 2.5.14, driver 2.5.14) :
4
+ - Support for Rails 4
5
+ - Support for ruby-2.0
6
+
3
7
  2014/01/28 (IBM_DB adapter 2.5.12, driver 2.5.11) :
4
8
  - Supporting usage of name ibmdb as adapter along with current name ibm_db to support requirements of cloud environments
5
-
9
+
6
10
  2012/12/07 (IBM_DB adapter 2.5.11, driver 2.5.11) :
7
11
  - Fixed bug #29633 - Deletes cause too many handles to be consumed and not freed
8
12
  - Support for Mac OS CLI library loading to check create and drop db functionality - #29625
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
  =====================================================================
2
- README for the IBM_DB Adapter (2.5.12) and Driver (2.5.11) (2014/01/28)
2
+ README for the IBM_DB Adapter (2.5.14) and Driver (2.5.14) (2014/02/11)
3
3
  For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
4
4
  =====================================================================
5
5
 
@@ -47,7 +47,12 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
47
47
  Installing ri documentation for ibm_db-2.5.9-x86-mingw32...
48
48
  Installing RDoc documentation for ibm_db-2.5.9-x86-mingw32...
49
49
 
50
- Note: The manual step after install if using activerecord version below 2.0:
50
+ Note:
51
+ 1) Currently Ruby-2.0 64-bit version on Windows is not supported as there are issues related to SQL definitions with the mingW compiler
52
+ [Details can be found here https://sourceforge.net/p/mingw/bugs/2041/ ].
53
+ Support will be enabled after the abive reported issue is resolved.
54
+
55
+ 2)The manual step after install if using activerecord version below 2.0:
51
56
  add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
52
57
 
53
58
  2. Linux and Unix platforms:
@@ -61,7 +66,7 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
61
66
  Note: DB2 environment is required while using an arbitrary user account
62
67
  (other than the DB2 install user account)
63
68
  $ . /home/db2inst1/sqllib/db2profile
64
- $ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
69
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
65
70
  $ gem install ibm_db
66
71
  Building native extensions. This could take a while...
67
72
  Successfully installed ibm_db-2.5.9
@@ -109,12 +114,12 @@ here only for reference.
109
114
  $ . /home/db2inst1/sqllib/db2profile
110
115
 
111
116
  - To compile and link with DB2 client libraries:
112
- $ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
117
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
113
118
 
114
119
  Windows platforms:
115
120
  - Set ruby devkit environment:
116
121
  - To compile and link with DB2 client libraries:
117
- $ set IBM_DB_DIR=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
122
+ $ set IBM_DB_HOME=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
118
123
 
119
124
  Build the driver:
120
125
  - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
data/ext/extconf.rb CHANGED
@@ -85,7 +85,7 @@ def crash(str)
85
85
  exit 1
86
86
  end
87
87
 
88
- if( RUBY_VERSION =~ /1.9/)
88
+ if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
89
89
  create_header('gil_release_version')
90
90
  create_header('unicode_support_version')
91
91
  end
data/ext/ibm_db.c CHANGED
@@ -12,7 +12,7 @@
12
12
  +----------------------------------------------------------------------+
13
13
  */
14
14
 
15
- #define MODULE_RELEASE "2.5.11"
15
+ #define MODULE_RELEASE "2.5.14"
16
16
 
17
17
  #ifdef HAVE_CONFIG_H
18
18
  #include "config.h"
@@ -225,6 +225,7 @@ void Init_ibm_db(void) {
225
225
  rb_define_module_function(mDB, "next_result", ibm_db_next_result, -1);
226
226
  rb_define_module_function(mDB, "num_fields", ibm_db_num_fields, -1);
227
227
  rb_define_module_function(mDB, "num_rows", ibm_db_num_rows, -1);
228
+ rb_define_module_function(mDB, "resultCols", ibm_db_result_cols, -1);
228
229
  rb_define_module_function(mDB, "field_name", ibm_db_field_name, -1);
229
230
  rb_define_module_function(mDB, "field_display_size", ibm_db_field_display_size, -1);
230
231
  rb_define_module_function(mDB, "field_num", ibm_db_field_num, -1);
@@ -9964,6 +9965,101 @@ VALUE ibm_db_fetch_row(int argc, VALUE *argv, VALUE self)
9964
9965
 
9965
9966
  return ret_val;
9966
9967
  }
9968
+
9969
+ /* */
9970
+ /*
9971
+ *IBM_DB.resultCols -- Returns an array of column names in a result set
9972
+ *
9973
+ * ===Description
9974
+ * array IBM_DB.resultCols ( resource stmt )
9975
+ *
9976
+ * Returns an array of column names in a result set.
9977
+ *
9978
+ * ===Parameters
9979
+ * stmt
9980
+ * A valid stmt resource containing a result set.
9981
+ *
9982
+ * ===Return Values
9983
+ *
9984
+ * Returns an array of column names in the result set. Raises exception on Error.
9985
+ *
9986
+ */
9987
+ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self) {
9988
+ VALUE stmt = Qnil;
9989
+ VALUE ret_val = Qnil;
9990
+
9991
+ VALUE error = Qnil;
9992
+ VALUE colName = Qnil;
9993
+ VALUE return_value = Qnil;
9994
+
9995
+ stmt_handle *stmt_res = NULL;
9996
+
9997
+ int index = 0;
9998
+
9999
+ rb_scan_args(argc, argv, "1", &stmt);
10000
+
10001
+ if (!NIL_P(stmt)) {
10002
+ Data_Get_Struct(stmt, stmt_handle, stmt_res);
10003
+ } else {
10004
+ rb_warn("Invalid statement resource specified");
10005
+ return Qnil;
10006
+ }
10007
+
10008
+ if ( stmt_res->column_info == NULL ) {
10009
+ if (_ruby_ibm_db_get_result_set_info(stmt_res)<0) {
10010
+ if( stmt_res != NULL && stmt_res->ruby_stmt_err_msg != NULL ) {
10011
+ #ifdef UNICODE_SUPPORT_VERSION
10012
+ error = rb_str_concat( _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: "),
10013
+ _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->ruby_stmt_err_msg,
10014
+ stmt_res->ruby_stmt_err_msg_len)
10015
+ );
10016
+ #else
10017
+ error = rb_str_cat2(rb_str_new2("Column information cannot be retrieved: "), stmt_res->ruby_stmt_err_msg );
10018
+ #endif
10019
+ } else {
10020
+ #ifdef UNICODE_SUPPORT_VERSION
10021
+ error = _ruby_ibm_db_export_char_to_utf8_rstr("Column information cannot be retrieved: <error message could not be retrieved>");
10022
+ #else
10023
+ error = rb_str_new2("Column information cannot be retrieved: <error message could not be retrieved>");
10024
+ #endif
10025
+ }
10026
+ rb_throw( RSTRING_PTR(error), Qnil );
10027
+ }
10028
+ }
10029
+
10030
+ return_value = rb_ary_new();
10031
+
10032
+ for (index=0; index<stmt_res->num_columns; index++) {
10033
+ switch(stmt_res->s_case_mode) {
10034
+ case CASE_LOWER:
10035
+ #ifdef UNICODE_SUPPORT_VERSION
10036
+ strtolower((char*)stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR));
10037
+ #else
10038
+ strtolower((char*)stmt_res->column_info[index].name, strlen((char*)stmt_res->column_info[index].name));
10039
+ #endif
10040
+ break;
10041
+ case CASE_UPPER:
10042
+ #ifdef UNICODE_SUPPORT_VERSION
10043
+ strtoupper((char*)stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR) );
10044
+ #else
10045
+ strtoupper((char*)stmt_res->column_info[index].name, strlen((char*)stmt_res->column_info[index].name));
10046
+ #endif
10047
+ break;
10048
+ case CASE_NATURAL:
10049
+ default:
10050
+ break;
10051
+ }
10052
+ #ifdef UNICODE_SUPPORT_VERSION
10053
+ colName = _ruby_ibm_db_export_sqlwchar_to_utf8_rstr(stmt_res->column_info[index].name, stmt_res->column_info[index].name_length * sizeof(SQLWCHAR) );
10054
+ #else
10055
+ colName = rb_str_new2((char*)stmt_res->column_info[index].name);
10056
+ #endif
10057
+
10058
+ rb_ary_store(return_value, index, colName);
10059
+ }
10060
+
10061
+ return return_value;
10062
+ }
9967
10063
  /* */
9968
10064
 
9969
10065
  /*
data/ext/ruby_ibm_db.h CHANGED
@@ -171,6 +171,7 @@ VALUE ibm_db_stmt_error(int argc, VALUE *argv, VALUE self);
171
171
  VALUE ibm_db_next_result(int argc, VALUE *argv, VALUE self);
172
172
  VALUE ibm_db_num_fields(int argc, VALUE *argv, VALUE self);
173
173
  VALUE ibm_db_num_rows(int argc, VALUE *argv, VALUE self);
174
+ VALUE ibm_db_result_cols(int argc, VALUE *argv, VALUE self);
174
175
  VALUE ibm_db_field_name(int argc, VALUE *argv, VALUE self);
175
176
  VALUE ibm_db_field_display_size(int argc, VALUE *argv, VALUE self);
176
177
  VALUE ibm_db_field_num(int argc, VALUE *argv, VALUE self);
@@ -9,8 +9,54 @@
9
9
  # +----------------------------------------------------------------------+
10
10
 
11
11
  require 'active_record/connection_adapters/abstract_adapter'
12
+ require 'arel/visitors/bind_visitor'
12
13
 
13
14
  module ActiveRecord
15
+ class Relation
16
+ def insert(values)
17
+ primary_key_value = nil
18
+
19
+ if primary_key && Hash === values
20
+ primary_key_value = values[values.keys.find { |k|
21
+ k.name == primary_key
22
+ }]
23
+
24
+ if !primary_key_value && connection.prefetch_primary_key?(klass.table_name)
25
+ primary_key_value = connection.next_sequence_value(klass.sequence_name)
26
+ values[klass.arel_table[klass.primary_key]] = primary_key_value
27
+ end
28
+ end
29
+
30
+ im = arel.create_insert
31
+ im.into @table
32
+
33
+ conn = @klass.connection
34
+
35
+ substitutes = values.sort_by { |arel_attr,_| arel_attr.name }
36
+ binds = substitutes.map do |arel_attr, value|
37
+ [@klass.columns_hash[arel_attr.name], value]
38
+ end
39
+
40
+ substitutes.each_with_index do |tuple, i|
41
+ tuple[1] = conn.substitute_at(binds[i][0], i)
42
+ end
43
+
44
+ if values.empty? # empty insert
45
+ im.values = Arel.sql(connection.empty_insert_statement_value(klass.primary_key))
46
+ else
47
+ im.insert substitutes
48
+ end
49
+
50
+ conn.insert(
51
+ im,
52
+ 'SQL',
53
+ primary_key,
54
+ primary_key_value,
55
+ nil,
56
+ binds)
57
+ end
58
+ end
59
+
14
60
  class Base
15
61
  # Method required to handle LOBs and XML fields.
16
62
  # An after save callback checks if a marker has been inserted through
@@ -116,6 +162,14 @@ module ActiveRecord
116
162
  require 'active_record/connection_adapters/ibm_db_pstmt'
117
163
  end
118
164
 
165
+ # Check if class TableDefinition responds to indexes method to determine if we are on AR 3 or AR 4.
166
+ # This is a interim hack ti ensure backward compatibility. To remove as we move out of AR 3 support or have a better way to determine which version of AR being run against.
167
+ checkClass = ActiveRecord::ConnectionAdapters::TableDefinition.new(nil)
168
+ if(checkClass.respond_to?(:indexes))
169
+ isAr3 = false
170
+ else
171
+ isAr3 = true
172
+ end
119
173
  # Converts all +config+ keys to symbols
120
174
  config = config.symbolize_keys
121
175
 
@@ -135,7 +189,7 @@ module ActiveRecord
135
189
  end
136
190
 
137
191
  if(config.has_key?(:dbops) && config[:dbops] == true)
138
- return ConnectionAdapters::IBM_DBAdapter.new(nil, logger, config, {})
192
+ return ConnectionAdapters::IBM_DBAdapter.new(nil, isAr3, logger, config, {})
139
193
  end
140
194
 
141
195
  # Retrieves the database alias (local catalog name) or remote name
@@ -210,7 +264,7 @@ module ActiveRecord
210
264
  if connection
211
265
  # Creates an instance of *IBM_DBAdapter* based on the +connection+
212
266
  # and credentials provided in +config+
213
- ConnectionAdapters::IBM_DBAdapter.new(connection, logger, config, conn_options)
267
+ ConnectionAdapters::IBM_DBAdapter.new(connection, isAr3, logger, config, conn_options)
214
268
  else
215
269
  # If the connection failure was not caught previoulsy, it raises a Runtime error
216
270
  raise "An unexpected error occured during connect attempt to [#{database}]"
@@ -224,6 +278,11 @@ module ActiveRecord
224
278
  end # class Base
225
279
 
226
280
  module ConnectionAdapters
281
+ module SchemaStatements
282
+ def create_table_definition(name, temporary, options)
283
+ TableDefinition.new self, name, temporary, options
284
+ end
285
+ end
227
286
  class IBM_DBColumn < Column
228
287
 
229
288
  # Casts value (which is a String) to an appropriate instance
@@ -348,7 +407,26 @@ module ActiveRecord
348
407
  end
349
408
 
350
409
  class TableDefinition
351
-
410
+
411
+ def initialize(base, name=nil, temporary=nil, options=nil)
412
+ if(self.respond_to?(:indexes))
413
+ @ar3 = false
414
+ else
415
+ @ar3 = true
416
+ end
417
+ @columns = []
418
+ @columns_hash = {}
419
+ @indexes = {}
420
+ @base = base
421
+ @temporary = temporary
422
+ @options = options
423
+ @name = name
424
+ end
425
+
426
+ def native
427
+ @base.native_database_types
428
+ end
429
+
352
430
  #Method to parse the passed arguments and create the ColumnDefinition object of the specified type
353
431
  def ibm_parse_column_attributes_args(type, *args)
354
432
  options = {}
@@ -405,8 +483,11 @@ module ActiveRecord
405
483
  # the DEFAULT option for the native XML datatype
406
484
  def column(name, type, options ={})
407
485
  # construct a column definition where @base is adaptor instance
408
- column = ColumnDefinition.new(@base, name, type)
409
-
486
+ if(@ar3)
487
+ column = ColumnDefinition.new(@base, name, type)
488
+ else
489
+ column = ColumnDefinition.new(name, type)
490
+ end
410
491
  # DB2 does not accept DEFAULT NULL option for XML
411
492
  # for table create, but does accept nullable option
412
493
  unless type.to_s == 'xml'
@@ -435,9 +516,12 @@ module ActiveRecord
435
516
  column.limit = @base.native_database_types[type.to_sym][:limit] if @base.native_database_types[type.to_sym].has_key? :limit
436
517
  end
437
518
 
438
- unless @columns.include? column
519
+ unless @columns.nil? or @columns.include? column
439
520
  @columns << column
440
521
  end
522
+
523
+ @columns_hash[name] = column
524
+
441
525
  return self
442
526
  end
443
527
  end
@@ -483,9 +567,14 @@ module ActiveRecord
483
567
  'IBM_DB'
484
568
  end
485
569
 
486
- def initialize(connection, logger, config, conn_options)
570
+ class BindSubstitution < Arel::Visitors::IBM_DB # :nodoc:
571
+ include Arel::Visitors::BindVisitor
572
+ end
573
+
574
+ def initialize(connection, ar3, logger, config, conn_options)
487
575
  # Caching database connection configuration (+connect+ or +reconnect+ support)
488
576
  @connection = connection
577
+ @isAr3 = ar3
489
578
  @conn_options = conn_options
490
579
  @database = config[:database]
491
580
  @username = config[:username]
@@ -530,29 +619,29 @@ module ActiveRecord
530
619
  when /DB2\//i # DB2 for Linux, Unix and Windows (LUW)
531
620
  case server_info.DBMS_VER
532
621
  when /09.07/i # DB2 Version 9.7 (Cobra)
533
- @servertype = IBM_DB2_LUW_COBRA.new(self)
622
+ @servertype = IBM_DB2_LUW_COBRA.new(self, isAr3)
534
623
  else # DB2 Version 9.5 or below
535
- @servertype = IBM_DB2_LUW.new(self)
624
+ @servertype = IBM_DB2_LUW.new(self, @isAr3)
536
625
  end
537
626
  when /DB2/i # DB2 for zOS
538
627
  case server_info.DBMS_VER
539
628
  when /09/ # DB2 for zOS version 9 and version 10
540
- @servertype = IBM_DB2_ZOS.new(self)
629
+ @servertype = IBM_DB2_ZOS.new(self, @isAr3)
541
630
  when /10/
542
- @servertype = IBM_DB2_ZOS.new(self)
631
+ @servertype = IBM_DB2_ZOS.new(self, @isAr3)
543
632
  when /08/ # DB2 for zOS version 8
544
- @servertype = IBM_DB2_ZOS_8.new(self)
633
+ @servertype = IBM_DB2_ZOS_8.new(self, @isAr3)
545
634
  else # DB2 for zOS version 7
546
635
  raise "Only DB2 z/OS version 8 and above are currently supported"
547
636
  end
548
637
  when /AS/i # DB2 for i5 (iSeries)
549
- @servertype = IBM_DB2_I5.new(self)
638
+ @servertype = IBM_DB2_I5.new(self, @isAr3)
550
639
  when /IDS/i # Informix Dynamic Server
551
- @servertype = IBM_IDS.new(self)
640
+ @servertype = IBM_IDS.new(self, @isAr3)
552
641
  else
553
642
  log( "server_info", "Forcing servertype to LUW: DBMS name could not be retrieved. Check if your client version is of the right level")
554
643
  warn "Forcing servertype to LUW: DBMS name could not be retrieved. Check if your client version is of the right level"
555
- @servertype = IBM_DB2_LUW.new(self)
644
+ @servertype = IBM_DB2_LUW.new(self, @isAr3)
556
645
  end
557
646
  else
558
647
  error_msg = IBM_DB.getErrormsg( @connection, IBM_DB::DB_CONN )
@@ -870,11 +959,17 @@ module ActiveRecord
870
959
  stmt = exec_query(sql, name, binds)
871
960
  end
872
961
 
962
+ cols = IBM_DB.resultCols(stmt)
963
+
873
964
  if( stmt )
874
965
  results = fetch_data(stmt)
875
966
  end
876
967
 
877
- return results
968
+ if(@isAr3)
969
+ return results
970
+ else
971
+ return ActiveRecord::Result.new(cols, results)
972
+ end
878
973
  end
879
974
 
880
975
  #Returns an array of arrays containing the field values.
@@ -911,11 +1006,11 @@ module ActiveRecord
911
1006
 
912
1007
  # Returns a record hash with the column names as keys and column values
913
1008
  # as values.
914
- def select_one(sql, name = nil)
1009
+ #def select_one(sql, name = nil)
915
1010
  # Gets the first hash from the array of hashes returned by
916
1011
  # select_all
917
- select_all(sql,name).first
918
- end
1012
+ # select_all(sql,name).first
1013
+ #end
919
1014
 
920
1015
  #inserts values from fixtures
921
1016
  #overridden to handle LOB's fixture insertion, as, in normal inserts callbacks are triggered but during fixture insertion callbacks are not triggered
@@ -953,10 +1048,10 @@ module ActiveRecord
953
1048
  col.type.to_sym == :binary
954
1049
  # Add a '?' for the parameter or a NULL if the value is nil or empty
955
1050
  # (except for a CLOB field where '' can be a value)
956
- insert_values << item.at(1)
1051
+ insert_values << quote_value_for_pstmt(item.at(1))
957
1052
  params << '?'
958
1053
  else
959
- insert_values << quote(item.at(1),col)
1054
+ insert_values << quote_value_for_pstmt(item.at(1),col)
960
1055
  params << '?'
961
1056
  end
962
1057
  end
@@ -983,6 +1078,10 @@ module ActiveRecord
983
1078
  end
984
1079
  end
985
1080
 
1081
+ def empty_insert_statement_value(pkey)
1082
+ "(#{pkey}) VALUES (DEFAULT)"
1083
+ end
1084
+
986
1085
  # Perform an insert and returns the last ID generated.
987
1086
  # This can be the ID passed to the method or the one auto-generated by the database,
988
1087
  # and retrieved by the +last_generated_id+ method.
@@ -1892,8 +1991,9 @@ module ActiveRecord
1892
1991
 
1893
1992
  # This class contains common code across DB's (DB2 LUW, zOS, i5 and IDS)
1894
1993
  class IBM_DataServer
1895
- def initialize(adapter)
1994
+ def initialize(adapter, ar3)
1896
1995
  @adapter = adapter
1996
+ @isAr3 = ar3
1897
1997
  end
1898
1998
 
1899
1999
  def last_generated_id(stmt)
@@ -1936,9 +2036,16 @@ To remove the column, the table must be dropped and recreated without the #{colu
1936
2036
  # an hash for each single record.
1937
2037
  # The loop stops when there aren't any more valid records to fetch
1938
2038
  begin
1939
- while single_hash = IBM_DB.fetch_assoc(stmt)
1940
- # Add the record to the +results+ array
1941
- results << single_hash
2039
+ if(@isAr3)
2040
+ while single_hash = IBM_DB.fetch_assoc(stmt)
2041
+ # Add the record to the +results+ array
2042
+ results << single_hash
2043
+ end
2044
+ else
2045
+ while single_hash = IBM_DB.fetch_array(stmt)
2046
+ # Add the record to the +results+ array
2047
+ results << single_hash
2048
+ end
1942
2049
  end
1943
2050
  rescue StandardError => fetch_error # Handle driver fetch errors
1944
2051
  error_msg = IBM_DB.getErrormsg(stmt, IBM_DB::DB_STMT )
@@ -2052,8 +2159,8 @@ To remove the column, the table must be dropped and recreated without the #{colu
2052
2159
  end # class IBM_DataServer
2053
2160
 
2054
2161
  class IBM_DB2 < IBM_DataServer
2055
- def initialize(adapter)
2056
- super(adapter)
2162
+ def initialize(adapter, ar3)
2163
+ super(adapter,ar3)
2057
2164
  @limit = @offset = nil
2058
2165
  end
2059
2166
 
@@ -2868,20 +2975,29 @@ module Arel
2868
2975
  class IBM_DB < Arel::Visitors::ToSql
2869
2976
  private
2870
2977
 
2871
- def visit_Arel_Nodes_Limit o
2978
+ def visit_Arel_Nodes_Limit o, a=nil
2872
2979
  visit o.expr
2873
2980
  end
2874
2981
 
2875
- def visit_Arel_Nodes_Offset o
2982
+ def visit_Arel_Nodes_Offset o, a=nil
2876
2983
  visit o.expr
2877
2984
  end
2878
2985
 
2879
- def visit_Arel_Nodes_SelectStatement o
2880
- sql = [
2881
- (visit(o.with) if o.with),
2882
- o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
2883
- ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
2884
- ].compact.join ' '
2986
+ def visit_Arel_Nodes_SelectStatement o, a=nil
2987
+ #Interim fix for backward compatibility [Arel 4.0.0 and below]
2988
+ if self.method(:visit_Arel_Nodes_SelectCore).arity == 1
2989
+ sql = [
2990
+ (visit(o.with) if o.with),
2991
+ o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
2992
+ ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
2993
+ ].compact.join ' '
2994
+ else
2995
+ sql = [
2996
+ (visit(o.with) if o.with),
2997
+ o.cores.map { |x| visit_Arel_Nodes_SelectCore x,a }.join,
2998
+ ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
2999
+ ].compact.join ' '
3000
+ end
2885
3001
 
2886
3002
  if o.limit
2887
3003
  limit = visit(o.limit)
metadata CHANGED
@@ -1,108 +1,106 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 2.5.12
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.5.14a
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - IBM
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
-
13
- date: 2014-01-28 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
16
14
  name: activerecord
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
21
17
  - - ">="
22
- - !ruby/object:Gem::Version
18
+ - !ruby/object:Gem::Version
23
19
  version: 1.15.1
24
20
  type: :runtime
25
- version_requirements: *id001
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.15.1
26
27
  description:
27
28
  email: rubyibm-developers@rubyforge.org
28
29
  executables: []
29
-
30
- extensions:
30
+ extensions:
31
31
  - ext/extconf.rb
32
- extra_rdoc_files:
32
+ extra_rdoc_files:
33
33
  - CHANGES
34
34
  - README
35
35
  - MANIFEST
36
- files:
36
+ files:
37
+ - CHANGES
38
+ - LICENSE
39
+ - MANIFEST
40
+ - ParameterizedQueries README
37
41
  - README
38
- - lib/active_record/connection_adapters/ibmdb_adapter.rb
42
+ - ext/Makefile.nt32
43
+ - ext/Makefile.nt32.191
44
+ - ext/extconf.rb
45
+ - ext/ibm_db.c
46
+ - ext/ruby_ibm_db.h
47
+ - ext/ruby_ibm_db_cli.c
48
+ - ext/ruby_ibm_db_cli.h
49
+ - init.rb
50
+ - lib/IBM_DB.rb
39
51
  - lib/active_record/connection_adapters/ibm_db_adapter.rb
40
52
  - lib/active_record/connection_adapters/ibm_db_pstmt.rb
53
+ - lib/active_record/connection_adapters/ibmdb_adapter.rb
41
54
  - lib/active_record/vendor/db2-i5-zOS.yaml
42
- - lib/IBM_DB.rb
43
- - test/connections/native_ibm_db/connection.rb
44
- - test/models/warehouse_thing.rb
55
+ - test/cases/adapter_test.rb
56
+ - test/cases/associations/belongs_to_associations_test.rb
57
+ - test/cases/associations/cascaded_eager_loading_test.rb
58
+ - test/cases/associations/has_and_belongs_to_many_associations_test.rb
59
+ - test/cases/associations/join_model_test.rb
45
60
  - test/cases/attribute_methods_test.rb
61
+ - test/cases/base_test.rb
62
+ - test/cases/calculations_test.rb
63
+ - test/cases/migration_test.rb
64
+ - test/cases/persistence_test.rb
65
+ - test/cases/query_cache_test.rb
46
66
  - test/cases/relations_test.rb
47
67
  - test/cases/schema_dumper_test.rb
48
68
  - test/cases/transaction_callbacks_test.rb
49
- - test/cases/xml_serialization_test.rb
50
69
  - test/cases/validations/uniqueness_validation_test.rb
51
- - test/cases/persistence_test.rb
52
- - test/cases/calculations_test.rb
53
- - test/cases/query_cache_test.rb
54
- - test/cases/migration_test.rb
55
- - test/cases/base_test.rb
56
- - test/cases/associations/belongs_to_associations_test.rb
57
- - test/cases/associations/has_and_belongs_to_many_associations_test.rb
58
- - test/cases/associations/cascaded_eager_loading_test.rb
59
- - test/cases/associations/join_model_test.rb
60
- - test/cases/adapter_test.rb
70
+ - test/cases/xml_serialization_test.rb
61
71
  - test/config.yml
62
- - test/schema/zOS/ibm_db_specific_schema.rb
63
- - test/schema/ids/ibm_db_specific_schema.rb
72
+ - test/connections/native_ibm_db/connection.rb
73
+ - test/ibm_db_test.rb
74
+ - test/models/warehouse_thing.rb
64
75
  - test/schema/i5/ibm_db_specific_schema.rb
65
- - test/schema/schema.rb
76
+ - test/schema/ids/ibm_db_specific_schema.rb
66
77
  - test/schema/luw/ibm_db_specific_schema.rb
67
- - test/ibm_db_test.rb
68
- - ParameterizedQueries README
69
- - ext/ruby_ibm_db.h
70
- - ext/Makefile.nt32
71
- - ext/ruby_ibm_db_cli.c
72
- - ext/ruby_ibm_db_cli.h
73
- - ext/extconf.rb
74
- - ext/ibm_db.c
75
- - ext/Makefile.nt32.191
76
- - LICENSE
77
- - init.rb
78
- - CHANGES
79
- - MANIFEST
78
+ - test/schema/schema.rb
79
+ - test/schema/zOS/ibm_db_specific_schema.rb
80
80
  homepage: http://rubyforge.org/projects/rubyibm/
81
81
  licenses: []
82
-
82
+ metadata: {}
83
83
  post_install_message:
84
84
  rdoc_options: []
85
-
86
- require_paths:
85
+ require_paths:
87
86
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
91
89
  - - ">="
92
- - !ruby/object:Gem::Version
90
+ - !ruby/object:Gem::Version
93
91
  version: 1.8.6
94
- required_rubygems_version: !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- version: "0"
100
- requirements:
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.3.1
97
+ requirements:
101
98
  - ActiveRecord, at least 1.15.1
102
99
  rubyforge_project: rubyibm
103
- rubygems_version: 1.8.23
100
+ rubygems_version: 2.2.0
104
101
  signing_key:
105
- specification_version: 3
106
- summary: "Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows, DB2 on zOS, DB2 on i5/OS, Informix (IDS)}"
107
- test_files:
102
+ specification_version: 4
103
+ summary: 'Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows,
104
+ DB2 on zOS, DB2 on i5/OS, Informix (IDS)}'
105
+ test_files:
108
106
  - test/ibm_db_test.rb