Bug 1227214 - MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction
Summary: MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: 6.3.0
Assignee: Van Halbert
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-02 07:43 UTC by Juraj Duráni
Modified: 2016-08-24 11:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-24 11:47:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-3505 0 Major Closed MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction 2016-08-09 05:02:55 UTC

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


Note You need to log in before you can comment on or make changes to this bug.