ibm_db 3.0.3-x86-mingw32 → 3.0.4-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +3 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +32 -41
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70684dc559dfdad02b183ecef2c3bc051ca32912
|
4
|
+
data.tar.gz: caba7e99cf971597058648c3f6c6dfe9c9d0fcbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce4f5b34170f9a79d04b45f280669a0b279a4cce3ea95e2ec492dc9a7fefad7be75abbb86cd506739a950e617661c5996f31fa6571a64039087ee5cbfdb8d08c
|
7
|
+
data.tar.gz: 4145709710cf0748e831e547c2c1b7e61fdb0877b9d4c657e47d066b70e758ced3d5c3b508bbec833baf90a883890bb88540b4c7a1c1fb3362c0870f494f80e2
|
data/CHANGES
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Change Log
|
2
2
|
==============
|
3
|
+
2016/07/08 (IBM_DB adapter 3.0.4, driver 3.0.3)
|
4
|
+
- Fixed issue #58 - non-string query parameters do nor get prepared.
|
5
|
+
|
3
6
|
2016/06/17 (IBM_DB adapter 3.0.3, driver 3.0.3)
|
4
7
|
- Fixed issue #59 - Can't Update Binary Files Using 3.0.x (with Ruby 2.1.0 and Rails 4.2.6)
|
5
8
|
|
@@ -159,9 +159,9 @@ module ActiveRecord
|
|
159
159
|
raise LoadError, "Failed to load IBM_DB Ruby driver."
|
160
160
|
end
|
161
161
|
|
162
|
-
if( config.has_key?(:parameterized) && config[:parameterized] == true )
|
163
|
-
|
164
|
-
end
|
162
|
+
#if( config.has_key?(:parameterized) && config[:parameterized] == true )
|
163
|
+
# require 'active_record/connection_adapters/ibm_db_pstmt'
|
164
|
+
#end
|
165
165
|
|
166
166
|
# Check if class TableDefinition responds to indexes method to determine if we are on AR 3 or AR 4.
|
167
167
|
# 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.
|
@@ -617,14 +617,6 @@ module ActiveRecord
|
|
617
617
|
@authentication = config[:authentication] || nil
|
618
618
|
@timeout = config[:timeout] || 0 # default timeout value is 0
|
619
619
|
|
620
|
-
if( config.has_key?(:parameterized) && config[:parameterized] == true )
|
621
|
-
@pstmt_support_on = true
|
622
|
-
@set_quoted_literal_replacement = IBM_DB::QUOTED_LITERAL_REPLACEMENT_OFF
|
623
|
-
else
|
624
|
-
@pstmt_support_on = false
|
625
|
-
@set_quoted_literal_replacement = IBM_DB::QUOTED_LITERAL_REPLACEMENT_ON
|
626
|
-
end
|
627
|
-
|
628
620
|
@app_user = @account = @application = @workstation = nil
|
629
621
|
# Caching database connection options (auditing and billing support)
|
630
622
|
@app_user = conn_options[:app_user] if conn_options.has_key?(:app_user)
|
@@ -701,6 +693,16 @@ module ActiveRecord
|
|
701
693
|
if(@arelVersion >= 3 )
|
702
694
|
@visitor = Arel::Visitors::IBM_DB.new self
|
703
695
|
end
|
696
|
+
|
697
|
+
if(config.has_key?(:parameterized) && config[:parameterized] == true)
|
698
|
+
@pstmt_support_on = true
|
699
|
+
@prepared_statements = true
|
700
|
+
@set_quoted_literal_replacement = IBM_DB::QUOTED_LITERAL_REPLACEMENT_OFF
|
701
|
+
else
|
702
|
+
@pstmt_support_on = false
|
703
|
+
@prepared_statements = false
|
704
|
+
@set_quoted_literal_replacement = IBM_DB::QUOTED_LITERAL_REPLACEMENT_ON
|
705
|
+
end
|
704
706
|
end
|
705
707
|
|
706
708
|
# Optional connection attribute: database name space qualifier
|
@@ -770,7 +772,7 @@ module ActiveRecord
|
|
770
772
|
else
|
771
773
|
arel
|
772
774
|
end
|
773
|
-
end
|
775
|
+
end
|
774
776
|
end
|
775
777
|
# This adapter supports migrations.
|
776
778
|
# Current limitations:
|
@@ -1146,16 +1148,9 @@ module ActiveRecord
|
|
1146
1148
|
if binds.nil? || binds.empty?
|
1147
1149
|
return insert_direct(sql, name, pk, id_value, sequence_name)
|
1148
1150
|
end
|
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
|
-
|
1151
|
+
|
1157
1152
|
clear_query_cache if defined? clear_query_cache
|
1158
|
-
if stmt = exec_insert(sql, name,
|
1153
|
+
if stmt = exec_insert(sql, name, binds)
|
1159
1154
|
begin
|
1160
1155
|
@sql << sql
|
1161
1156
|
return id_value || @servertype.last_generated_id(stmt)
|
@@ -1333,15 +1328,8 @@ module ActiveRecord
|
|
1333
1328
|
if binds.nil? || binds.empty?
|
1334
1329
|
update_direct(sql, name)
|
1335
1330
|
else
|
1336
|
-
begin
|
1337
|
-
|
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
|
+
begin
|
1332
|
+
if stmt = exec_query(sql,name,binds)
|
1345
1333
|
IBM_DB.num_rows(stmt)
|
1346
1334
|
end
|
1347
1335
|
ensure
|
@@ -1963,7 +1951,7 @@ module ActiveRecord
|
|
1963
1951
|
#PKTABLE_NAME:: fk_row[2] Name of the table containing the primary key.
|
1964
1952
|
#PKCOLUMN_NAME:: fk_row[3] Name of the column containing the primary key.
|
1965
1953
|
#FKTABLE_NAME:: fk_row[6] Name of the table containing the foreign key.
|
1966
|
-
#FKCOLUMN_NAME
|
1954
|
+
#FKCOLUMN_NAME:: fk_row[7] Name of the column containing the foreign key.
|
1967
1955
|
#FK_NAME:: fk_row[11] The name of the foreign key.
|
1968
1956
|
|
1969
1957
|
table_name = @servertype.set_case(table_name.to_s)
|
@@ -1981,7 +1969,7 @@ module ActiveRecord
|
|
1981
1969
|
primary_key: fk_row[3],
|
1982
1970
|
}
|
1983
1971
|
options[:on_update] = extract_foreign_key_action(fk_row[9])
|
1984
|
-
options[:on_delete] = extract_foreign_key_action(fk_row[10])
|
1972
|
+
options[:on_delete] = extract_foreign_key_action(fk_row[10])
|
1985
1973
|
foreignKeys << ForeignKeyDefinition.new(fk_row[6], table_name, options)
|
1986
1974
|
end
|
1987
1975
|
|
@@ -2486,14 +2474,16 @@ SET WITH DEFAULT #{@adapter.quote(default)}"
|
|
2486
2474
|
end
|
2487
2475
|
|
2488
2476
|
if(limit.nil?)
|
2489
|
-
retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( SELECT "
|
2477
|
+
#retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( SELECT "
|
2478
|
+
retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( "
|
2490
2479
|
retHash["endSegment"] = " ) AS I) AS O WHERE sys_row_num > #{offset}"
|
2491
2480
|
return retHash
|
2492
2481
|
end
|
2493
2482
|
|
2494
2483
|
# Defines what will be the last record
|
2495
2484
|
last_record = offset.to_i + limit.to_i
|
2496
|
-
retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( SELECT "
|
2485
|
+
#retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( SELECT "
|
2486
|
+
retHash["startSegment"] = "SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM ( "
|
2497
2487
|
retHash["endSegment"] = " ) AS I) AS O WHERE sys_row_num BETWEEN #{offset+1} AND #{last_record}"
|
2498
2488
|
return retHash
|
2499
2489
|
end
|
@@ -2558,14 +2548,12 @@ SET WITH DEFAULT #{@adapter.quote(default)}"
|
|
2558
2548
|
# This method generates the default blob value specified for
|
2559
2549
|
# DB2 Dataservers
|
2560
2550
|
def set_binary_default(value)
|
2561
|
-
|
2562
|
-
"?"
|
2551
|
+
"BLOB('#{value}')"
|
2563
2552
|
end
|
2564
2553
|
|
2565
2554
|
# This method generates the blob value specified for DB2 Dataservers
|
2566
2555
|
def set_binary_value
|
2567
|
-
|
2568
|
-
"?"
|
2556
|
+
"BLOB('?')"
|
2569
2557
|
end
|
2570
2558
|
|
2571
2559
|
# This method generates the default clob value specified for
|
@@ -3075,7 +3063,7 @@ end
|
|
3075
3063
|
@arelVersion = Arel::VERSION.to_i
|
3076
3064
|
rescue
|
3077
3065
|
@arelVersion = 0
|
3078
|
-
end
|
3066
|
+
end
|
3079
3067
|
if(@arelVersion < 6)
|
3080
3068
|
|
3081
3069
|
def visit_Arel_Nodes_Limit o, a=nil
|
@@ -3165,11 +3153,14 @@ else
|
|
3165
3153
|
limOffClause = @connection.get_limit_offset_clauses(limit,offset)
|
3166
3154
|
|
3167
3155
|
if( !limOffClause["startSegment"].empty? )
|
3168
|
-
collector.changeFirstSegment(limOffClause["startSegment"])
|
3156
|
+
#collector.changeFirstSegment(limOffClause["startSegment"])
|
3157
|
+
collector.value.prepend(limOffClause["startSegment"])
|
3169
3158
|
end
|
3170
3159
|
|
3171
3160
|
if( !limOffClause["endSegment"].empty? )
|
3172
|
-
collector.changeEndSegment(limOffClause["endSegment"])
|
3161
|
+
#collector.changeEndSegment(limOffClause["endSegment"])
|
3162
|
+
collector << SPACE
|
3163
|
+
collector << limOffClause["endSegment"]
|
3173
3164
|
end
|
3174
3165
|
|
3175
3166
|
#Initialize a new Collector and set its value to the sql string built so far with any limit and ofset modifications
|
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.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- IBM
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|