You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/02/10 17:48:01 UTC

[1/2] incubator-trafodion git commit: Disallow UPDATE STATS in a user transaction

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 972615b1e -> e9d21463f


Disallow UPDATE STATS in a user transaction


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

Branch: refs/heads/master
Commit: 6073986a03d19be327619976559e59772b43c9e7
Parents: 93f1045
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Feb 9 21:15:40 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Feb 9 21:15:40 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt | 1 +
 core/sql/ustat/hs_const.h    | 1 +
 core/sql/ustat/hs_update.cpp | 9 +++++++++
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6073986a/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index b5a2d8c..a08db70 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -1870,6 +1870,7 @@ drop the default context
 9241 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Insufficient privileges to perform the statistics request for table $0~String0.
 9242 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Unable to create schema for Hive statistics.
 9243 ZZZZZ 99999 BEGINNER MAJOR DBADMIN This UPDATE STATISTICS command may take too long. It is recommended to use the SAMPLE clause instead. If you wish to do this without a SAMPLE clause, specify NO SAMPLE explicitly.
+9244 ZZZZZ 99999 BEGINNER MAJOR DBADMIN UPDATE STATISTICS is not allowed in a user transaction.
 9250 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Last UPDATE STATISTICS error.
 10000 ZZZZZ 99999 UUUUUUUU UUUUU UUUUUUU Sort Error: First Sort error
 10001 ZZZZZ 99999 ADVANCED MAJOR DIALOUT Sort Error : No error text defined. Unexpected error. $0~String0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6073986a/core/sql/ustat/hs_const.h
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_const.h b/core/sql/ustat/hs_const.h
index ac387ae..3143a1a 100644
--- a/core/sql/ustat/hs_const.h
+++ b/core/sql/ustat/hs_const.h
@@ -167,6 +167,7 @@ enum USTAT_ERROR_CODES {UERR_SYNTAX_ERROR                    = 15001,
                         UERR_NO_PRIVILEGE                    = 9241,
                         UERR_CANT_CREATE_HIVE_STATS_SCHEMA   = 9242,
                         UERR_YOU_WILL_LIKELY_BE_SORRY        = 9243,
+                        UERR_USER_TRANSACTION                = 9244,
                         UERR_NO_ERROR                        = 9250,
                         UERR_LAST_ERROR                      = 9250
                        };

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6073986a/core/sql/ustat/hs_update.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_update.cpp b/core/sql/ustat/hs_update.cpp
index c762877..5b2471d 100644
--- a/core/sql/ustat/hs_update.cpp
+++ b/core/sql/ustat/hs_update.cpp
@@ -189,6 +189,15 @@ Lng32 UpdateStats(char *input, NABoolean requestedByCompiler)
     HSColGroupStruct::allocCount = 1;  // start at 1 for each new statement
 #endif
 
+    // Disallow UPDATE STATS in a user transaction
+    HSTranMan *TM = HSTranMan::Instance();
+    if (TM->InTransaction())
+      {
+        HSFuncMergeDiags(-UERR_USER_TRANSACTION);
+        retcode = -1;
+        HSExitIfError(retcode);
+      }
+
 
                                              /*==============================*/
                                              /*       PARSE STATEMENT        */


[2/2] incubator-trafodion git commit: Merge [TRAFODION-1819] PR 313 Disallow UPDATE STATS in a user transaction

Posted by db...@apache.org.
Merge [TRAFODION-1819] PR 313 Disallow UPDATE STATS in a user transaction


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

Branch: refs/heads/master
Commit: e9d21463f4feb82a47ed5dde8a7a21cacc5f2aa3
Parents: 972615b 6073986
Author: Dave Birdsall <db...@apache.org>
Authored: Wed Feb 10 16:47:10 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Wed Feb 10 16:47:10 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt | 1 +
 core/sql/ustat/hs_const.h    | 1 +
 core/sql/ustat/hs_update.cpp | 9 +++++++++
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------