You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by rm...@apache.org on 2017/12/14 01:08:15 UTC

[1/4] incubator-trafodion git commit: add regression test for COMMENT-ON statement

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 625cd8a32 -> 7acdca64d


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/compGeneral/FILTER072
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/FILTER072 b/core/sql/regress/compGeneral/FILTER072
new file mode 100755
index 0000000..66c521d
--- /dev/null
+++ b/core/sql/regress/compGeneral/FILTER072
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# Specialized filter for  project to filter out
+# 1. Syskey values
+# 2. "Funny names" for index columns appearing multiple times
+#    (done twice, since it may appear multiple times)
+# 3. refreshed elapsed time
+
+fil=$1
+if [ "$fil" = "" ]; then
+  echo "Usage: $0 filename"
+  exit 1
+fi
+
+sed "
+s/FILE '.*rundir\(.*\)'/FILE '\$rundir\1'/g
+" $fil

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/compGeneral/TEST072
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST072 b/core/sql/regress/compGeneral/TEST072
new file mode 100644
index 0000000..67342a8
--- /dev/null
+++ b/core/sql/regress/compGeneral/TEST072
@@ -0,0 +1,261 @@
+-- Test: TEST072 (CompGeneral)
+-- @@@ START COPYRIGHT @@@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+-- @@@ END COPYRIGHT @@@
+--
+-- Functionality: COMMENT-ON statement
+-- Expected file: EXPECTED072
+-- Filter file: FILTER072
+-- Tables created: t072t1
+-- Limitations: 
+-- Revision history:
+--     (12/5/17) - Created for new syntax COMMENT-ON
+
+
+set pattern $$QUOTE$$ '''';      -- Needed for metadata insert of DLL path
+
+log LOG072 clear;
+
+obey TEST072(clnup);
+obey TEST072(compile_libs);
+obey TEST072(ddl);
+
+obey TEST072(comment01);
+obey TEST072(showcomment);
+obey TEST072(showddl1);
+
+obey TEST072(comment02);
+obey TEST072(showcomment);
+obey TEST072(showddl1);
+
+obey TEST072(comment03);
+obey TEST072(showcomment);
+obey TEST072(showddl2);
+
+obey TEST072(comment04);
+obey TEST072(showcomment);
+obey TEST072(showddl2);
+
+obey TEST072(comment05);
+obey TEST072(showcomment);
+obey TEST072(showddl2);
+
+obey TEST072(clnup);
+obey TEST072(showcomment);
+
+exit;
+
+
+?section compile_libs
+--------------------------------------------------------------------------
+log;
+
+--DLL
+sh rm -f ./TEST072.dll;
+sh sh $$scriptsdir$$/tools/dll-compile.ksh TEST072.cpp
+  2>&1 | tee -a LOG072-SECONDARY;
+set pattern $$DLL$$ TEST072.dll;
+
+--SPJ jar
+sh sh $$scriptsdir$$/tools/java-compile.ksh TEST072.java 2>> LOG072-SECONDARY | tee -a LOG072;
+sh sh $$scriptsdir$$/tools/java-archive.ksh TEST072.jar TEST072.class 2>> LOG072-SECONDARY | tee -a LOG072;
+set pattern $$SPJJAR$$ TEST072.jar;
+
+log LOG072;
+
+
+?section ddl
+--------------------------------------------------------------------------
+
+create schema t072sch_comment;
+
+create table t072sch_comment.t072t1 ( col1 int not null, col2 DECIMAL(10, 4) not null, col3 VARCHAR(50) not null, primary key (col1) );
+
+create index t072idx1 on t072sch_comment.t072t1 (col1, col3);
+
+create view  t072sch_comment.t072view1 as select * from t072sch_comment.t072t1;
+
+create library t072sch_comment.t072ddl file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$;
+
+create library t072sch_comment.t072jar file $$QUOTE$$ $$REGRRUNDIR$$/$$SPJJAR$$ $$QUOTE$$;
+
+
+create function t072sch_comment.t072func(int,int) returns (add2 int)
+    external name 'add2' library t072sch_comment.t072ddl
+    deterministic no sql no transaction required
+;
+
+create procedure t072sch_comment.t072spj()
+    external name 'TEST072.testMoreResultSet'
+    library t072sch_comment.t072jar
+    language  java 
+    DYNAMIC RESULT SETS 5
+    READS SQL DATA
+; 
+
+CREATE SEQUENCE   t072sch_comment.t072seq
+    START WITH        1
+    INCREMENT BY      1
+    MAXVALUE          10000
+    NO CYCLE
+    CACHE             20
+    --UNSIGNED INTEGER
+;
+
+
+?section comment01
+--------------------------------------------------------------------------
+
+--CREATE COMMENTS
+comment on schema     t072sch_comment                           is 'This is a new comment of SCHEMA.这是一个schema的注释。' ;
+comment on table      t072sch_comment.t072t1                    is 'This is a new comment of TABLE.这个是一个中文的table的注释。》》、……' ;
+comment on index      TRAFODION.t072sch_comment.t072idx1        is 'This is a new comment of INDEX.' ;
+comment on view       TRAFODION.t072sch_comment.t072view1       is 'This is a new comment of VIEW.' ;        
+comment on library    TRAFODION.t072sch_comment.t072ddl         is 'This is a new comment of C UDF library.' ;
+comment on library    t072sch_comment.t072jar                   is 'This is a new comment of Java SPJ library.' ;
+comment on function   t072sch_comment.t072func                  is 'This is a new comment of SCALAR UDF.' ;
+comment on procedure  t072sch_comment.t072spj                   is 'This is a new comment of SPJ.' ;
+comment on sequence   t072sch_comment.t072seq                   is 'This is a new comment of SEQUENCE.' ;
+
+comment on column     t072sch_comment.t072t1.col1               is 'This is a T01 column new comment of table.' ;
+comment on column     t072sch_comment.t072t1.col2               is 'This is a T02 column new comment of table.' ;
+comment on column     t072sch_comment.t072t1.col3               is 'This is a T03 column new comment of table.' ;
+comment on column     t072sch_comment.t072view1.col1            is 'This is a V01 column new comment of view.' ;
+comment on column     t072sch_comment.t072view1.col2            is 'This is a V02 column new comment of view.' ;
+comment on column     t072sch_comment.t072view1.col3            is 'This is a V03 column new comment of view.大家好。' ;
+
+
+?section comment02
+--------------------------------------------------------------------------
+
+--MODIFY COMMENTS
+comment on schema     t072sch_comment                           is 'This is a Modified comment: This is a comment of SCHEMA.这是一个schema的注释。' ;
+comment on table      t072sch_comment.t072t1                    is 'This is a Modified comment: This is a comment of TABLE.这个是一个中文的table的注释。》》、……' ;
+comment on index      t072sch_comment.t072idx1                  is '这个是修改过后的索引注释' ;
+comment on view       t072sch_comment.t072view1                 is 'This is a Modified time 01: This is a comment of VIEW.你好' ;
+comment on view       t072sch_comment.t072view1                 is 'This is a Modified time 02: This is a comment of VIEW.你好' ;
+comment on view       t072sch_comment.t072view1                 is 'This is a Modified time 03: This is a comment of VIEW.你好' ;
+comment on view       t072sch_comment.t072view1                 is 'This is a Modified time 04: This is a comment of VIEW.你好' ;
+comment on library    t072sch_comment.t072ddl                   is 'This is a Modified comment: This is a comment of C UDF library.' ;
+comment on library    t072sch_comment.t072jar                   is 'This is a Modified comment: This is a comment of Java SPJ library.' ;
+--max comment length
+comment on function   t072sch_comment.t072func                  is 'This is a Modified big comment: nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnulln
 ullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnul' ;
+comment on procedure  t072sch_comment.t072spj                   is 'This is a Modified comment: This is a comment of SPJ.' ;
+comment on sequence   t072sch_comment.t072seq                   is 'This is a Modified comment: This is a comment of SEQUENCE.' ;
+
+comment on column     t072sch_comment.t072t1.col3               is 'This is a Modified time 01: This is a T03 column comment of table.' ;
+comment on column     t072sch_comment.t072t1.col3               is 'This is a Modified time 02: This is a T03 column comment of table.' ;
+comment on column     t072sch_comment.t072t1.col1               is 'This is a Modified comment: This is a T01 column comment of table.' ;
+comment on column     TRAFODION.t072sch_comment.t072t1.col2     is 'This is a Modified comment: This is a T02 column comment of table.' ;
+comment on column     TRAFODION.t072sch_comment.t072t1.col3     is 'This is a Modified time 03: This is a T03 column comment of table.' ;
+comment on column     t072sch_comment.t072t1.col3               is 'This is a Modified time 04: This is a T03 column comment of table.' ;
+comment on column     t072sch_comment.t072t1.col3               is 'This is a Modified time 05: This is a T03 column comment of table.' ;
+
+comment on column     t072sch_comment.t072view1.col1         is 'This is a Modified comment: This is a V01 column comment of view.' ;
+comment on column     t072sch_comment.t072view1.col2         is 'This is a Modified comment: This is a V02 column comment of view.' ;
+comment on column     t072sch_comment.t072view1.col3         is 'This is a Modified big comment: nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
 nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnul' ;
+
+
+
+?section comment03
+--------------------------------------------------------------------------
+
+--COMMENTS MAINTAIN WITH COLUMN ALTERED
+alter table t072sch_comment.t072t1  add column col4 int ;
+alter table t072sch_comment.t072t1  add column col5 int ;
+
+drop view t072sch_comment.t072view1;
+comment on column    t072sch_comment.t072t1.col5        is 'This is a new column added by alter cmd' ;
+
+alter table t072sch_comment.t072t1  drop column col2 ;
+
+
+
+?section comment04
+--------------------------------------------------------------------------
+
+--DROP COMMENTS
+comment on table      t072sch_comment.t072t1                    is '' ;
+comment on index      t072sch_comment.t072idx1                  is '' ;
+comment on library    t072sch_comment.t072jar                   is '' ;
+comment on function   t072sch_comment.t072func                  is '' ;
+comment on procedure  t072sch_comment.t072spj                   is '' ;
+
+comment on column     t072sch_comment.t072t1.col1               is '' ;
+
+
+
+?section comment05
+--------------------------------------------------------------------------
+
+--COMMENT FAILURES
+comment on schema non_existing is            'TEST' ;
+comment on table  non_existing is            'TEST' ;
+comment on index  non_existing is            'TEST' ;
+comment on view   non_existing is            'TEST' ;
+comment on library non_existing is           'TEST' ;
+comment on function non_existing is          'TEST' ;
+comment on sequence non_exsiting is          'TEST' ;
+comment on column non_existing.col is        'TEST' ;
+comment on column t072sch_comment.t072t1.non_existing is 'TEST' ;
+
+comment on table  t072sch_comment.t072t1 is           'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ;  --length 1001
+
+
+
+?section showcomment
+--------------------------------------------------------------------------
+
+select * from "_MD_".OBJECT_COMMENT_VIEW where schema_name = UPPER('t072sch_comment');
+
+select * from "_MD_".COLUMN_COMMENT_VIEW where schema_name = UPPER('t072sch_comment');
+
+
+?section showddl1
+--------------------------------------------------------------------------
+
+showddl schema       t072sch_comment;
+showddl table        t072sch_comment.t072t1;
+showddl table        t072sch_comment.t072view1;
+showddl library      t072sch_comment.t072ddl;
+showddl library      t072sch_comment.t072jar;
+showddl function     t072sch_comment.t072func;
+showddl procedure    t072sch_comment.t072spj;
+showddl sequence     t072sch_comment.t072seq;
+
+
+?section showddl2
+--------------------------------------------------------------------------
+
+showddl schema       t072sch_comment;
+showddl table        t072sch_comment.t072t1;
+showddl library      t072sch_comment.t072ddl;
+showddl library      t072sch_comment.t072jar;
+showddl function     t072sch_comment.t072func;
+showddl procedure    t072sch_comment.t072spj;
+showddl sequence     t072sch_comment.t072seq;
+
+
+?section clnup
+--------------------------------------------------------------------------
+
+-- CLEANUP database
+drop schema IF EXISTS t072sch_comment cascade;
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/compGeneral/TEST072.cpp
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST072.cpp b/core/sql/regress/compGeneral/TEST072.cpp
new file mode 100644
index 0000000..1cca16d
--- /dev/null
+++ b/core/sql/regress/compGeneral/TEST072.cpp
@@ -0,0 +1,20 @@
+#include "sqludr.h"
+
+SQLUDR_LIBFUNC SQLUDR_INT32 add2(SQLUDR_INT32 *in1,
+                                 SQLUDR_INT32 *in2,
+                                 SQLUDR_INT32 *out1,
+                                 SQLUDR_INT16 *inInd1,
+                                 SQLUDR_INT16 *inInd2,
+                                 SQLUDR_INT16 *outInd1,
+                                 SQLUDR_TRAIL_ARGS)
+{
+  if (calltype == SQLUDR_CALLTYPE_FINAL)
+    return SQLUDR_SUCCESS;
+  if (SQLUDR_GETNULLIND(inInd1) == SQLUDR_NULL ||
+      SQLUDR_GETNULLIND(inInd2) == SQLUDR_NULL)
+    SQLUDR_SETNULLIND(outInd1);
+  else
+    (*out1) = (*in1) + (*in2);
+  return SQLUDR_SUCCESS;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/compGeneral/TEST072.java
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST072.java b/core/sql/regress/compGeneral/TEST072.java
new file mode 100644
index 0000000..c9e1361
--- /dev/null
+++ b/core/sql/regress/compGeneral/TEST072.java
@@ -0,0 +1,32 @@
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class TEST072 {
+
+        public static void testMoreResultSet(ResultSet[] rs0,ResultSet[] rs1,ResultSet[] rs2,ResultSet[] rs3,ResultSet[] rs4) {
+            try {
+                    Connection conn =   DriverManager.getConnection( "jdbc:default:connection" );
+                    System.out.println("*******************");
+                    PreparedStatement pstmt0 =
+                                    conn.prepareStatement("select * from qa_jdbc_statement.testGetMoreResults");
+                    rs0[0] = pstmt0.executeQuery();
+                    PreparedStatement pstmt1 =
+                                    conn.prepareStatement("select count(*) from qa_jdbc_statement.testGetMoreResults");
+                    rs1[0]= pstmt1.executeQuery();
+                    PreparedStatement pstmt2 =
+                                    conn.prepareStatement("select c_char from qa_jdbc_statement.testGetMoreResults");
+                    rs2[0]= pstmt2.executeQuery();
+                    PreparedStatement pstmt3 = conn.prepareStatement("select c_integer from qa_jdbc_statement.testGetMoreResults");
+                    rs3[0]= pstmt3.executeQuery();
+                    PreparedStatement pstmt4 = conn.prepareStatement("select c_integer from qa_jdbc_statement.testGetMoreResults where c_integer<10");
+                    rs4[0]= pstmt4.executeQuery();
+            } catch (SQLException e) {
+                    e.printStackTrace();
+            }
+        }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/tools/runregr_compGeneral.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_compGeneral.ksh b/core/sql/regress/tools/runregr_compGeneral.ksh
index d151f51..5199396 100755
--- a/core/sql/regress/tools/runregr_compGeneral.ksh
+++ b/core/sql/regress/tools/runregr_compGeneral.ksh
@@ -205,7 +205,7 @@ fi
 
 # sbtestfiles contains the list of tests to be run in seabase mode
 if [ "$seabase" -ne 0 ]; then
-  sbtestfiles="TEST001 TEST004 TEST005 TEST006 TEST011 TEST012 TEST013 TEST015 TEST023 TEST071 TEST042 TEST043 TEST045 TESTTOK TESTTOK2 TEST062"
+  sbtestfiles="TEST001 TEST004 TEST005 TEST006 TEST011 TEST012 TEST013 TEST015 TEST023 TEST071 TEST072 TEST042 TEST043 TEST045 TESTTOK TESTTOK2 TEST062"
   sbprettyfiles=
   for i in $prettyfiles; do
     for j in $sbtestfiles; do
@@ -382,6 +382,9 @@ cp $REGRTSTDIR/FILTER042 $REGRRUNDIR 2>$NULL
 echo "copying FILTER045 to $REGRRUNDIR"
 cp $REGRTSTDIR/FILTER045 $REGRRUNDIR 2>$NULL
 
+echo "copying FILTER072 to $REGRRUNDIR"
+cp $REGRTSTDIR/FILTER072 $REGRRUNDIR 2>$NULL
+
 if [ $diffOnly -eq 0 ]; then
    if [ "$REGRTSTDIR" != "$REGRRUNDIR" ]; then
       echo "copying FILTER_TIME.AWK to $REGRRUNDIR"


[4/4] incubator-trafodion git commit: Merge [2803] Add regression test for COMMENT ON pr# 1327

Posted by rm...@apache.org.
Merge [2803] Add regression test for COMMENT ON pr# 1327


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7acdca64
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7acdca64
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7acdca64

Branch: refs/heads/master
Commit: 7acdca64dfc707a8de4247eada2543c1aaea22d0
Parents: 625cd8a 59e2f05
Author: Roberta Marton <rm...@edev07.esgyn.local>
Authored: Thu Dec 14 01:07:48 2017 +0000
Committer: Roberta Marton <rm...@edev07.esgyn.local>
Committed: Thu Dec 14 01:07:48 2017 +0000

----------------------------------------------------------------------
 core/sql/regress/compGeneral/EXPECTED072       | 1154 +++++++++++++++++++
 core/sql/regress/compGeneral/FILTER072         |   17 +
 core/sql/regress/compGeneral/TEST072           |  261 +++++
 core/sql/regress/compGeneral/TEST072.cpp       |   20 +
 core/sql/regress/compGeneral/TEST072.java      |   32 +
 core/sql/regress/tools/runregr_compGeneral.ksh |    5 +-
 6 files changed, 1488 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[3/4] incubator-trafodion git commit: add regression test for COMMENT-ON statement

Posted by rm...@apache.org.
add regression test for COMMENT-ON statement


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/59e2f051
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/59e2f051
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/59e2f051

Branch: refs/heads/master
Commit: 59e2f051a061435c16b19e5c11556d4ce5ce08b2
Parents: 7495377
Author: EEDY <cq...@gmail.com>
Authored: Wed Dec 6 14:43:25 2017 +0800
Committer: EEDY <cq...@gmail.com>
Committed: Wed Dec 13 09:46:41 2017 +0800

----------------------------------------------------------------------
 core/sql/regress/compGeneral/EXPECTED072       | 1154 +++++++++++++++++++
 core/sql/regress/compGeneral/FILTER072         |   17 +
 core/sql/regress/compGeneral/TEST072           |  261 +++++
 core/sql/regress/compGeneral/TEST072.cpp       |   20 +
 core/sql/regress/compGeneral/TEST072.java      |   32 +
 core/sql/regress/tools/runregr_compGeneral.ksh |    5 +-
 6 files changed, 1488 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[2/4] incubator-trafodion git commit: add regression test for COMMENT-ON statement

Posted by rm...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/59e2f051/core/sql/regress/compGeneral/EXPECTED072
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED072 b/core/sql/regress/compGeneral/EXPECTED072
new file mode 100644
index 0000000..14a4357
--- /dev/null
+++ b/core/sql/regress/compGeneral/EXPECTED072
@@ -0,0 +1,1154 @@
+>>
+>>obey TEST072(clnup);
+>>--------------------------------------------------------------------------
+>>
+>>-- CLEANUP database
+>>drop schema IF EXISTS t072sch_comment cascade;
+
+--- SQL operation complete.
+>>
+>>obey TEST072(compile_libs);
+>>--------------------------------------------------------------------------
+>>log;
+------------------------------------------------------------------------------
+-- Compiling Java source files: TEST072.java
+-- Executing: $javac -d $REGRRUNDIR $REGRTSTDIR/TEST072.java
+-- $javac returned 0
+------------------------------------------------------------------------------
+------------------------------------------------------------------------------
+-- Archiving Java class files:
+--    TEST072.class
+-- Archive will be written to: TEST072.jar
+-- Executing: $jar cMf TEST072.jar TEST072.class
+-- $jar returned 0
+------------------------------------------------------------------------------
+>>
+>>
+>>obey TEST072(ddl);
+>>--------------------------------------------------------------------------
+>>
+>>create schema t072sch_comment;
+
+--- SQL operation complete.
+>>
+>>create table t072sch_comment.t072t1 ( col1 int not null, col2 DECIMAL(10, 4) not null, col3 VARCHAR(50) not null, primary key (col1) );
+
+--- SQL operation complete.
+>>
+>>create index t072idx1 on t072sch_comment.t072t1 (col1, col3);
+
+--- SQL operation complete.
+>>
+>>create view  t072sch_comment.t072view1 as select * from t072sch_comment.t072t1;
+
+--- SQL operation complete.
+>>
+>>create library t072sch_comment.t072ddl file $$QUOTE$$ $$REGRRUNDIR$$/$$DLL$$ $$QUOTE$$;
+
+--- SQL operation complete.
+>>
+>>create library t072sch_comment.t072jar file $$QUOTE$$ $$REGRRUNDIR$$/$$SPJJAR$$ $$QUOTE$$;
+
+--- SQL operation complete.
+>>
+>>
+>>create function t072sch_comment.t072func(int,int) returns (add2 int)
++>    external name 'add2' library t072sch_comment.t072ddl
++>    deterministic no sql no transaction required
++>;
+
+--- SQL operation complete.
+>>
+>>create procedure t072sch_comment.t072spj()
++>    external name 'TEST072.testMoreResultSet'
++>    library t072sch_comment.t072jar
++>    language  java 
++>    DYNAMIC RESULT SETS 5
++>    READS SQL DATA
++>;
+
+--- SQL operation complete.
+>>
+>>CREATE SEQUENCE   t072sch_comment.t072seq
++>    START WITH        1
++>    INCREMENT BY      1
++>    MAXVALUE          10000
++>    NO CYCLE
++>    CACHE             20
++>    --UNSIGNED INTEGER
++>;
+
+--- SQL operation complete.
+>>
+>>
+>>
+>>obey TEST072(comment01);
+>>--------------------------------------------------------------------------
+>>
+>>--CREATE COMMENTS
+>>comment on schema     t072sch_comment                           is 'This is a new comment of SCHEMA.这是一个schema的注释。' ;
+
+--- SQL operation complete.
+>>comment on table      t072sch_comment.t072t1                    is 'This is a new comment of TABLE.这个是一个中文的table的注释。》》、……' ;
+
+--- SQL operation complete.
+>>comment on index      TRAFODION.t072sch_comment.t072idx1        is 'This is a new comment of INDEX.' ;
+
+--- SQL operation complete.
+>>comment on view       TRAFODION.t072sch_comment.t072view1       is 'This is a new comment of VIEW.' ;
+
+--- SQL operation complete.
+>>comment on library    TRAFODION.t072sch_comment.t072ddl         is 'This is a new comment of C UDF library.' ;
+
+--- SQL operation complete.
+>>comment on library    t072sch_comment.t072jar                   is 'This is a new comment of Java SPJ library.' ;
+
+--- SQL operation complete.
+>>comment on function   t072sch_comment.t072func                  is 'This is a new comment of SCALAR UDF.' ;
+
+--- SQL operation complete.
+>>comment on procedure  t072sch_comment.t072spj                   is 'This is a new comment of SPJ.' ;
+
+--- SQL operation complete.
+>>comment on sequence   t072sch_comment.t072seq                   is 'This is a new comment of SEQUENCE.' ;
+
+--- SQL operation complete.
+>>
+>>comment on column     t072sch_comment.t072t1.col1               is 'This is a T01 column new comment of table.' ;
+
+--- SQL operation complete.
+>>comment on column     t072sch_comment.t072t1.col2               is 'This is a T02 column new comment of table.' ;
+
+--- SQL operation complete.
+>>comment on column     t072sch_comment.t072t1.col3               is 'This is a T03 column new comment of table.' ;
+
+--- SQL operation complete.
+>>comment on column     t072sch_comment.t072view1.col1            is 'This is a V01 column new comment of view.' ;
+
+--- SQL operation complete.
+>>comment on column     t072sch_comment.t072view1.col2            is 'This is a V02 column new comment of view.' ;
+
+--- SQL operation complete.
+>>comment on column     t072sch_comment.t072view1.col3            is 'This is a V03 column new comment of view.大家好。' ;
+
+--- SQL operation complete.
+>>
+>>
+>>obey TEST072(showcomment);
+>>--------------------------------------------------------------------------
+>>
+>>select * from "_MD_".OBJECT_COMMENT_VIEW where schema_name = UPPER('t072sch_comment');
+
+CATALOG_NAME                                                                                                                                                                                                                                                      SCHEMA_NAME                                                                                                                                                                                                                                                       OBJECT_NAME                                                                                                                                                                                                                                                       COMMENT
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   __SCHEMA__                                                                                                                                                                                                                                                        This is a new comment of SCHEMA.这是一个schema的注释。                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072T1                                                                                                                                                                                                                                                            This is a new comment of TABLE.这个是一个中文的table的注释。》》、……                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072IDX1                                                                                                                                                                                                                                                          This is a new comment of INDEX.                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072VIEW1                                                                                                                                                                                                                                                         This is a new comment of VIEW.                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072DDL                                                                                                                                                                                                                                                           This is a new comment of C UDF library.                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072JAR                                                                                                                                                                                                                                                           This is a new comment of Java SPJ library.                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+TRAFODION                                                                                                                                                                                                                                                         T072SCH_COMMENT                                                                                                                                                                                                                                                   T072FUNC                                                                                                                                                                                                                                                          This is a new comment of SCALAR UDF.                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

<TRUNCATED>