
do_jdbc #execute_reader/non_query blow up when passed parameters of a subclassed, supported type
Reported by Alex Coles | November 13th, 2009 @ 06:11 PM | in 0.10.2
do_jdbc's type inference for parameters does not correctly handle subclasses of the supported types. Instead it will inelegantly display a NPE.
To reproduce, apply the following patch to
data_objects/lib/data_objects/spec/typecast/string_spec.rb
:
http://gist.github.com/233747
An example of where this might cause an issue for a user:
- loading information from CSV - iterating over a row, a row's
value is of type CSV::Cell, a subclass of String. DataMapper and
DataObjects (MRI) will handle parameter correctly and pass to the
DB as String. DataObjects (JRuby) will throw NPE.
Comments and changes to this ticket
-
Alex Coles November 13th, 2009 @ 06:12 PM
- State changed from unconfirmed to accepted
-
-
Dan Kubb (dkubb) November 14th, 2009 @ 05:29 AM
- State changed from accepted to resolved
(from [02efb867019462500dd623ca86380acdaf7ed7d6]) [data_objects] Provide spec for subclasses of String as parameters
- See previous commit 59923d1, 441ecd5.
[#1123 state:resolved]
Signed-off-by: Alex Coles alex@alexcolesportfolio.com
http://github.com/datamapper/do/commit/02efb867019462500dd623ca8638... -
Dan Kubb (dkubb) November 16th, 2009 @ 10:17 AM
(from [8e64ca1939e72432ebe179f72ea9b6dfcdfa8ef9]) [do_jdbc] Revert "Added support for subclasses of supported types"
- Will use alternative solution (recursive RubyType#getRubyType) added in 67e3ef9.
This reverts commit 59923d11f6748931b74c39a51df11cb85406c354.
[#1123]
Signed-off-by: Alex Coles alex@alexcolesportfolio.com
http://github.com/datamapper/do/commit/8e64ca1939e72432ebe179f72ea9... -
Dan Kubb (dkubb) November 16th, 2009 @ 10:17 AM
(from [046c703d36701cd4e1060b909ed48241bb3212ad]) [do_jdbc] Use recursive RubyType#getRubyType for inference
- See 67e3ef9.
- Also should a type unable to be inferred, throw an ArgumentError (the text for which needs to be finalized) rather than blowing up with a NPE.
[#1123 state:resolved]
Signed-off-by: Alex Coles alex@alexcolesportfolio.com
http://github.com/datamapper/do/commit/046c703d36701cd4e1060b909ed4...
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 »
People watching this ticket
Referenced by
-
1123 do_jdbc #execute_reader/non_query blow up when passed parameters of a subclassed, supported type [#1123 state:resolved]
-
1123 do_jdbc #execute_reader/non_query blow up when passed parameters of a subclassed, supported type [#1123]
-
1123 do_jdbc #execute_reader/non_query blow up when passed parameters of a subclassed, supported type [#1123 state:resolved]