I'm pretty sure this is working correctly. It is hard to be 100% sure since the trunk is changing, but the tests I'm failing are currently failing under MySQL as well in a clean checkout, so I suspect the problem doesn't lie in my code.
I had to make one change to the Rails framework in fixtures.rb:
def value_list
list = []
# !!! This sometimes fails because the class cannot be found...
begin
klass = eval(@class_name)
rescue => e
klass = nil
end
@fixture.each_pair do |key, value|
col = klass.nil? ? nil : klass.columns_hash[key]
element = ActiveRecord::Base.connection.quote(value,col).gsub('\\n', "\n").gsub('\\r', "\r")
list << element
end
list = list.join(", ")
list
end
This is necessary because without it I can't find a way to distinguish TIMESTAMP/DATE/TIME values.
Here is an example of the SQL I need to generate:
Topic Update (0.001516) UPDATE topics SET "bonus_time" = TIME '09:28:00', "approved" = true, "written_on" = TIMESTAMP '2003-07-16 10:28:00', "author_email_address" = 'david@loudthinking.com', "content" = 'Have a nice day', "replies_count" = 0, "title" = 'The First Topic', "author_name" = 'David', "parent_id" = NULL, "last_read" = DATE '2004-04-15', "type" = NULL WHERE id = 1
This works, but maybe someone could explain a better way for me to do this.