Fixed the last details to please DB2

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 b3739fca
......@@ -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
\ No newline at end of file
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)
);
\ No newline at end of file
);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册