
Inferring DATE types doesn't work for oracle
Reported by Xavier Shay | May 4th, 2010 @ 10:46 PM
There was an optimization in do_oracle that created Time objects instead of DateTime for speed reasons. This is either:
1) Broken when executing raw SQL, or
2) An invalid optimization, since the DATE type can contain values
outside the range of a Time object
I'm not familiar enough with the code or Oracle to know
'correct' behaviour. The following commit fixed the issue for my
use case though:
http://github.com/NZX/do/commit/b7b2a44d3e1c9b553d9ab3c35b49c4d7007...
To replicate:
> repository.adapter.select("SELECT my_date_column FROM my_table")
DataObjects::DataError: Couldn't parse time from class DateTime object (code: , sql state: , query: , uri: )
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:285:in `next!'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:285:in `select_fields'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:37:in `select'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:269:in `with_connection'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/adapters/data_objects_adapter.rb:31:in `select'
Apologies, I don't have a development Oracle environment to provide a solid test case.
Comments and changes to this ticket
-
Xavier Shay May 4th, 2010 @ 10:53 PM
This issue may apply to TIMESTAMP columns also, but I don't have any of those
-
Dan Kubb (dkubb) May 21st, 2010 @ 11:50 PM
- Assigned user set to Dirkjan Bussink
-
Dan Kubb (dkubb) May 25th, 2010 @ 03:19 AM
- Assigned user changed from Dirkjan Bussink to Raimonds Simanovskis
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »