[teiid-issues] [JBoss JIRA] (TEIID-3505) MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction

Juraj Duráni (JIRA) issues at jboss.org
Tue Jun 2 03:43:02 EDT 2015


     [ https://issues.jboss.org/browse/TEIID-3505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juraj Duráni updated TEIID-3505:
--------------------------------
    Description: 
convert(... , float) and convert(..., double) functions use for conversion "+ 0.0". But if the result is used in the more complex expression, translator does not take into account priority of the operators.

*Query:* SELECT StringKey, (convert(StringKey, float)+(-3)) AS StringKeyPlusNeg3, (convert(StringKey, float) - (-3)) AS StringKeyMinusNeg3, (convert(StringKey, float)*(-3)) AS StringKeyTimesNeg3, (convert(StringKey, float)/(-3)) AS StringKeyDivNeg3 FROM table WHERE IntKey == 1 ORDER BY StringKey

*Result:* 1 | -2 | 4 | 1 | 1

*Source-specific query:* SELECT g_0.STRINGKEY AS c_0, (g_0.STRINGKEY + 0.0 + -3.0) AS c_1, (g_0.STRINGKEY + 0.0 - -3.0) AS c_2, _*(g_0.STRINGKEY + 0.0 * -3.0)*_ AS c_3, _*(g_0.STRINGKEY + 0.0 / -3.0)*_ AS c_4 FROM smalla AS g_0 WHERE g_0.INTKEY > 0 AND g_0.INTKEY <= 10 ORDER BY c_0

  was:
convert(... , float) and convert(..., double) function use for conversion "+ 0.0". But if the result is used in the more complex expression, translator does not take into account priority of the operators.

*Query:* SELECT StringKey, (convert(StringKey, float)+(-3)) AS StringKeyPlusNeg3, (convert(StringKey, float) - (-3)) AS StringKeyMinusNeg3, (convert(StringKey, float)*(-3)) AS StringKeyTimesNeg3, (convert(StringKey, float)/(-3)) AS StringKeyDivNeg3 FROM table WHERE IntKey == 1 ORDER BY StringKey

*Result:* 1 | -2 | 4 | 1 | 1

*Source-specific query:* SELECT g_0.STRINGKEY AS c_0, (g_0.STRINGKEY + 0.0 + -3.0) AS c_1, (g_0.STRINGKEY + 0.0 - -3.0) AS c_2, _*(g_0.STRINGKEY + 0.0 * -3.0)*_ AS c_3, _*(g_0.STRINGKEY + 0.0 / -3.0)*_ AS c_4 FROM smalla AS g_0 WHERE g_0.INTKEY > 0 AND g_0.INTKEY <= 10 ORDER BY c_0



> MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses  "+ 0.0" construction
> -------------------------------------------------------------------------------------------
>
>                 Key: TEIID-3505
>                 URL: https://issues.jboss.org/browse/TEIID-3505
>             Project: Teiid
>          Issue Type: Bug
>    Affects Versions: 8.7.1.6_2
>            Reporter: Juraj Duráni
>            Assignee: Steven Hawkins
>
> convert(... , float) and convert(..., double) functions use for conversion "+ 0.0". But if the result is used in the more complex expression, translator does not take into account priority of the operators.
> *Query:* SELECT StringKey, (convert(StringKey, float)+(-3)) AS StringKeyPlusNeg3, (convert(StringKey, float) - (-3)) AS StringKeyMinusNeg3, (convert(StringKey, float)*(-3)) AS StringKeyTimesNeg3, (convert(StringKey, float)/(-3)) AS StringKeyDivNeg3 FROM table WHERE IntKey == 1 ORDER BY StringKey
> *Result:* 1 | -2 | 4 | 1 | 1
> *Source-specific query:* SELECT g_0.STRINGKEY AS c_0, (g_0.STRINGKEY + 0.0 + -3.0) AS c_1, (g_0.STRINGKEY + 0.0 - -3.0) AS c_2, _*(g_0.STRINGKEY + 0.0 * -3.0)*_ AS c_3, _*(g_0.STRINGKEY + 0.0 / -3.0)*_ AS c_4 FROM smalla AS g_0 WHERE g_0.INTKEY > 0 AND g_0.INTKEY <= 10 ORDER BY c_0



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the teiid-issues mailing list