I've temporarily turned off the automatic testing of the Oracle adapter, while I get the new adapter gems stuff all working properly.
Given that the adapter is now removed from core, I'm open to suggestions on whether it's still appropriate to have test failures emailed to this list.
On the one hand, it's no longer core's responsibility to apply Oracle fixes; on the other hand, it may still be helpful for core to be aware of breakages.
On the one hand, it's no longer core's responsibility to apply Oracle
fixes; on the other hand, it may still be helpful for core to be aware
of breakages.
Feedback?
There are still a lot of potential issues that we could cause in the
adapters. I think for a while it's ok to have the reports coming
here, assuming that you can fix the outstanding issues ;).
I fixed this by putting the following in my Rails 2.0 application's
lib/oracle_patch.rb and including it in my config/environment.rb:
----
require 'active_record/connection_adapters/oracle_adapter'
module ActiveRecord
module ConnectionAdapters
class OracleAdapter
def select_rows(sql, name = nil)
@connection.query_with_result = true
result = execute(sql, name)
rows =
result.each { |row| rows << row }
result.free
rows
end
end
end
end
----
I tried this with Oracle 8i, and it didn't work. This works for me:
def select_rows(sql, name = nil)
cursor = execute(sql, name)
rows =
while row = cursor.fetch
rows << row
end
rows
ensure
cursor.close if cursor
end
Can anyone verify that this works against Oracle 9/10/11?
I just submitted a patch that I have been using for several months
from RSI. This is a simple patch that just addresses select_rows
# Returns an array of arrays containing the field values.
# Order is the same as that returned by #columns.
def select_rows(sql, name = nil)
result = select(sql, name)
result.map{ |v| v.values}
end
Can somebody from Rails core +1 this so we can get it into the Oracle
driver? It's a bit embarrassing for us Rails promoters that this is
broken...