Permalink
Browse files

Fixed the last details to please DB2

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Jan 3, 2005
1 parent b3739fc commit d9e900cd9dfb408f0a3987bdf63b036f24be0b4d
@@ -85,7 +85,7 @@ def find(*args)
# Otherwise, delegate to association class with conditions.
else
- args << { :conditions => "#{@association_class_primary_key_name} = '#{@owner.id}' #{@conditions ? " AND " + @conditions : ""}" }
+ args << { :conditions => "#{@association_class_primary_key_name} = #{@owner.quoted_id} #{@conditions ? " AND " + @conditions : ""}" }
@association_class.find(*args)
end
end
@@ -7,6 +7,12 @@ def setup
end
def test_load_save
+ # Without using prepared statements, it makes no sense to test
+ # BLOB data with DB2, because the length of a statement is
+ # limited to 32KB.
+ if ActiveRecord::ConnectionAdapters.const_defined? :DB2Adapter
+ return true if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::DB2Adapter)
+ end
bin = Binary.new
bin.data = @data
@@ -34,4 +40,4 @@ def create_data_fixture
File.new(File.dirname(__FILE__)+"/fixtures/associations.png","rb").read
end
-end
+end
@@ -119,6 +119,6 @@ CREATE TABLE people (
CREATE TABLE binaries (
id int generated by default as identity (start with +10000),
- data mediumblob,
+ data blob(50000),
PRIMARY KEY (id)
-);
+);

0 comments on commit d9e900c

Please sign in to comment.