• Download Gist
ibm_db_compiler_changes_as_per_genericcompiler.diff
Diff
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
From cdcc7f6ff591e69eb63251138db176588df2c296 Mon Sep 17 00:00:00 2001
From: Praveen Devarao <praveendrl@in.ibm.com>
Date: Wed, 1 Sep 2010 19:47:17 +0530
Subject: [PATCH] Changes as required in accordance to GenericCompiler changes
 
---
lib/arel/engines/sql/compilers/ibm_db_compiler.rb | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
 
diff --git a/lib/arel/engines/sql/compilers/ibm_db_compiler.rb b/lib/arel/engines/sql/compilers/ibm_db_compiler.rb
index 8c5779a..56680c9 100644
--- a/lib/arel/engines/sql/compilers/ibm_db_compiler.rb
+++ b/lib/arel/engines/sql/compilers/ibm_db_compiler.rb
@@ -32,9 +32,9 @@ module Arel
class IBM_DBCompiler < GenericCompiler
def limited_update_conditions(conditions, taken)
- quoted_primary_key = engine.quote_table_name(primary_key)
- update_conditions = "WHERE #{quoted_primary_key} IN (SELECT #{quoted_primary_key} FROM #{engine.connection.quote_table_name table.name} #{conditions} " #Note: - ')' not added, limit segment is to be appended
- engine.add_limit_offset!(update_conditions,{:limit=>taken,:offset=>nil})
+ quoted_primary_key = @engine.connection.quote_column_name(relation.primary_key)
+ update_conditions = "WHERE #{quoted_primary_key} IN (SELECT #{quoted_primary_key} FROM #{@engine.connection.quote_table_name relation.table.name} #{conditions} " #Note: - ')' not added, limit segment is to be appended
+ @engine.connection.add_limit_offset!(update_conditions,{:limit=>taken,:offset=>nil})
update_conditions << ")" # Close the sql segment
update_conditions
end
--
1.6.0

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.