[ http://issues.apache.org/jira/browse/DERBY-113?page=comments#action_57490 ] Amit Handa commented on DERBY-113: ----------------------------------
First, this was filed by Jeremy as a separate bug coming out from Derby-7 bug. So we need to understand how promotion happens(read built in broadening) when two differrent datatypes are compared as part of a function say NULLIF(A,B). A, B are two differrent types. Otherwise also as Jeremy points out select * from dual where '1' = 1; if we compare where a defined function is not involved, how the datatypes should behave. [1] can give help about datatypes and promotions but is not very explicit or in detail. Also see [2] where I have commenetd on built in broadening according to types compared. [1] http://incubator.apache.org/derby/manuals/reference/sqlj122.html#HDRSII-SQLJ-31068 [2] http://issues.apache.org/jira/browse/DERBY-7 Further the derby documentation uses terms like built in broadening at places but is not very explicit. If we are clear on that, I guess it can lead to a solution for this. Just some pointers which can help lead to a solution. > Comparison does not perform implicit type conversion > ---------------------------------------------------- > > Key: DERBY-113 > URL: http://issues.apache.org/jira/browse/DERBY-113 > Project: Derby > Type: Bug > Components: SQL > Reporter: Jeremy Boynes > > The operands to a comparision operator are not implictly converted to the > dominant type resulting in an unexpected exception: > For example: > ij> select * from dual where '1' = 1; > ERROR 42818: Comparisons between 'CHAR' and 'INTEGER' are not supported. > fails whereas > ij> select * from dual where cast('1' as int) = 1; > DUM& > ---- > X > works. The type escalation should be implicit. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
