Bug 1227214

Summary: MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Juraj Duráni <jdurani>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: atangrin, dlesage, vhalbert
Target Milestone: ER1   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-24 11:47:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juraj Duráni 2015-06-02 07:43:11 UTC
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


Document URL: 

Section Number and Name: 

Describe the issue: 

Suggestions for improvement: 

Additional information:

Comment 1 JBoss JIRA Server 2015-06-02 19:41:27 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3505 to Resolved

Comment 2 JBoss JIRA Server 2016-01-26 18:00:56 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3505 to Closed