You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2015/08/21 02:43:18 UTC
[1/2] incubator-trafodion git commit: TRAFODION-1459 SHOWDDL shows
incorrect DIVISION BY + regressions fix
Repository: incubator-trafodion
Updated Branches:
refs/heads/master adcae2545 -> 59927f02a
TRAFODION-1459 SHOWDDL shows incorrect DIVISION BY + regressions fix
Fixing 1459 and also checking in a new expected file that should solve
the compGeneral/TEST042 failures we have seen over the past two days,
caused by my earlier commit. The expected file + known diffs worked on
a debug build, but it is not sufficient for a release build.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/97d0c785
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/97d0c785
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/97d0c785
Branch: refs/heads/master
Commit: 97d0c785d03a2f38b14a31aad024c56c15455f7e
Parents: 4e9bb03
Author: Hans Zeller <ha...@esgyn.com>
Authored: Thu Aug 20 15:15:20 2015 +0000
Committer: Hans Zeller <ha...@esgyn.com>
Committed: Thu Aug 20 15:15:20 2015 +0000
----------------------------------------------------------------------
core/sql/optimizer/ItemExpr.cpp | 5 ++++-
core/sql/regress/compGeneral/DIFF042.KNOWN.SB | 14 --------------
core/sql/regress/compGeneral/EXPECTED042 | 9 ++++-----
core/sql/regress/compGeneral/EXPECTED071 | 8 ++++----
4 files changed, 12 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/97d0c785/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index 8cb182f..183f7f3 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -2382,8 +2382,11 @@ void ItemExpr::computeKwdAndPostfix( NAString &kwd,
// Get the Data type after the Cast
const NAType *naType = ((Cast *) this)->getType();
- // ignore NULLs description in getTypeSQLName
+ // ignore NULLs description in getTypeSQLName, since it
+ // does not return valid SQL syntax
postfix += naType->getTypeSQLname(TRUE);
+ if (!naType->supportsSQLnull())
+ postfix += " NOT NULL";
postfix += ")";
}
else
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/97d0c785/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/DIFF042.KNOWN.SB b/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
deleted file mode 100644
index ecee0c6..0000000
--- a/core/sql/regress/compGeneral/DIFF042.KNOWN.SB
+++ /dev/null
@@ -1,14 +0,0 @@
-1976,1977d1975
-< 1 3
-< 1 3
-1983a1982,1983
-> 2 3
-> 3 3
-2068d2067
-< 1 0
-2077,2078d2075
-< 1 3
-< 1 3
-2086a2084,2085
-> 2 3
-> 3 3
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/97d0c785/core/sql/regress/compGeneral/EXPECTED042
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED042 b/core/sql/regress/compGeneral/EXPECTED042
index 3059c84..49ca690 100644
--- a/core/sql/regress/compGeneral/EXPECTED042
+++ b/core/sql/regress/compGeneral/EXPECTED042
@@ -1985,14 +1985,14 @@ NUM_HITS NUM_PARAMS
1 2
1 2
1 3
- 1 3
- 1 3
1 5
2 1
2 1
2 1
2 2
2 3
+ 2 3
+ 3 3
10 4
--- 18 row(s) selected.
@@ -2077,7 +2077,6 @@ NUM_HITS NUM_PARAMS
1 1
1 1
1 1
- 1 0
1 1
1 1
1 1
@@ -2086,8 +2085,6 @@ NUM_HITS NUM_PARAMS
1 2
1 2
1 3
- 1 3
- 1 3
1 4
1 5
1 9
@@ -2096,6 +2093,8 @@ NUM_HITS NUM_PARAMS
2 1
2 2
2 3
+ 2 3
+ 3 3
5 1
10 4
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/97d0c785/core/sql/regress/compGeneral/EXPECTED071
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED071 b/core/sql/regress/compGeneral/EXPECTED071
index d34f5f2..4b95536 100644
--- a/core/sql/regress/compGeneral/EXPECTED071
+++ b/core/sql/regress/compGeneral/EXPECTED071
@@ -341,7 +341,7 @@ OPERATOR TNAME
------------------------------ ------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TRAFODION_SCAN MTD0 max_card_est:
-SEABASE_MERGE TRAFODION.MTD.MTD1 begin_key: (_DIVISION_1_ = DATE_PART('YEARMONTH',TRAFODION.MTD.MTD0.SALE_DATE)) and (STORE_ID = TRAFODION.MTD.MTD0.STORE_ID) and (ITEM_ID = TRAFODION.MTD.MTD0.ITEM_ID) and (SALE_DATE = TRAFODION.MTD.MTD0.SALE_DATE) end_key: (_DIVISION_1_ = DATE_PART('YEARMONTH',TRAFODION.MTD.MTD0.SALE_DATE)) and (STORE_ID = TRAFODION.MTD.MTD0.STORE_ID) and (ITEM_ID = TRAFODION.MTD.MTD0.ITEM_ID) and (SALE_DATE = TRAFODION.MTD.MTD0.SALE_DATE)
+TRAFODION_MERGE TRAFODION.MTD.MTD1 begin_key: (_DIVISION_1_ = DATE_PART('YEARMONTH',TRAFODION.MTD.MTD0.SALE_DATE)) and (STORE_ID = TRAFODION.MTD.MTD0.STORE_ID) and (ITEM_ID = TRAFODION.MTD.MTD0.ITEM_ID) and (SALE_DATE = TRAFODION.MTD.MTD0.SALE_DATE) end_key: (_DIVISION_1_ = DATE_PART('YEARMONTH',TRAFODION.MTD.MTD0.SALE_DATE)) and (STORE_ID = TRAFODION.MTD.MTD0.STORE_ID) and (ITEM_ID = TRAFODION.MTD.MTD0.ITEM_ID) and (SALE_DATE = TRAFODION.MTD.MTD0.SALE_DATE)
--- 2 row(s) selected.
>>
@@ -866,7 +866,7 @@ MTDN1 BT 4 _SALT_ 0 4 S
MTDN1 BT 5 _DIVISION_1_ 0 4 S 7 2 DATE_PART('YEARWEEK',PC1)
MTDN1 BT 6 _DIVISION_2_ 0 11 S 7 3 DATE_TRUNC('CENTURY',PC2)
MTDN1 BT 7 _DIVISION_3_ 0 8 S 7 4 left(PC3, 4)
-MTDN1 BT 8 _DIVISION_4_ 0 6 S 7 5 substring(cast(PC3 AS CHAR(10) CHARACTER SET UCS2), 1, 3)
+MTDN1 BT 8 _DIVISION_4_ 0 6 S 7 5 substring(cast(PC3 AS CHAR(10) CHARACTER SET UCS2 NOT NULL),
MTDN1 BT 9 _DIVISION_5_ 0 4 S 7 6 substring(PC3, 1, 2)
MTDN2 BT 0 PC3 0 11 U 1 7 none
MTDN2 BT 1 PC2 0 11 U 1 6 none
@@ -885,7 +885,7 @@ MTDN3 BT 5 _DIVISION_1_ 0 4 S
MTDN3 BT 6 _DIVISION_2_ 0 8 S 7 3 left(PC3, 4)
MTDN3 BT 7 _DIVISION_3_ 0 4 S 7 4 DATEDIFF(WEEK, DATE '1900-01-01', PC2)
MTDN3 BT 8 _DIVISION_4_ 0 4 S 7 5 substring(PC3, 1, 2)
-MTDN3 BT 9 _DIVISION_5_ 0 4 S 7 6 cast(((PC4 + 32) / 18.0001) AS INTEGER SIGNED)
+MTDN3 BT 9 _DIVISION_5_ 0 4 S 7 6 cast(((PC4 + 32) / 18.0001) AS INTEGER SIGNED NOT NULL)
--- 28 row(s) selected.
>>set param ?pat '%MTD%';
@@ -1350,7 +1350,7 @@ MTDN3 BT 5 _DIVISION_1_ 0 4 S
MTDN3 BT 6 _DIVISION_2_ 0 8 S 7 3 left(PC3, 4)
MTDN3 BT 7 _DIVISION_3_ 0 4 S 7 4 DATEDIFF(WEEK, DATE '1900-01-01', PC2)
MTDN3 BT 8 _DIVISION_4_ 0 4 S 7 5 substring(PC3, 1, 2)
-MTDN3 BT 9 _DIVISION_5_ 0 4 S 7 6 cast(((PC4 + 32) / 18.0001) AS INTEGER SIGNED)
+MTDN3 BT 9 _DIVISION_5_ 0 4 S 7 6 cast(((PC4 + 32) / 18.0001) AS INTEGER SIGNED NOT NULL)
MTDRITARGET1 BT 0 D_DATE 0 4 U 3 1 none
MTDRITARGET1 BT 1 QUARTER_ID ? 6 U 2 none none
MTDRITARGET2D BT 0 D_DATE 0 4 U 3 2 none
[2/2] incubator-trafodion git commit: Merge [TRAFODION-1459] PR 63
SHOWDDL shows incorrect DIVISION BY
Posted by db...@apache.org.
Merge [TRAFODION-1459] PR 63 SHOWDDL shows incorrect DIVISION BY
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/59927f02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/59927f02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/59927f02
Branch: refs/heads/master
Commit: 59927f02abe96eb93a26c43802f33e2b06cf6bd5
Parents: adcae25 97d0c78
Author: Dave Birdsall <db...@apache.org>
Authored: Fri Aug 21 00:42:11 2015 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Fri Aug 21 00:42:11 2015 +0000
----------------------------------------------------------------------
core/sql/optimizer/ItemExpr.cpp | 5 ++++-
core/sql/regress/compGeneral/DIFF042.KNOWN.SB | 14 --------------
core/sql/regress/compGeneral/EXPECTED042 | 9 ++++-----
core/sql/regress/compGeneral/EXPECTED071 | 8 ++++----
4 files changed, 12 insertions(+), 24 deletions(-)
----------------------------------------------------------------------