[4/4] incubator-trafodion git commit: Merge [TRAFODION-2265] PR 750 ex_conv_clause::findInstruction() linearly searches convInstrInfo[]

2016-10-18 Thread selva
Merge [TRAFODION-2265] PR 750 ex_conv_clause::findInstruction() linearly 
searches convInstrInfo[] 


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

Branch: refs/heads/master
Commit: 437108f4fe842f412c8f276591a2a1d027e835a9
Parents: b12b45e fe0cc2f
Author: selvaganesang 
Authored: Tue Oct 18 11:40:08 2016 +
Committer: selvaganesang 
Committed: Tue Oct 18 11:40:08 2016 +

--
 core/sql/cli/CliExtern.cpp|   6 ++
 core/sql/exp/exp_clause_derived.h |   6 ++
 core/sql/exp/exp_fixup.cpp| 110 +++--
 3 files changed, 117 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/437108f4/core/sql/cli/CliExtern.cpp
--



[3/4] incubator-trafodion git commit: Fix to take care of review comments by Dave Birdsall

2016-10-18 Thread selva
Fix to take care of review comments by Dave Birdsall


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

Branch: refs/heads/master
Commit: fe0cc2fff730a474bf0a1c7345261b68970283e7
Parents: fe5ca99
Author: Narendra Goyal 
Authored: Mon Oct 10 17:58:54 2016 +
Committer: Narendra Goyal 
Committed: Mon Oct 10 17:58:54 2016 +

--
 core/sql/exp/exp_fixup.cpp | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fe0cc2ff/core/sql/exp/exp_fixup.cpp
--
diff --git a/core/sql/exp/exp_fixup.cpp b/core/sql/exp/exp_fixup.cpp
index 12fa932..ed39d1e 100644
--- a/core/sql/exp/exp_fixup.cpp
+++ b/core/sql/exp/exp_fixup.cpp
@@ -1804,20 +1804,21 @@ void ex_conv_clause::populateInstrOffsetIndex()
   }
   
   // Allocate a sparsely populated array
-  sv_convIndexSparse = (int *) calloc(sizeof(int), 
- (sv_MaxOpTypeValue+1));
+  int *lv_convIndexSparse = (int *) calloc(sizeof(int), 
+  (sv_MaxOpTypeValue+1));
   // Initialize to -1
   for (j = 0; j <= sv_MaxOpTypeValue; j++) {
-sv_convIndexSparse[j] = -1;
+lv_convIndexSparse[j] = -1;
   }
   
   // Setup the sparsely populated array
   j = 0;
   while (j <= lv_MaxIndex) {
-sv_convIndexSparse[lv_convIndex[j].type_op1] = lv_convIndex[j].offset;
+lv_convIndexSparse[lv_convIndex[j].type_op1] = lv_convIndex[j].offset;
 j++;
   }
 
+  sv_convIndexSparse = lv_convIndexSparse;
   sv_instrOffsetIndexPopulated = true;
 }
 
@@ -1826,10 +1827,6 @@ void ex_conv_clause::populateInstrOffsetIndex()
  */
 int ex_conv_clause::getInstrOffset(short pv_op1)
 {
-  if (! sv_instrOffsetIndexPopulated) {
-ex_conv_clause::populateInstrOffsetIndex();
-  }
-
   if ((pv_op1 < 0) || 
   (pv_op1 > sv_MaxOpTypeValue)) {
 return -1;



[2/4] incubator-trafodion git commit: TRAFODION-2265

2016-10-18 Thread selva
TRAFODION-2265

Parse ex_conv_clause::convInstrStrInfo at sql process startup
(in sqInit) into a sparsely populated index for quick reference by
ex_conv_clause::findInstruction.


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

Branch: refs/heads/master
Commit: fe5ca994159bd59fd9f15603a5e37df959c7f0ca
Parents: 9278776
Author: Narendra Goyal 
Authored: Sat Oct 8 18:11:26 2016 +
Committer: Narendra Goyal 
Committed: Sat Oct 8 18:11:26 2016 +

--
 core/sql/exp/exp_fixup.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fe5ca994/core/sql/exp/exp_fixup.cpp
--
diff --git a/core/sql/exp/exp_fixup.cpp b/core/sql/exp/exp_fixup.cpp
index a5ad20d..12fa932 100644
--- a/core/sql/exp/exp_fixup.cpp
+++ b/core/sql/exp/exp_fixup.cpp
@@ -1830,7 +1830,8 @@ int ex_conv_clause::getInstrOffset(short pv_op1)
 ex_conv_clause::populateInstrOffsetIndex();
   }
 
-  if ((pv_op1 < 0) && (pv_op1 > sv_MaxOpTypeValue)) {
+  if ((pv_op1 < 0) || 
+  (pv_op1 > sv_MaxOpTypeValue)) {
 return -1;
   }
 



[1/4] incubator-trafodion git commit: TRAFODION-2265

2016-10-18 Thread selva
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master b12b45eca -> 437108f4f


TRAFODION-2265

Parse ex_conv_clause::convInstrStrInfo at sql process startup
(in sqInit) into a sparsely populated index for quick reference by
ex_conv_clause::findInstruction.


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

Branch: refs/heads/master
Commit: 9278776aba5db83cbfb8ecdeb14ede68cbce7e73
Parents: 5cd718a
Author: Narendra Goyal 
Authored: Sat Oct 8 17:58:39 2016 +
Committer: Narendra Goyal 
Committed: Sat Oct 8 17:58:39 2016 +

--
 core/sql/cli/CliExtern.cpp|   6 ++
 core/sql/exp/exp_clause_derived.h |   6 ++
 core/sql/exp/exp_fixup.cpp| 112 +++--
 3 files changed, 119 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9278776a/core/sql/cli/CliExtern.cpp
--
diff --git a/core/sql/cli/CliExtern.cpp b/core/sql/cli/CliExtern.cpp
index b424661..37c2f66 100644
--- a/core/sql/cli/CliExtern.cpp
+++ b/core/sql/cli/CliExtern.cpp
@@ -44,6 +44,7 @@
 #include "cli_stdh.h"
 
 #include "ExpError.h"
+#include "exp_clause_derived.h"
 #include "NLSConversion.h"
 
 #include "Cli.h"
@@ -911,6 +912,11 @@ short sqInit()
   cerr << "Error while initializing messaging system. Exiting..." << endl;
   exit(1);
 }
+
+
+// Initialize an Instruction Info array's offset index
+ex_conv_clause::populateInstrOffsetIndex();
+
   }
 
   return 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9278776a/core/sql/exp/exp_clause_derived.h
--
diff --git a/core/sql/exp/exp_clause_derived.h 
b/core/sql/exp/exp_clause_derived.h
index 48b73c7..1104e46 100644
--- a/core/sql/exp/exp_clause_derived.h
+++ b/core/sql/exp/exp_clause_derived.h
@@ -1744,6 +1744,12 @@ public:
   static const ConvInstruction getInstruction(Lng32 index) 
   { return convInstrInfo[index].instruction;}
 
+  static bool  sv_instrOffsetIndexPopulated;
+  static short sv_MaxOpTypeValue;
+  static int   *sv_convIndexSparse;
+  static void  populateInstrOffsetIndex();
+  static int   getInstrOffset(short pv_op1);
+
   Lng32 findIndexIntoInstrArray(ConvInstruction ci);
 
   NA_EIDPROC NABoolean treatAllSpacesAsZero()

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9278776a/core/sql/exp/exp_fixup.cpp
--
diff --git a/core/sql/exp/exp_fixup.cpp b/core/sql/exp/exp_fixup.cpp
index f9de28c..a5ad20d 100644
--- a/core/sql/exp/exp_fixup.cpp
+++ b/core/sql/exp/exp_fixup.cpp
@@ -1264,6 +1264,10 @@ const ex_conv_clause::ConvInstrStruct 
ex_conv_clause::convInstrInfo[] = {
   //---
   // src datatype  tgt datatypeinstruction and indexStr
   //---
+  {REC_UNKNOWN,REC_UNKNOWN,
instrAndText(CONV_COMPLEX_TO_COMPLEX)},
+  {REC_UNKNOWN,REC_UNKNOWN,
instrAndText(CONV_SIMPLE_TO_COMPLEX)},
+  {REC_UNKNOWN,REC_UNKNOWN,
instrAndText(CONV_COMPLEX_TO_SIMPLE)},
+
   {REC_BPINT_UNSIGNED, REC_BPINT_UNSIGNED, 
instrAndText(CONV_BPINTU_BPINTU)},
   {REC_BPINT_UNSIGNED, REC_BIN16_SIGNED,  
instrAndText(CONV_BIN16U_BIN16S)},
   {REC_BPINT_UNSIGNED, REC_BIN16_UNSIGNED, 
instrAndText(CONV_BIN16U_BIN16U)},
@@ -1718,9 +1722,6 @@ const ex_conv_clause::ConvInstrStruct 
ex_conv_clause::convInstrInfo[] = {
   {REC_BOOLEAN,   REC_BYTE_F_ASCII,  instrAndText(CONV_BOOL_ASCII)},
   {REC_BOOLEAN,   REC_BYTE_V_ASCII,  instrAndText(CONV_BOOL_ASCII)},
 
-  {REC_UNKNOWN,   REC_UNKNOWN,   
instrAndText(CONV_COMPLEX_TO_COMPLEX)},
-  {REC_UNKNOWN,   REC_UNKNOWN,   
instrAndText(CONV_SIMPLE_TO_COMPLEX)},
-  {REC_UNKNOWN,   REC_UNKNOWN,   
instrAndText(CONV_COMPLEX_TO_SIMPLE)},
 };
 
 Lng32 ex_conv_clause::findIndexIntoInstrArray(ConvInstruction ci)
@@ -1740,6 +1741,102 @@ Lng32 
ex_conv_clause::findIndexIntoInstrArray(ConvInstruction ci)
   return -1; // not found
 }
 
+bool   ex_conv_clause::sv_instrOffsetIndexPopulated = false;
+short  ex_conv_clause::sv_MaxOpTypeValue = -1;
+int   *ex_conv_clause::sv_convIndexSparse = 0;
+
+/* 
+ * Scans convInstrInfo[] and populates a 
+ * sparsely populated index: sv_convIndexSparse. 
+ * 
+ * For a given op type: op_type, 
+ * if (sv_convIndexSpa

[2/2] incubator-trafodion git commit: merge [TRAFODION-1758] PR 765 A user has dbroot role can't grant component privilege

2016-10-18 Thread rmarton
merge [TRAFODION-1758] PR 765 A user has dbroot role can't grant component 
privilege


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

Branch: refs/heads/master
Commit: 8805eb26ce2a9cda273a6f1d19a0e48ed6b2bb6e
Parents: 437108f 1c93857
Author: Roberta Marton 
Authored: Tue Oct 18 15:20:07 2016 +
Committer: Roberta Marton 
Committed: Tue Oct 18 15:20:07 2016 +

--
 core/sql/parser/sqlparser.y |   11 -
 core/sql/regress/privs1/EXPECTED120 | 1222 ++
 core/sql/regress/privs1/EXPECTED137 |  216 +++-
 core/sql/regress/privs1/TEST120 |  379 ++
 core/sql/regress/privs1/TEST137 |   53 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp |   76 +-
 6 files changed, 1910 insertions(+), 47 deletions(-)
--




[1/2] incubator-trafodion git commit: [TRAFODION-1758]: A user has dbroot role can't grant component privilege

2016-10-18 Thread rmarton
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 437108f4f -> 8805eb26c


[TRAFODION-1758]: A user has dbroot role can't grant component privilege

Privilege checks were not handling role checks correctly.
PrivMgrComponentPrivileges::hasWGO is now checking privileges against roles.
privs1/TEST137 was updated to test role privileges
priv1/TEST120  was added to test query invalidation with roles
   (forgot to add it for a previous check in)


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

Branch: refs/heads/master
Commit: 1c93857502acd9ef9e14154df6a6e397284acc81
Parents: b12b45e
Author: Roberta Marton 
Authored: Mon Oct 17 20:30:59 2016 +
Committer: Roberta Marton 
Committed: Mon Oct 17 20:30:59 2016 +

--
 core/sql/parser/sqlparser.y |   11 -
 core/sql/regress/privs1/EXPECTED120 | 1222 ++
 core/sql/regress/privs1/EXPECTED137 |  216 +++-
 core/sql/regress/privs1/TEST120 |  379 ++
 core/sql/regress/privs1/TEST137 |   53 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp |   76 +-
 6 files changed, 1910 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1c938575/core/sql/parser/sqlparser.y
--
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index b498108..8bd9a0b 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -27691,13 +27691,6 @@ revoke_role_statement : TOK_REVOKE 
optional_with_admin_option
optional_drop_behavior
optional_granted_by
 {
-  // revoke_role_statement ::= TOK_REVOKE 
optional_with_admin_option TOK_ROLE authorization_identifier_list TOK_FROM 
grantee_list optional_granted_by
-
-  //if ($2 /* optional_with_admin_option */ == TRUE)
-  //{
-  //  YYERROR;
-  //}
-
   $$ = new (PARSERHEAP())
 StmtDDLRoleGrant(
 $4 , /* authorization_identifier_list - role 
list */
@@ -27855,10 +27848,6 @@ grant_role_statement : TOK_GRANT TOK_ROLE 
authorization_identifier_list TOK_TO g
  optional_with_admin_option
  optional_granted_by
{
-  //if($6 /* optional_with_admin_option */ == TRUE) // 
"with admin option" specified
- //{
-  //YYERROR;
-  //}
   $$ = new (PARSERHEAP())
   StmtDDLRoleGrant(
 $3 , /*role list*/ 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1c938575/core/sql/regress/privs1/EXPECTED120
--
diff --git a/core/sql/regress/privs1/EXPECTED120 
b/core/sql/regress/privs1/EXPECTED120
new file mode 100644
index 000..d60f4f5
--- /dev/null
+++ b/core/sql/regress/privs1/EXPECTED120
@@ -0,0 +1,1222 @@
+>>obey TEST120(tests);
+>>-- =
+>>-- Design:
+>>--t120role1 - owns schema t120sch 
+>>--t120role2 - contains grants against teams and games
+>>--t120role3 - contains grants against teams, games, and standings
+>>--t120role4 - control, has no privs granted, make sure revoking
+>>--role does not cause recompilations
+>>--
+>>--sql_user3 - is schema administrator for schema t120sch
+>>--sql_user6 - is granted and revoked privileges directly and
+>>--through t120role2 and t120role3
+>>--sql_user9 - control, makes sure revokes from roles does not
+>>--affect sql_user9's compiled queries
+>>--
+>>--games - multiple roles giving same privileges
+>>--teams - multiple privileges through different roles
+>>--players   - control, not roles involved in privileges
+>>--standings - used to test sequence privileges and revoke role
+>>--stats - tests revoke PUBLIC authorization ID
+>>-- =
+>>obey TEST120(create_db);
+>>create role t120role1;
+
+--- SQL operation complete.
+>>create role t120role2;
+
+--- SQL operation complete.
+>>create role t120r

[1/2] incubator-trafodion git commit: [TRAFODION-1698]ODBC: trafodon doesn't support SQLForeginKeys

2016-10-18 Thread dbirdsall
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 8805eb26c -> cc915f3ff


[TRAFODION-1698]ODBC: trafodon doesn't support SQLForeginKeys

Fix the error of the old implementation and add test cases for it.


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

Branch: refs/heads/master
Commit: 533b3834fd5b65028cdc812bf273eabe7de8ec35
Parents: 708f58f
Author: Weiqing Xu 
Authored: Wed Sep 28 00:53:41 2016 +
Committer: Weiqing Xu 
Committed: Thu Oct 13 12:08:44 2016 +

--
 .../odbc/src/odbc/nsksrvrcore/srvrothers.cpp|  39 ++--
 .../org/trafodion/jdbc_test/TestForeignKey.java | 224 +++
 2 files changed, 243 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/533b3834/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
--
diff --git a/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp 
b/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
index c8bf67d..b24b7e7 100644
--- a/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
+++ b/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
@@ -4963,17 +4963,17 @@ odbc_SQLSvc_GetSQLCatalogs_sme_(
 char fkexpSchemaNm[MAX_ANSI_NAME_LEN + 1];
 char fkexpTableNm[MAX_ANSI_NAME_LEN + 1];
 
-if (!checkIfWildCard(fkcatalogNm, fkcatalogNmNoEsc) ||
-!checkIfWildCard(fkschemaNm, fkschemaNmNoEsc)   ||
-!checkIfWildCard(fktableNm, fktableNmNoEsc))
-{
-exception_->exception_nr = 
odbc_SQLSvc_GetSQLCatalogs_ParamError_exn_;
-exception_->u.ParamError.ParamDesc = 
SQLSVC_EXCEPTION_WILDCARD_NOT_SUPPORTED;
-goto MapException;
-}
+if (strcmp(fktableNm, "") == 0)
+strcpy((char *)fktableNm, "%");
+if (strcmp(fkschemaNm, "") == 0)
+strcpy((char *)fkschemaNm, "%");
+
+convertWildcard(metadataId, TRUE, fkcatalogNm, fkexpCatalogNm);
+convertWildcardNoEsc(metadataId, TRUE, fkcatalogNm, 
fkcatalogNmNoEsc);
 
-convertWildcard(metadataId, TRUE, fkschemaNm, fkexpCatalogNm);
+convertWildcard(metadataId, TRUE, fkschemaNm, fkexpSchemaNm);
 convertWildcardNoEsc(metadataId, TRUE, fkschemaNm, 
fkschemaNmNoEsc);
+
 convertWildcard(metadataId, TRUE, fktableNm, fkexpTableNm);
 convertWildcardNoEsc(metadataId, TRUE, fktableNm, fktableNmNoEsc);
 
@@ -4982,7 +4982,7 @@ odbc_SQLSvc_GetSQLCatalogs_sme_(
 "cast(PKCO.CATALOG_NAME as varchar(128)) PKTABLE_CAT, "
 "cast(PKCO.SCHEMA_NAME as varchar(128)) PKTABLE_SCHEM, "
 "cast(PKCO.TABLE_NAME as varchar(128)) PKTABLE_NAME, "
-"cast(PKCO.COLUMN_NAME as varchar(128)) PKCOLUMNS_NAME, "
+"cast(PKCO.COLUMN_NAME as varchar(128)) PKCOLUMN_NAME, "
 "cast(FKCO.CATALOG_NAME as varchar(128)) FKTABLE_CAT, "
 "cast(PKCO.SCHEMA_NAME as varchar(128)) FKTABLE_SCHEM, "
 "cast(FKCO.TABLE_NAME as varchar(128)) FKTABLE_NAME, "
@@ -4990,9 +4990,9 @@ odbc_SQLSvc_GetSQLCatalogs_sme_(
 "cast(FKKV.ORDINAL_POSITION as smallint) KEY_SEQ, "
 "cast(0 as smallint) update_rule, " // not support
 "cast(0 as smallint) delete_rule, " // not support
-"cast(PKCO.COLUMN_NAME as varchar(128)) fk_name, "
-"cast(PKCO.COLUMN_NAME as varchar(128)) PK_NAME, "
-"cast(0 as smallint) DEFERRABILITY "
+"cast(FKKV.CONSTRAINT_NAME as varchar(128)) FK_NAME, "
+"cast(PKKV.CONSTRAINT_NAME as varchar(128)) PK_NAME, "
+"cast(0 as smallint) DEFERRABILITY " // not support
 "from "
 "TRAFODION.\"_MD_\".REF_CONSTRAINTS_VIEW rcv, "
 "TRAFODION.\"_MD_\".KEYS_VIEW PKKV, "
@@ -5000,22 +5000,21 @@ odbc_SQLSvc_GetSQLCatalogs_sme_(
 "TRAFODION.\"_MD_\".COLUMNS_VIEW PKCO, "
 "TRAFODION.\"_MD_\".COLUMNS_VIEW FKCO "
 "where "
-"PKKV.CONSTRAINT_NAME = rcv.CONSTRAINT_NAME "
-"and FKKV.CONSTRAINT_NAME = rcv.UNIQUE_CONSTRAINT_NAME "
+"FKKV.CONSTRAINT_NAME = rcv.CONSTRAINT_NAME "
+"and PKKV.CONSTRAINT_NAME = rcv.UNIQUE_CONSTRAINT_NAME "
 "and PKCO.TABLE_NAME = PKKV.TAB

[2/2] incubator-trafodion git commit: Merge [TRAFODION-1698] ODBC support for SQLForeignKeys

2016-10-18 Thread dbirdsall
Merge [TRAFODION-1698] ODBC support for SQLForeignKeys


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

Branch: refs/heads/master
Commit: cc915f3ff9644e6b80f75f3a49fc1060da1712e8
Parents: 8805eb2 533b383
Author: Dave Birdsall 
Authored: Tue Oct 18 20:45:16 2016 +
Committer: Dave Birdsall 
Committed: Tue Oct 18 20:45:16 2016 +

--
 .../odbc/src/odbc/nsksrvrcore/srvrothers.cpp|  39 ++--
 .../org/trafodion/jdbc_test/TestForeignKey.java | 224 +++
 2 files changed, 243 insertions(+), 20 deletions(-)
--




[3/4] incubator-trafodion git commit: remove env variable VCREDIST defined in build_os.bat add Integer-type return variable in Exec func in installer.iss

2016-10-18 Thread dbirdsall
remove env variable VCREDIST defined in build_os.bat
add Integer-type return variable in Exec func in installer.iss


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

Branch: refs/heads/master
Commit: da9d08ee6f0eecd1d68c12330afc029c845fcb02
Parents: cd04a84
Author: zx 
Authored: Tue Oct 18 05:26:20 2016 +
Committer: zx 
Committed: Tue Oct 18 05:26:20 2016 +

--
 win-odbc64/Install/win64_installer/installer.iss | 1 +
 win-odbc64/odbcclient/build_os.bat   | 6 +-
 2 files changed, 2 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/da9d08ee/win-odbc64/Install/win64_installer/installer.iss
--
diff --git a/win-odbc64/Install/win64_installer/installer.iss 
b/win-odbc64/Install/win64_installer/installer.iss
index 64fbec2..fc309df 100644
--- a/win-odbc64/Install/win64_installer/installer.iss
+++ b/win-odbc64/Install/win64_installer/installer.iss
@@ -149,6 +149,7 @@ var
   sDefaultBrowserValue: String;
   iQuotePos: Integer;
   lLength: Longint;
+  iRetCode: Integer;
 begin
   if CurStep=ssPostInstall then
   begin

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/da9d08ee/win-odbc64/odbcclient/build_os.bat
--
diff --git a/win-odbc64/odbcclient/build_os.bat 
b/win-odbc64/odbcclient/build_os.bat
index 284563a..480d9dc 100644
--- a/win-odbc64/odbcclient/build_os.bat
+++ b/win-odbc64/odbcclient/build_os.bat
@@ -20,10 +20,6 @@ REM under the License.
 REM
 REM @@@ END COPYRIGHT @@@
 
-
-REM download vcredist_x64.exe form 
http://www.microsoft.com/en-us/download/details.aspx?id=40784 and copy it to 
VC_REDIST_DIR.
-set VC_REDIST_DIR=C:\Build\winodbc64\redist
-
 REM set this to the directory where you want to put the driver package file
 set PACKDIR=C:\Build\winodbc64
 
@@ -174,4 +170,4 @@ if %ALL_SUCCESS%==1 (
echo BUILD WIN64 RELEASE SUCCESSFULLY
echo 
echo=
-)
\ No newline at end of file
+)



[4/4] incubator-trafodion git commit: Merge [TRAFODION-1893] PR 763 Remove vcredist from win-odbc installer

2016-10-18 Thread dbirdsall
Merge [TRAFODION-1893] PR 763 Remove vcredist from win-odbc installer


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

Branch: refs/heads/master
Commit: 196e6f496f44c27a051dc97c11b9b40e12762ea2
Parents: cc915f3 da9d08e
Author: Dave Birdsall 
Authored: Tue Oct 18 20:51:36 2016 +
Committer: Dave Birdsall 
Committed: Tue Oct 18 20:51:36 2016 +

--
 .../Install/win64_installer/installer.iss   | 53 ++--
 win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc|  8 +--
 .../odbcclient/TranslationDll/TranslationDll.rc |  8 +--
 win-odbc64/odbcclient/build_os.bat  | 10 ++--
 win-odbc64/odbcclient/drvr35/TCPIPV4/TCPIPV4.RC |  8 +--
 win-odbc64/odbcclient/drvr35/TCPIPV6/TCPIPV6.RC |  8 +--
 win-odbc64/odbcclient/drvr35/cdatasource.cpp|  2 +-
 win-odbc64/odbcclient/drvr35/drvr35.rc  |  8 +--
 win-odbc64/odbcclient/drvr35adm/drvr35adm.h |  2 +-
 win-odbc64/odbcclient/drvr35adm/drvr35adm.rc|  8 +--
 10 files changed, 67 insertions(+), 48 deletions(-)
--




[2/4] incubator-trafodion git commit: [TRAFODION-1893]-Remove vcredist from win-odbc build & Version update

2016-10-18 Thread dbirdsall
[TRAFODION-1893]-Remove vcredist from win-odbc build & Version update


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

Branch: refs/heads/master
Commit: cd04a84bca24004d89b29b7330431fb4c2727012
Parents: 78139dd
Author: zx 
Authored: Tue Oct 18 04:57:16 2016 +
Committer: zx 
Committed: Tue Oct 18 04:57:16 2016 +

--
 win-odbc64/Install/win64_installer/installer.iss   | 11 +--
 win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc   |  8 
 win-odbc64/odbcclient/TranslationDll/TranslationDll.rc |  8 
 win-odbc64/odbcclient/build_os.bat |  4 ++--
 win-odbc64/odbcclient/drvr35/TCPIPV4/TCPIPV4.RC|  8 
 win-odbc64/odbcclient/drvr35/TCPIPV6/TCPIPV6.RC|  8 
 win-odbc64/odbcclient/drvr35/cdatasource.cpp   |  2 +-
 win-odbc64/odbcclient/drvr35/drvr35.rc |  8 
 win-odbc64/odbcclient/drvr35adm/drvr35adm.h|  2 +-
 win-odbc64/odbcclient/drvr35adm/drvr35adm.rc   |  8 
 10 files changed, 33 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd04a84b/win-odbc64/Install/win64_installer/installer.iss
--
diff --git a/win-odbc64/Install/win64_installer/installer.iss 
b/win-odbc64/Install/win64_installer/installer.iss
index 90a1610..64fbec2 100644
--- a/win-odbc64/Install/win64_installer/installer.iss
+++ b/win-odbc64/Install/win64_installer/installer.iss
@@ -18,11 +18,11 @@
 ; Script generated by the Inno Script Studio Wizard.
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
-#define MyAppName "Trafodion ODBC64 1.3"
-#define MyAppVersion "1.3.0"
+#define MyAppName "Trafodion ODBC64 2.1"
+#define MyAppVersion "2.1.0"
 #define MyAppPublisher "Apache Trafodion"
 #define MyAppURL ""
-#define MyDriverName "TRAF ODBC 1.0"
+#define MyDriverName "TRAF ODBC 2.1"
 #define BUILDDIR  GetEnv('BUILDDIR')
 
 [Setup]
@@ -38,7 +38,7 @@ AppPublisherURL={#MyAppURL}
 AppSupportURL={#MyAppURL}
 AppUpdatesURL={#MyAppURL}
 DefaultGroupName={#MyAppName}
-DefaultDirName={pf}\Trafodion\TRAF ODBC 1.0
+DefaultDirName={pf}\Trafodion\TRAF ODBC 2.1
 OutputBaseFilename=TFODBC64-{#MyAppVersion}
 Compression=lzma
 SolidCompression=yes
@@ -149,14 +149,13 @@ var
   sDefaultBrowserValue: String;
   iQuotePos: Integer;
   lLength: Longint;
-  iRetCode: Integer;
 begin
   if CurStep=ssPostInstall then
   begin
 bRedistNeedsInstall := VCRedistNeedsInstall();
 if bRedistNeedsInstall=True then
 begin
-  MsgBox('Install of Visual C++ Redistributable Packages for Visual Studio 
2013 is not dectected.'+ #13#10#13#10 + 'Please download vcredist_x64.exe from 
Microsoft Download Centre and install it.', mbInformation, MB_OK);
+  MsgBox('Run-time dependency required by the driver is not found.'+ 
#13#10#13#10 + 'Proceeding to download and install run-time dependency from 
Microsoft.', mbInformation, MB_OK);
   if 
RegQueryStringValue(HKCU,'Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice','Progid',sDefaultBrowserName)
 then
   begin
 sDefaultBrowserReg := sDefaultBrowserName + '\shell\open\command';

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd04a84b/win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc
--
diff --git a/win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc 
b/win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc
index ab536cf..6f9dbc8 100644
--- a/win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc
+++ b/win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc
@@ -73,8 +73,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,3,0,0
- PRODUCTVERSION 1,3,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -91,12 +91,12 @@ BEGIN
 BEGIN
 VALUE "CompanyName", "Apache Trafodion"
 VALUE "FileDescription", "TRAF ODBC Driver Resource DLL"
-VALUE "FileVersion", "1.3.0.0"
+VALUE "FileVersion", "2.1.0.0"
 VALUE "InternalName", "TRAF ODBC Driver Resource DLL"
 VALUE "LegalCopyright", "?Copyright 2015-2016 Apache Software 
Foundation"
 VALUE "OriginalFilename", "traf_ores0100.dll"
 VALUE "ProductName", "TRAF ODBC"
-VALUE "ProductVersion", "1.3.0.0"
+VALUE "ProductVersion", "2.1.0.0"
 END
 END
 BLOCK "VarFileInfo"

http://git-wip-us.apache.org/re

[1/4] incubator-trafodion git commit: TRAFODION-1893 Remove vcredist from win-odbc build

2016-10-18 Thread dbirdsall
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master cc915f3ff -> 196e6f496


TRAFODION-1893
Remove vcredist from win-odbc build


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

Branch: refs/heads/master
Commit: 78139ddedfbf943178aa2a57136eb65bea5681c5
Parents: ea16d38
Author: rwbzx 
Authored: Fri Oct 14 17:33:02 2016 +0800
Committer: rwbzx 
Committed: Fri Oct 14 17:33:02 2016 +0800

--
 .../Install/win64_installer/installer.iss   | 45 +++-
 1 file changed, 34 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/78139dde/win-odbc64/Install/win64_installer/installer.iss
--
diff --git a/win-odbc64/Install/win64_installer/installer.iss 
b/win-odbc64/Install/win64_installer/installer.iss
index 2f7c952..90a1610 100644
--- a/win-odbc64/Install/win64_installer/installer.iss
+++ b/win-odbc64/Install/win64_installer/installer.iss
@@ -24,7 +24,6 @@
 #define MyAppURL ""
 #define MyDriverName "TRAF ODBC 1.0"
 #define BUILDDIR  GetEnv('BUILDDIR')
-#define VCREDISTDIR GetEnv('VC_REDIST_DIR')
 
 [Setup]
 ; NOTE: The value of AppId uniquely identifies this application.
@@ -49,7 +48,6 @@ UninstallDisplayName={#MyAppName}
 ArchitecturesAllowed=x64
 SetupLogging=yes
 
-
 [Languages]
 Name: "english"; MessagesFile: "compiler:Default.isl"
 
@@ -76,15 +74,6 @@ Root: HKLM; SubKey: 
Software\ODBC\ODBCINST.INI\{#MyDriverName}; ValueType: strin
 Root: HKLM; SubKey: Software\ODBC\ODBCINST.INI\{#MyDriverName}; ValueType: 
string; ValueName: CertificateDir; ValueData: SYSTEM_DEFAULT ;Flags: 
uninsdeletekey
 Root: HKLM; SubKey: Software\ODBC\ODBCINST.INI\{#MyDriverName}; ValueType: 
string; ValueName: CPTimeout; ValueData: 60 ;Flags: uninsdeletekey
 
-[Code]
-[Files]
-Source: "{#VCREDISTDIR}\vcredist_x64.exe"; DestDir: {tmp}; Flags: 
deleteafterinstall
-
-[Run]
-; add the Parameters, WorkingDir and StatusMsg as you wish, just keep here
-; the conditional installation Check
-Filename: "{tmp}\vcredist_x64.exe"; Check: VCRedistNeedsInstall
-
 [UninstallDelete]
 Type: filesandordirs; Name: "{app}"
 
@@ -152,6 +141,40 @@ begin
   Result := (GetUninstallString() <> '');
 end;
 
+procedure CurStepChanged(CurStep: TSetupStep);
+var
+  bRedistNeedsInstall: Boolean;
+  sDefaultBrowserName: String;
+  sDefaultBrowserReg: String;
+  sDefaultBrowserValue: String;
+  iQuotePos: Integer;
+  lLength: Longint;
+  iRetCode: Integer;
+begin
+  if CurStep=ssPostInstall then
+  begin
+bRedistNeedsInstall := VCRedistNeedsInstall();
+if bRedistNeedsInstall=True then
+begin
+  MsgBox('Install of Visual C++ Redistributable Packages for Visual Studio 
2013 is not dectected.'+ #13#10#13#10 + 'Please download vcredist_x64.exe from 
Microsoft Download Centre and install it.', mbInformation, MB_OK);
+  if 
RegQueryStringValue(HKCU,'Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice','Progid',sDefaultBrowserName)
 then
+  begin
+sDefaultBrowserReg := sDefaultBrowserName + '\shell\open\command';
+if 
RegQueryStringValue(HKCR,sDefaultBrowserReg,'',sDefaultBrowserValue) then
+begin
+  iQuotePos := Pos('"',sDefaultBrowserValue);
+  Delete(sDefaultBrowserValue,iQuotePos,1);
+  lLength := Length(sDefaultBrowserValue);
+  iQuotePos := Pos('"',sDefaultBrowserValue);
+  Delete(sDefaultBrowserValue,iQuotePos,lLength);
+  Exec(sDefaultBrowserValue, 
'http://www.microsoft.com/en-us/download/details.aspx?id=40784', '', SW_SHOW, 
ewNoWait, iRetCode)
+end
+  end
+end
+  end
+end;   
+
+
 function InitializeSetup: Boolean;
 var
   V: Integer;