[
https://issues.apache.org/jira/browse/TRAFODION-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14697992#comment-14697992
]
Atanu Mishra commented on TRAFODION-201:
----------------------------------------
Anoop Sharma (anoop-sharma) wrote on 2014-04-19: #1
This issue is related to a min or very small value becoming zero during
conversions
of a primary key value.
During non-pkey pred evaluation, both left and right sides are converted to
a common super datatype and then compared.
During the primary key pred, one side is converted to the other and then
the overflow/underflow is handled by moving min/max values.
There may be some rounding that happens and over/under flow is not
being handled correctly.
It is a borderline case with real numbers which by nature are approx.
We saw something similar many months back during dev regressions run
and Prashanth was going to look at it then :) Assigning it to him.
It may be something more serious related to real/double primary keys.
Changed in trafodion:
assignee: Anoop Sharma (anoop-sharma) → Prashanth Vasudev
(vasudev-prashanth)
Prashanth Vasudev (vasudev-prashanth) on 2014-05-14
Changed in trafodion:
status: New → Fix Committed
Weishiun Tsai (wei-shiun-tsai) wrote on 2014-05-15: #2
Verified on the datalake v40535 build. This problem has been fixed:
[trafodion@centos-mapr1 scripts]$ sqlci | cat
Trafodion Conversational Interface 0.7.0
(c) Copyright 2014 Hewlett-Packard Development Company, LP.
>>create table minmax (a real not null);
--- SQL operation complete.
>>insert into minmax values (-10e10), (-1), (0), (1), (10e10);
--- 5 row(s) inserted.
>>select * from minmax where a < 10e-77;
A
---------------
-9.9999997E+010
-1.0000000E+000
0.0000000E+000
--- 3 row(s) selected.
>>drop table minmax;
--- SQL operation complete.
>>create table minmax (a real not null, primary key(a));
--- SQL operation complete.
>>insert into minmax values (-10e10), (-1), (0), (1), (10e10);
--- 5 row(s) inserted.
>>select * from minmax where a < 10e-77;
A
---------------
-9.9999997E+010
-1.0000000E+000
0.0000000E+000
--- 3 row(s) selected.
>>
Changed in trafodion:
status: Fix Committed → Fix Released
> LP Bug: 1295473 - Same query returns different results when the column is a
> primary key
> ---------------------------------------------------------------------------------------
>
> Key: TRAFODION-201
> URL: https://issues.apache.org/jira/browse/TRAFODION-201
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-exe
> Reporter: Weishiun Tsai
> Assignee: Prashanth Vasudev
> Priority: Critical
> Fix For: 0.8 (pre-incubation)
>
>
> Same query returns different results on 2 tables with the same columns and
> the same data. The only difference is that one of the tables declares the
> column used in the query as a primary key. In the following output, the 1st
> part of the output shows that the query returns 3 rows when column a is not a
> primary key. The 2nd part of the output shows that the query returns only 2
> rows when column a is declared as a primary key. Value 0, which should be
> returned, is not returned.
> This is seen on the beta 0.7.0 RC1 build installed on a workstation.
> -bash-4.1$ sqlci
> Trafodion Conversational Interface 0.7.0
> (c) Copyright 2014 Hewlett-Packard Development Company, LP.
> >>create table minmax (a real not null);
> --- SQL operation complete.
> >>insert into minmax values (-10e10), (-1), (0), (1), (10e10);
> --- 5 row(s) inserted.
> >>select * from minmax where a < 10e-77;
> A
> ---------------
> -9.9999997E+010
> -1.0000000E+000
> 0.0000000E+000
> --- 3 row(s) selected.
> >>drop table minmax;
> ================================================================================================
> --- SQL operation complete.
> >>create table minmax (a real not null, primary key(a));
> --- SQL operation complete.
> >>insert into minmax values (-10e10), (-1), (0), (1), (10e10);
> --- 5 row(s) inserted.
> >>select * from minmax where a < 10e-77;
> A
> ---------------
> -9.9999997E+010
> -1.0000000E+000
> --- 2 row(s) selected.
> >>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)