ibm_db 3.0.2 → 3.0.3

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: 8e705d2323ca163b2bd7777b01d889c1c83d8d9b
4
- data.tar.gz: 019030ac66aa4c6f796619d1e726dc8b8619bdb1
3
+ metadata.gz: 08df9633383cda42b54cea8516587e9abe849ad0
4
+ data.tar.gz: 95cf8644f94e68a0d4c052ad9b2e9b89095db6b8
5
5
  SHA512:
6
- metadata.gz: d7e372f60dbbd37f2ace9d867d12191f5d55490a2aedd45f29a364833333cfa5f65bd7c2c7816b3d0006559e00b28105eb09f0fd6ea2ea77356f405229cd2694
7
- data.tar.gz: 374d860e6fca3f4c60e4e5325d275cd57c113f14537c418973d4e04498d8500a5c0c9fdba34fff4116595f439a1d086595ea517f54734a76f08c3a9a06583b63
6
+ metadata.gz: 99282fcc40b412a8ff16feb5271d1f906b6bda1323773b88927021c4b99b43f44d858a5bbd88c8ab0a3f8964568150ccff1e78e3f2d5fdf0fa7893978c98e5a0
7
+ data.tar.gz: 8ec0b30a7b01e930228ff054bd86287ec33f28d97316fa9d849f358b574d7967ad00e2e01211f1b9cda1aaf09dfc2eac8383299f8eafd1ce634698118ff8663f
data/CHANGES CHANGED
@@ -1,5 +1,8 @@
1
1
  Change Log
2
2
  ==============
3
+ 2016/06/17 (IBM_DB adapter 3.0.3, driver 3.0.3)
4
+ - Fixed issue #59 - Can't Update Binary Files Using 3.0.x (with Ruby 2.1.0 and Rails 4.2.6)
5
+
3
6
  2016/05/24 (IBM_DB adapter 3.0.2, driver 3.0.2)
4
7
  - Fixed issue #52 - Invalid foreign key ON UPDATE action specified in schema.rb
5
8
  - Fixed issue #59 - Can't Upload Binary Files Using 3.0.x (with Ruby 2.1.0 and Rails 4.2.6)
@@ -12,7 +12,7 @@
12
12
  +----------------------------------------------------------------------+
13
13
  */
14
14
 
15
- #define MODULE_RELEASE "3.0.2"
15
+ #define MODULE_RELEASE "3.0.3"
16
16
 
17
17
  #ifdef HAVE_CONFIG_H
18
18
  #include "config.h"
@@ -770,7 +770,7 @@ module ActiveRecord
770
770
  else
771
771
  arel
772
772
  end
773
- end
773
+ end
774
774
  end
775
775
  # This adapter supports migrations.
776
776
  # Current limitations:
@@ -1146,9 +1146,16 @@ module ActiveRecord
1146
1146
  if binds.nil? || binds.empty?
1147
1147
  return insert_direct(sql, name, pk, id_value, sequence_name)
1148
1148
  end
1149
-
1149
+
1150
+ new_binds = Hash.new
1151
+ param_array = binds.map do |column,value|
1152
+ if column && column.sql_type.to_s =~ /binary|blob/i
1153
+ new_binds [column] = value
1154
+ end
1155
+ end
1156
+
1150
1157
  clear_query_cache if defined? clear_query_cache
1151
- if stmt = exec_insert(sql, name, binds)
1158
+ if stmt = exec_insert(sql, name, new_binds)
1152
1159
  begin
1153
1160
  @sql << sql
1154
1161
  return id_value || @servertype.last_generated_id(stmt)
@@ -1326,8 +1333,15 @@ module ActiveRecord
1326
1333
  if binds.nil? || binds.empty?
1327
1334
  update_direct(sql, name)
1328
1335
  else
1329
- begin
1330
- if stmt = exec_query(sql,name,binds)
1336
+ begin
1337
+ new_binds = Hash.new
1338
+ param_array = binds.map do |column,value|
1339
+ if column && column.sql_type.to_s =~ /binary|blob/i
1340
+ new_binds [column] = value
1341
+ end
1342
+ end
1343
+
1344
+ if stmt = exec_query(sql,name,new_binds)
1331
1345
  IBM_DB.num_rows(stmt)
1332
1346
  end
1333
1347
  ensure
@@ -1946,10 +1960,11 @@ module ActiveRecord
1946
1960
 
1947
1961
  def foreign_keys(table_name)
1948
1962
  #fetch the foreign keys of the table using function foreign_keys
1963
+ #PKTABLE_NAME:: fk_row[2] Name of the table containing the primary key.
1949
1964
  #PKCOLUMN_NAME:: fk_row[3] Name of the column containing the primary key.
1950
- #FKTABLE_NAME:: fk_row[6] Name of the table containing the foreign key.
1951
- #FKCOLUMN_NAME:: fk_row[7] Name of the column containing the foreign key.
1952
- #FK_NAME:: fk_row[11] The name of the foreign key.
1965
+ #FKTABLE_NAME:: fk_row[6] Name of the table containing the foreign key.
1966
+ #FKCOLUMN_NAME: fk_row[7] Name of the column containing the foreign key.
1967
+ #FK_NAME:: fk_row[11] The name of the foreign key.
1953
1968
 
1954
1969
  table_name = @servertype.set_case(table_name.to_s)
1955
1970
  foreignKeys = []
@@ -1966,8 +1981,8 @@ module ActiveRecord
1966
1981
  primary_key: fk_row[3],
1967
1982
  }
1968
1983
  options[:on_update] = extract_foreign_key_action(fk_row[9])
1969
- options[:on_delete] = extract_foreign_key_action(fk_row[10])
1970
- foreignKeys << ForeignKeyDefinition.new(table_name, fk_row[2], options)
1984
+ options[:on_delete] = extract_foreign_key_action(fk_row[10])
1985
+ foreignKeys << ForeignKeyDefinition.new(fk_row[6], table_name, options)
1971
1986
  end
1972
1987
 
1973
1988
  rescue StandardError => fetch_error # Handle driver fetch errors
@@ -2543,12 +2558,14 @@ SET WITH DEFAULT #{@adapter.quote(default)}"
2543
2558
  # This method generates the default blob value specified for
2544
2559
  # DB2 Dataservers
2545
2560
  def set_binary_default(value)
2546
- "BLOB('#{value}')"
2561
+ #"BLOB('#{value}')"
2562
+ "?"
2547
2563
  end
2548
2564
 
2549
2565
  # This method generates the blob value specified for DB2 Dataservers
2550
2566
  def set_binary_value
2551
- "BLOB('?')"
2567
+ #"BLOB('?')"
2568
+ "?"
2552
2569
  end
2553
2570
 
2554
2571
  # This method generates the default clob value specified for
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - IBM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-24 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord