hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [4/4] hive git commit: HIVE-12832 A bunch of thrift and RDBMS changes for ACID fixes.
Date Thu, 14 Jan 2016 19:47:03 GMT
HIVE-12832 A bunch of thrift and RDBMS changes for ACID fixes.


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

Branch: refs/heads/master
Commit: fe5cd560ca86e6f394749f13f327477452daacc8
Parents: 1ff3b14
Author: Alan Gates <gates@hortonworks.com>
Authored: Thu Jan 14 11:35:17 2016 -0800
Committer: Alan Gates <gates@hortonworks.com>
Committed: Thu Jan 14 11:35:17 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hive/beeline/HiveSchemaTool.java |  42 +-
 metastore/if/hive_metastore.thrift              |  20 +
 .../upgrade/derby/023-HIVE-12807.derby.sql      |   1 +
 .../upgrade/derby/024-HIVE-12814.derby.sql      |   1 +
 .../upgrade/derby/025-HIVE-12816.derby.sql      |   1 +
 .../upgrade/derby/026-HIVE-12818.derby.sql      |  15 +
 .../upgrade/derby/027-HIVE-12819.derby.sql      |   1 +
 .../upgrade/derby/028-HIVE-12821.derby.sql      |   2 +
 .../upgrade/derby/029-HIVE-12822.derby.sql      |   1 +
 .../upgrade/derby/030-HIVE-12823.derby.sql      |   1 +
 .../upgrade/derby/031-HIVE-12831.derby.sql      |   2 +
 .../upgrade/derby/032-HIVE-12832.derby.sql      |   7 +
 .../upgrade/derby/hive-schema-1.3.0.derby.sql   |   2 +-
 .../upgrade/derby/hive-schema-2.0.0.derby.sql   |   2 +-
 .../upgrade/derby/hive-schema-2.1.0.derby.sql   |   2 +-
 .../derby/hive-txn-schema-1.3.0.derby.sql       | 119 +++++
 .../derby/hive-txn-schema-2.0.0.derby.sql       | 119 +++++
 .../derby/upgrade-1.2.0-to-1.3.0.derby.sql      |  10 +
 .../derby/upgrade-1.2.0-to-2.0.0.derby.sql      |  10 +
 .../upgrade/mssql/008-HIVE-12807.mssql.sql      |   1 +
 .../upgrade/mssql/009-HIVE-12814.mssql.sql      |   1 +
 .../upgrade/mssql/010-HIVE-12816.mssql.sql      |   1 +
 .../upgrade/mssql/011-HIVE-12818.mssql.sql      |  21 +
 .../upgrade/mssql/012-HIVE-12819.mssql.sql      |   1 +
 .../upgrade/mssql/013-HIVE-12821.mssql.sql      |   2 +
 .../upgrade/mssql/014-HIVE-12822.mssql.sql      |   1 +
 .../upgrade/mssql/015-HIVE-12823.mssql.sql      |   1 +
 .../upgrade/mssql/016-HIVE-12831.mssql.sql      |   2 +
 .../upgrade/mssql/017-HIVE-12832.mssql.sql      |  10 +
 .../upgrade/mssql/hive-schema-1.3.0.mssql.sql   |  40 ++
 .../upgrade/mssql/hive-schema-2.0.0.mssql.sql   |  40 ++
 .../upgrade/mssql/hive-schema-2.1.0.mssql.sql   |  40 ++
 .../mssql/upgrade-1.2.0-to-1.3.0.mssql.sql      |  10 +
 .../mssql/upgrade-1.2.0-to-2.0.0.mssql.sql      |  10 +
 .../upgrade/mysql/023-HIVE-12807.mysql.sql      |   1 +
 .../upgrade/mysql/024-HIVE-12814.mysql.sql      |   1 +
 .../upgrade/mysql/025-HIVE-12816.mysql.sql      |   1 +
 .../upgrade/mysql/026-HIVE-12818.mysql.sql      |  17 +
 .../upgrade/mysql/027-HIVE-12819.mysql.sql      |   1 +
 .../upgrade/mysql/028-HIVE-12821.mysql.sql      |   2 +
 .../upgrade/mysql/029-HIVE-12822.mysql.sql      |   1 +
 .../upgrade/mysql/030-HIVE-12823.mysql.sql      |   1 +
 .../upgrade/mysql/031-HIVE-12831.mysql.sql      |   2 +
 .../upgrade/mysql/032-HIVE-12832.mysql.sql      |   7 +
 .../upgrade/mysql/hive-schema-1.3.0.mysql.sql   |   2 +-
 .../upgrade/mysql/hive-schema-2.0.0.mysql.sql   |   2 +-
 .../upgrade/mysql/hive-schema-2.1.0.mysql.sql   |   2 +-
 .../mysql/hive-txn-schema-1.3.0.mysql.sql       | 122 +++++
 .../mysql/hive-txn-schema-2.0.0.mysql.sql       | 122 +++++
 .../mysql/upgrade-1.2.0-to-1.3.0.mysql.sql      |  11 +
 .../mysql/upgrade-1.2.0-to-2.0.0.mysql.sql      |  11 +
 .../upgrade/oracle/023-HIVE-12807.oracle.sql    |   1 +
 .../upgrade/oracle/024-HIVE-12814.oracle.sql    |   1 +
 .../upgrade/oracle/025-HIVE-12816.oracle.sql    |   1 +
 .../upgrade/oracle/026-HIVE-12818.oracle.sql    |  17 +
 .../upgrade/oracle/027-HIVE-12819.oracle.sql    |   1 +
 .../upgrade/oracle/028-HIVE-12821.oracle.sql    |   2 +
 .../upgrade/oracle/029-HIVE-12822.oracle.sql    |   1 +
 .../upgrade/oracle/030-HIVE-12823.oracle.sql    |   1 +
 .../upgrade/oracle/031-HIVE-12381.oracle.sql    |   2 +
 .../upgrade/oracle/032-HIVE-12832.oracle.sql    |   7 +
 .../upgrade/oracle/hive-schema-1.3.0.oracle.sql |   2 +-
 .../upgrade/oracle/hive-schema-2.0.0.oracle.sql |   2 +-
 .../upgrade/oracle/hive-schema-2.1.0.oracle.sql |   2 +-
 .../oracle/hive-txn-schema-1.3.0.oracle.sql     | 120 +++++
 .../oracle/hive-txn-schema-2.0.0.oracle.sql     | 120 +++++
 .../oracle/upgrade-1.2.0-to-1.3.0.oracle.sql    |  10 +
 .../oracle/upgrade-1.2.0-to-2.0.0.oracle.sql    |  10 +
 .../postgres/022-HIVE-12807.postgres.sql        |   1 +
 .../postgres/023-HIVE-12814.postgres.sql        |   1 +
 .../postgres/024-HIVE-12816.postgres.sql        |   1 +
 .../postgres/025-HIVE-12818.postgres.sql        |  17 +
 .../postgres/026-HIVE-12819.postgres.sql        |   1 +
 .../postgres/027-HIVE-12821.postgres.sql        |   2 +
 .../postgres/028-HIVE-12822.postgres.sql        |   1 +
 .../postgres/029-HIVE-12823.postgres.sql        |   1 +
 .../postgres/030-HIVE-12831.postgres.sql        |   2 +
 .../postgres/031-HIVE-12832.postgres.sql        |   7 +
 .../postgres/hive-schema-1.3.0.postgres.sql     |   2 +-
 .../postgres/hive-schema-2.0.0.postgres.sql     |   2 +-
 .../postgres/hive-schema-2.1.0.postgres.sql     |   2 +-
 .../postgres/hive-txn-schema-1.3.0.postgres.sql | 121 +++++
 .../postgres/hive-txn-schema-2.0.0.postgres.sql | 121 +++++
 .../upgrade-1.2.0-to-1.3.0.postgres.sql         |  10 +
 .../upgrade-1.2.0-to-2.0.0.postgres.sql         |  10 +
 .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 463 ++++++++++++++++-
 .../gen/thrift/gen-cpp/hive_metastore_types.h   | 202 +++++++-
 .../hive/metastore/api/CheckLockRequest.java    | 204 +++++++-
 .../hadoop/hive/metastore/api/LockRequest.java  | 117 ++++-
 .../hive/metastore/api/OpenTxnRequest.java      | 115 ++++-
 .../api/ShowCompactResponseElement.java         | 421 ++++++++++++++-
 .../hive/metastore/api/ShowLocksRequest.java    | 429 +++++++++++++++-
 .../metastore/api/ShowLocksResponseElement.java | 512 ++++++++++++++++++-
 .../hadoop/hive/metastore/api/TxnInfo.java      | 322 +++++++++++-
 .../src/gen/thrift/gen-php/metastore/Types.php  | 464 ++++++++++++++++-
 .../gen/thrift/gen-py/hive_metastore/ttypes.py  | 278 +++++++++-
 .../gen/thrift/gen-rb/hive_metastore_types.rb   |  53 +-
 97 files changed, 4957 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
index 6f0ba07..2d7910d 100644
--- a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
+++ b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
@@ -17,18 +17,6 @@
  */
 package org.apache.hive.beeline;
 
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.GnuParser;
@@ -39,6 +27,7 @@ import org.apache.commons.cli.OptionGroup;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.io.output.NullOutputStream;
+import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.metastore.HiveMetaException;
@@ -46,6 +35,22 @@ import org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo;
 import org.apache.hadoop.hive.metastore.api.MetaException;
 import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
 
 public class HiveSchemaTool {
   private String userName = null;
@@ -57,6 +62,8 @@ public class HiveSchemaTool {
   private final String dbType;
   private final MetaStoreSchemaInfo metaStoreSchemaInfo;
 
+  static final private Logger LOG = LoggerFactory.getLogger(HiveSchemaTool.class.getName());
+
   public HiveSchemaTool(String dbType) throws HiveMetaException {
     this(System.getenv("HIVE_HOME"), new HiveConf(HiveSchemaTool.class), dbType);
   }
@@ -356,6 +363,16 @@ public class HiveSchemaTool {
     argList.add("-f");
     argList.add(sqlScriptFile);
 
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Going to invoke file that contains:");
+      FileReader fr = new FileReader(sqlScriptFile);
+      BufferedReader reader = new BufferedReader(fr);
+      String line;
+      while ((line = reader.readLine()) != null) {
+        LOG.debug("script: " + line);
+      }
+    }
+
     // run the script using Beeline
     BeeLine beeLine = new BeeLine();
     if (!verbose) {
@@ -367,6 +384,7 @@ public class HiveSchemaTool {
     // We can be pretty sure that an entire line can be processed as a single command since
     // we always add a line separator at the end while calling dbCommandParser.buildCommand.
     beeLine.getOpts().setEntireLineAsCommand(true);
+    LOG.debug("Going to run command <" + StringUtils.join(argList, " ") + ">");
     int status = beeLine.begin(argList.toArray(new String[0]), null);
     if (status != 0) {
       throw new IOException("Schema script failed, errorcode " + status);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/if/hive_metastore.thrift
----------------------------------------------------------------------
diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift
index 56ec9aa..81837e6 100755
--- a/metastore/if/hive_metastore.thrift
+++ b/metastore/if/hive_metastore.thrift
@@ -543,6 +543,9 @@ struct TxnInfo {
     2: required TxnState state,
     3: required string user,        // used in 'show transactions' to help admins find who has open transactions
     4: required string hostname,    // used in 'show transactions' to help admins find who has open transactions
+    5: optional string agentInfo = "Unknown",
+    6: optional i32 heartbeatCount=0,
+    7: optional string metaInfo,
 }
 
 struct GetOpenTxnsInfoResponse {
@@ -559,6 +562,7 @@ struct OpenTxnRequest {
     1: required i32 num_txns,
     2: required string user,
     3: required string hostname,
+    4: optional string agentInfo = "Unknown",
 }
 
 struct OpenTxnsResponse {
@@ -586,6 +590,7 @@ struct LockRequest {
     2: optional i64 txnid,
     3: required string user,     // used in 'show locks' to help admins find who has open locks
     4: required string hostname, // used in 'show locks' to help admins find who has open locks
+    5: optional string agentInfo = "Unknown",
 }
 
 struct LockResponse {
@@ -595,6 +600,8 @@ struct LockResponse {
 
 struct CheckLockRequest {
     1: required i64 lockid,
+    2: optional i64 txnid,
+    3: optional i64 elapsed_ms,
 }
 
 struct UnlockRequest {
@@ -602,6 +609,10 @@ struct UnlockRequest {
 }
 
 struct ShowLocksRequest {
+    1: optional string dbname,
+    2: optional string tablename,
+    3: optional string partname,
+    4: optional bool isExtended=false,
 }
 
 struct ShowLocksResponseElement {
@@ -616,6 +627,11 @@ struct ShowLocksResponseElement {
     9: optional i64 acquiredat,
     10: required string user,
     11: required string hostname,
+    12: optional i32 heartbeatCount = 0,
+    13: optional string agentInfo,
+    14: optional i64 blockedByExtId,
+    15: optional i64 blockedByIntId,
+    16: optional i64 lockIdInternal,
 }
 
 struct ShowLocksResponse {
@@ -657,6 +673,10 @@ struct ShowCompactResponseElement {
     6: optional string workerid,
     7: optional i64 start,
     8: optional string runAs,
+    9: optional i64 hightestTxnId, // Highest Txn ID handled by this compaction
+    10: optional string metaInfo,
+    11: optional i64 endTime,
+    12: optional string hadoopJobId = "None",
 }
 
 struct ShowCompactResponse {

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/023-HIVE-12807.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/023-HIVE-12807.derby.sql b/metastore/scripts/upgrade/derby/023-HIVE-12807.derby.sql
new file mode 100644
index 0000000..3dfc6fe
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/023-HIVE-12807.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "COMPACTION_QUEUE" ADD "CQ_HIGHEST_TXN_ID" bigint;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/024-HIVE-12814.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/024-HIVE-12814.derby.sql b/metastore/scripts/upgrade/derby/024-HIVE-12814.derby.sql
new file mode 100644
index 0000000..a451846
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/024-HIVE-12814.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "COMPACTION_QUEUE" ADD "CQ_META_INFO" varchar(2048) for bit data;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/025-HIVE-12816.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/025-HIVE-12816.derby.sql b/metastore/scripts/upgrade/derby/025-HIVE-12816.derby.sql
new file mode 100644
index 0000000..2a78bf1
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/025-HIVE-12816.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "COMPACTION_QUEUE" ADD "CQ_HADOOP_JOB_ID" VARCHAR(32);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/026-HIVE-12818.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/026-HIVE-12818.derby.sql b/metastore/scripts/upgrade/derby/026-HIVE-12818.derby.sql
new file mode 100644
index 0000000..4e3c82b
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/026-HIVE-12818.derby.sql
@@ -0,0 +1,15 @@
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varchar(2048) for bit data,
+  CC_HADOOP_JOB_ID varchar(32)
+);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/027-HIVE-12819.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/027-HIVE-12819.derby.sql b/metastore/scripts/upgrade/derby/027-HIVE-12819.derby.sql
new file mode 100644
index 0000000..69b8a3a
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/027-HIVE-12819.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "TXNS" ADD "TXN_AGENT_INFO" varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/028-HIVE-12821.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/028-HIVE-12821.derby.sql b/metastore/scripts/upgrade/derby/028-HIVE-12821.derby.sql
new file mode 100644
index 0000000..0c10245
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/028-HIVE-12821.derby.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "TXNS" ADD "TXN_HEARTBEAT_COUNT" INTEGER;
+ALTER TABLE "HIVE_LOCKS" ADD "HL_HEARTBEAT_COUNT" INTEGER;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql b/metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql
new file mode 100644
index 0000000..9f9423e
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "TXNS" ADD "TXN_META_INFO" varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/030-HIVE-12823.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/030-HIVE-12823.derby.sql b/metastore/scripts/upgrade/derby/030-HIVE-12823.derby.sql
new file mode 100644
index 0000000..b7fbc71
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/030-HIVE-12823.derby.sql
@@ -0,0 +1 @@
+ALTER TABLE "HIVE_LOCKS" ADD "HL_AGENT_INFO" varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/031-HIVE-12831.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/031-HIVE-12831.derby.sql b/metastore/scripts/upgrade/derby/031-HIVE-12831.derby.sql
new file mode 100644
index 0000000..890fa1a
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/031-HIVE-12831.derby.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "HIVE_LOCKS" ADD "HL_BLOCKEDBY_EXT_ID" bigint;
+ALTER TABLE "HIVE_LOCKS" ADD "HL_BLOCKEDBY_INT_ID" bigint;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/032-HIVE-12832.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/032-HIVE-12832.derby.sql b/metastore/scripts/upgrade/derby/032-HIVE-12832.derby.sql
new file mode 100644
index 0000000..0e5515c
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/032-HIVE-12832.derby.sql
@@ -0,0 +1,7 @@
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql b/metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql
index 20eb326..3893194 100644
--- a/metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql
+++ b/metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql
@@ -327,7 +327,7 @@ ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SQL110318025505550" CHECK (IS_COMPRESSED
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-RUN 'hive-txn-schema-0.13.0.derby.sql';
+RUN 'hive-txn-schema-1.3.0.derby.sql';
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/hive-schema-2.0.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/hive-schema-2.0.0.derby.sql b/metastore/scripts/upgrade/derby/hive-schema-2.0.0.derby.sql
index abc6bf4..2c2f1e7 100644
--- a/metastore/scripts/upgrade/derby/hive-schema-2.0.0.derby.sql
+++ b/metastore/scripts/upgrade/derby/hive-schema-2.0.0.derby.sql
@@ -327,7 +327,7 @@ ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SQL110318025505550" CHECK (IS_COMPRESSED
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-RUN 'hive-txn-schema-0.13.0.derby.sql';
+RUN 'hive-txn-schema-2.0.0.derby.sql';
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql b/metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql
index 8083199..660a85a 100644
--- a/metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql
+++ b/metastore/scripts/upgrade/derby/hive-schema-2.1.0.derby.sql
@@ -325,7 +325,7 @@ ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SQL110318025505550" CHECK (IS_COMPRESSED
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-RUN 'hive-txn-schema-0.13.0.derby.sql';
+RUN 'hive-txn-schema-2.0.0.derby.sql';
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql b/metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql
new file mode 100644
index 0000000..13f3340
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql
@@ -0,0 +1,119 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+CREATE TABLE TXNS (
+  TXN_ID bigint PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED bigint NOT NULL,
+  TXN_LAST_HEARTBEAT bigint NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar(128),
+  TXN_META_INFO varchar(128),
+  TXN_HEARTBEAT_COUNT integer
+);
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID bigint REFERENCES TXNS (TXN_ID),
+  TC_DATABASE varchar(128) NOT NULL,
+  TC_TABLE varchar(128),
+  TC_PARTITION varchar(767)
+);
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID bigint,
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+);
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID bigint NOT NULL,
+  HL_LOCK_INT_ID bigint NOT NULL,
+  HL_TXNID bigint,
+  HL_DB varchar(128) NOT NULL,
+  HL_TABLE varchar(128),
+  HL_PARTITION varchar(767),
+  HL_LOCK_STATE char(1) NOT NULL,
+  HL_LOCK_TYPE char(1) NOT NULL,
+  HL_LAST_HEARTBEAT bigint NOT NULL,
+  HL_ACQUIRED_AT bigint,
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT integer,
+  HL_AGENT_INFO varchar(128),
+  HL_BLOCKEDBY_EXT_ID bigint,
+  HL_BLOCKEDBY_INT_ID bigint,
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID)
+); 
+
+CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID bigint PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START bigint,
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID bigint,
+  CQ_META_INFO varchar(2048) for bit data,
+  CQ_HADOOP_JOB_ID varchar(32)
+);
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varchar(2048) for bit data,
+  CC_HADOOP_JOB_ID varchar(32)
+);
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql b/metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql
new file mode 100644
index 0000000..13f3340
--- /dev/null
+++ b/metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql
@@ -0,0 +1,119 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+CREATE TABLE TXNS (
+  TXN_ID bigint PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED bigint NOT NULL,
+  TXN_LAST_HEARTBEAT bigint NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar(128),
+  TXN_META_INFO varchar(128),
+  TXN_HEARTBEAT_COUNT integer
+);
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID bigint REFERENCES TXNS (TXN_ID),
+  TC_DATABASE varchar(128) NOT NULL,
+  TC_TABLE varchar(128),
+  TC_PARTITION varchar(767)
+);
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID bigint,
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+);
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID bigint NOT NULL,
+  HL_LOCK_INT_ID bigint NOT NULL,
+  HL_TXNID bigint,
+  HL_DB varchar(128) NOT NULL,
+  HL_TABLE varchar(128),
+  HL_PARTITION varchar(767),
+  HL_LOCK_STATE char(1) NOT NULL,
+  HL_LOCK_TYPE char(1) NOT NULL,
+  HL_LAST_HEARTBEAT bigint NOT NULL,
+  HL_ACQUIRED_AT bigint,
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT integer,
+  HL_AGENT_INFO varchar(128),
+  HL_BLOCKEDBY_EXT_ID bigint,
+  HL_BLOCKEDBY_INT_ID bigint,
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID)
+); 
+
+CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID bigint PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START bigint,
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID bigint,
+  CQ_META_INFO varchar(2048) for bit data,
+  CQ_HADOOP_JOB_ID varchar(32)
+);
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT bigint NOT NULL
+);
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varchar(2048) for bit data,
+  CC_HADOOP_JOB_ID varchar(32)
+);
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql b/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql
index 6359de4..74ecac2 100644
--- a/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql
+++ b/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql
@@ -1,4 +1,14 @@
 -- Upgrade MetaStore schema from 1.2.0 to 1.3.0
 RUN '021-HIVE-11970.derby.sql';
+RUN '023-HIVE-12807.derby.sql';
+RUN '024-HIVE-12814.derby.sql';
+RUN '025-HIVE-12816.derby.sql';
+RUN '026-HIVE-12818.derby.sql';
+RUN '027-HIVE-12819.derby.sql';
+RUN '028-HIVE-12821.derby.sql';
+RUN '029-HIVE-12822.derby.sql';
+RUN '030-HIVE-12823.derby.sql';
+RUN '031-HIVE-12831.derby.sql';
+RUN '032-HIVE-12832.derby.sql';
 
 UPDATE "APP".VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql b/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql
index adf3cb0..e6817ad 100644
--- a/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql
+++ b/metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql
@@ -1,4 +1,14 @@
 -- Upgrade MetaStore schema from 1.2.0 to 2.0.0
 RUN '021-HIVE-11970.derby.sql';
+RUN '023-HIVE-12807.derby.sql';
+RUN '024-HIVE-12814.derby.sql';
+RUN '025-HIVE-12816.derby.sql';
+RUN '026-HIVE-12818.derby.sql';
+RUN '027-HIVE-12819.derby.sql';
+RUN '028-HIVE-12821.derby.sql';
+RUN '029-HIVE-12822.derby.sql';
+RUN '030-HIVE-12823.derby.sql';
+RUN '031-HIVE-12831.derby.sql';
+RUN '032-HIVE-12832.derby.sql';
 
 UPDATE "APP".VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/008-HIVE-12807.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/008-HIVE-12807.mssql.sql b/metastore/scripts/upgrade/mssql/008-HIVE-12807.mssql.sql
new file mode 100644
index 0000000..e2d7615
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/008-HIVE-12807.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_HIGHEST_TXN_ID bigint NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/009-HIVE-12814.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/009-HIVE-12814.mssql.sql b/metastore/scripts/upgrade/mssql/009-HIVE-12814.mssql.sql
new file mode 100644
index 0000000..0088290
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/009-HIVE-12814.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_META_INFO varbinary(2048) NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/010-HIVE-12816.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/010-HIVE-12816.mssql.sql b/metastore/scripts/upgrade/mssql/010-HIVE-12816.mssql.sql
new file mode 100644
index 0000000..0c0342f
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/010-HIVE-12816.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_HADOOP_JOB_ID nvarchar(32) NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/011-HIVE-12818.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/011-HIVE-12818.mssql.sql b/metastore/scripts/upgrade/mssql/011-HIVE-12818.mssql.sql
new file mode 100644
index 0000000..74ac5bf
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/011-HIVE-12818.mssql.sql
@@ -0,0 +1,21 @@
+CREATE TABLE COMPLETED_COMPACTIONS (
+	CC_ID bigint NOT NULL,
+	CC_DATABASE nvarchar(128) NOT NULL,
+	CC_TABLE nvarchar(128) NOT NULL,
+	CC_PARTITION nvarchar(767) NULL,
+	CC_STATE char(1) NOT NULL,
+	CC_TYPE char(1) NOT NULL,
+	CC_WORKER_ID nvarchar(128) NULL,
+	CC_START bigint NULL,
+	CC_END bigint NULL,
+	CC_RUN_AS nvarchar(128) NULL,
+	CC_HIGHEST_TXN_ID bigint NULL,
+    CC_META_INFO varbinary(2048) NULL,
+	CC_HADOOP_JOB_ID nvarchar(128) NULL,
+PRIMARY KEY CLUSTERED 
+(
+	CC_ID ASC
+)
+);
+
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/012-HIVE-12819.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/012-HIVE-12819.mssql.sql b/metastore/scripts/upgrade/mssql/012-HIVE-12819.mssql.sql
new file mode 100644
index 0000000..778cbd5
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/012-HIVE-12819.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD TXN_AGENT_INFO nvarchar(128) NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/013-HIVE-12821.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/013-HIVE-12821.mssql.sql b/metastore/scripts/upgrade/mssql/013-HIVE-12821.mssql.sql
new file mode 100644
index 0000000..3b8a610
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/013-HIVE-12821.mssql.sql
@@ -0,0 +1,2 @@
+ALTER TABLE TXNS ADD TXN_HEARTBEAT_COUNT int NULL;
+ALTER TABLE HIVE_LOCKS ADD HL_HEARTBEAT_COUNT int NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql b/metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql
new file mode 100644
index 0000000..b82d0ec
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD TXN_META_INFO nvarchar(128) NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/015-HIVE-12823.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/015-HIVE-12823.mssql.sql b/metastore/scripts/upgrade/mssql/015-HIVE-12823.mssql.sql
new file mode 100644
index 0000000..d125b24
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/015-HIVE-12823.mssql.sql
@@ -0,0 +1 @@
+ALTER TABLE HIVE_LOCKS ADD HL_AGENT_INFO nvarchar(128) NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/016-HIVE-12831.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/016-HIVE-12831.mssql.sql b/metastore/scripts/upgrade/mssql/016-HIVE-12831.mssql.sql
new file mode 100644
index 0000000..9f37461
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/016-HIVE-12831.mssql.sql
@@ -0,0 +1,2 @@
+ALTER TABLE HIVE_LOCKS ADD HL_BLOCKEDBY_EXT_ID bigint NULL;
+ALTER TABLE HIVE_LOCKS ADD HL_BLOCKEDBY_INT_ID bigint NULL;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/017-HIVE-12832.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/017-HIVE-12832.mssql.sql b/metastore/scripts/upgrade/mssql/017-HIVE-12832.mssql.sql
new file mode 100644
index 0000000..7adfe2e
--- /dev/null
+++ b/metastore/scripts/upgrade/mssql/017-HIVE-12832.mssql.sql
@@ -0,0 +1,10 @@
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 nvarchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT nvarchar(255) NULL,
+  PRIMARY KEY CLUSTERED
+(
+    MT_KEY1 ASC,
+    MT_KEY2 ASC
+)
+);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql b/metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql
index 01c1376..57d2343 100644
--- a/metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql
+++ b/metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql
@@ -866,12 +866,35 @@ CREATE TABLE COMPACTION_QUEUE(
 	CQ_WORKER_ID nvarchar(128) NULL,
 	CQ_START bigint NULL,
 	CQ_RUN_AS nvarchar(128) NULL,
+	CQ_HIGHEST_TXN_ID bigint NULL,
+    CQ_META_INFO varbinary(2048) NULL,
+	CQ_HADOOP_JOB_ID nvarchar(128) NULL,
 PRIMARY KEY CLUSTERED 
 (
 	CQ_ID ASC
 )
 );
 
+CREATE TABLE COMPLETED_COMPACTIONS (
+	CC_ID bigint NOT NULL,
+	CC_DATABASE nvarchar(128) NOT NULL,
+	CC_TABLE nvarchar(128) NOT NULL,
+	CC_PARTITION nvarchar(767) NULL,
+	CC_STATE char(1) NOT NULL,
+	CC_TYPE char(1) NOT NULL,
+	CC_WORKER_ID nvarchar(128) NULL,
+	CC_START bigint NULL,
+	CC_END bigint NULL,
+	CC_RUN_AS nvarchar(128) NULL,
+	CC_HIGHEST_TXN_ID bigint NULL,
+    CC_META_INFO varbinary(2048) NULL,
+	CC_HADOOP_JOB_ID nvarchar(128) NULL,
+PRIMARY KEY CLUSTERED 
+(
+	CC_ID ASC
+)
+);
+
 CREATE TABLE COMPLETED_TXN_COMPONENTS(
 	CTC_TXNID bigint NULL,
 	CTC_DATABASE nvarchar(128) NOT NULL,
@@ -892,6 +915,10 @@ CREATE TABLE HIVE_LOCKS(
 	HL_ACQUIRED_AT bigint NULL,
 	HL_USER nvarchar(128) NOT NULL,
 	HL_HOST nvarchar(128) NOT NULL,
+    HL_HEARTBEAT_COUNT int NULL,
+    HL_AGENT_INFO nvarchar(128) NULL,
+    HL_BLOCKEDBY_EXT_ID bigint NULL,
+    HL_BLOCKEDBY_INT_ID bigint NULL,
 PRIMARY KEY CLUSTERED 
 (
 	HL_LOCK_EXT_ID ASC,
@@ -924,6 +951,9 @@ CREATE TABLE TXNS(
 	TXN_LAST_HEARTBEAT bigint NOT NULL,
 	TXN_USER nvarchar(128) NOT NULL,
 	TXN_HOST nvarchar(128) NOT NULL,
+    TXN_AGENT_INFO nvarchar(128) NULL,
+    TXN_META_INFO nvarchar(128) NULL,
+    TXN_HEARTBEAT_COUNT int NULL,
 PRIMARY KEY CLUSTERED 
 (
 	TXN_ID ASC
@@ -939,6 +969,16 @@ CREATE TABLE TXN_COMPONENTS(
 
 ALTER TABLE TXN_COMPONENTS  WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID);
 
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 nvarchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT nvarchar(255) NULL,
+  PRIMARY KEY CLUSTERED
+(
+    MT_KEY1 ASC,
+    MT_KEY2 ASC
+)
+);
 
 
 -- -----------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql b/metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql
index 1ec8632..57257c4 100644
--- a/metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql
+++ b/metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql
@@ -866,12 +866,35 @@ CREATE TABLE COMPACTION_QUEUE(
 	CQ_WORKER_ID nvarchar(128) NULL,
 	CQ_START bigint NULL,
 	CQ_RUN_AS nvarchar(128) NULL,
+	CQ_HIGHEST_TXN_ID bigint NULL,
+    CQ_META_INFO varbinary(2048) NULL,
+	CQ_HADOOP_JOB_ID nvarchar(128) NULL,
 PRIMARY KEY CLUSTERED 
 (
 	CQ_ID ASC
 )
 );
 
+CREATE TABLE COMPLETED_COMPACTIONS (
+	CC_ID bigint NOT NULL,
+	CC_DATABASE nvarchar(128) NOT NULL,
+	CC_TABLE nvarchar(128) NOT NULL,
+	CC_PARTITION nvarchar(767) NULL,
+	CC_STATE char(1) NOT NULL,
+	CC_TYPE char(1) NOT NULL,
+	CC_WORKER_ID nvarchar(128) NULL,
+	CC_START bigint NULL,
+	CC_END bigint NULL,
+	CC_RUN_AS nvarchar(128) NULL,
+	CC_HIGHEST_TXN_ID bigint NULL,
+    CC_META_INFO varbinary(2048) NULL,
+	CC_HADOOP_JOB_ID nvarchar(128) NULL,
+PRIMARY KEY CLUSTERED 
+(
+	CC_ID ASC
+)
+);
+
 CREATE TABLE COMPLETED_TXN_COMPONENTS(
 	CTC_TXNID bigint NULL,
 	CTC_DATABASE nvarchar(128) NOT NULL,
@@ -892,6 +915,10 @@ CREATE TABLE HIVE_LOCKS(
 	HL_ACQUIRED_AT bigint NULL,
 	HL_USER nvarchar(128) NOT NULL,
 	HL_HOST nvarchar(128) NOT NULL,
+    HL_HEARTBEAT_COUNT int NULL,
+    HL_AGENT_INFO nvarchar(128) NULL,
+    HL_BLOCKEDBY_EXT_ID bigint NULL,
+    HL_BLOCKEDBY_INT_ID bigint NULL,
 PRIMARY KEY CLUSTERED 
 (
 	HL_LOCK_EXT_ID ASC,
@@ -924,6 +951,9 @@ CREATE TABLE TXNS(
 	TXN_LAST_HEARTBEAT bigint NOT NULL,
 	TXN_USER nvarchar(128) NOT NULL,
 	TXN_HOST nvarchar(128) NOT NULL,
+    TXN_AGENT_INFO nvarchar(128) NULL,
+    TXN_META_INFO nvarchar(128) NULL,
+    TXN_HEARTBEAT_COUNT int NULL,
 PRIMARY KEY CLUSTERED 
 (
 	TXN_ID ASC
@@ -939,6 +969,16 @@ CREATE TABLE TXN_COMPONENTS(
 
 ALTER TABLE TXN_COMPONENTS  WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID);
 
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 nvarchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT nvarchar(255) NULL,
+  PRIMARY KEY CLUSTERED
+(
+    MT_KEY1 ASC,
+    MT_KEY2 ASC
+)
+);
 
 
 -- -----------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql b/metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql
index 731cc25..085c17d 100644
--- a/metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql
+++ b/metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql
@@ -866,12 +866,35 @@ CREATE TABLE COMPACTION_QUEUE(
 	CQ_WORKER_ID nvarchar(128) NULL,
 	CQ_START bigint NULL,
 	CQ_RUN_AS nvarchar(128) NULL,
+	CQ_HIGHEST_TXN_ID bigint NULL,
+    CQ_META_INFO varbinary(2048) NULL,
+	CQ_HADOOP_JOB_ID nvarchar(128) NULL,
 PRIMARY KEY CLUSTERED 
 (
 	CQ_ID ASC
 )
 );
 
+CREATE TABLE COMPLETED_COMPACTIONS (
+	CC_ID bigint NOT NULL,
+	CC_DATABASE nvarchar(128) NOT NULL,
+	CC_TABLE nvarchar(128) NOT NULL,
+	CC_PARTITION nvarchar(767) NULL,
+	CC_STATE char(1) NOT NULL,
+	CC_TYPE char(1) NOT NULL,
+	CC_WORKER_ID nvarchar(128) NULL,
+	CC_START bigint NULL,
+	CC_END bigint NULL,
+	CC_RUN_AS nvarchar(128) NULL,
+	CC_HIGHEST_TXN_ID bigint NULL,
+    CC_META_INFO varbinary(2048) NULL,
+	CC_HADOOP_JOB_ID nvarchar(128) NULL,
+PRIMARY KEY CLUSTERED 
+(
+	CC_ID ASC
+)
+);
+
 CREATE TABLE COMPLETED_TXN_COMPONENTS(
 	CTC_TXNID bigint NULL,
 	CTC_DATABASE nvarchar(128) NOT NULL,
@@ -892,6 +915,10 @@ CREATE TABLE HIVE_LOCKS(
 	HL_ACQUIRED_AT bigint NULL,
 	HL_USER nvarchar(128) NOT NULL,
 	HL_HOST nvarchar(128) NOT NULL,
+    HL_HEARTBEAT_COUNT int NULL,
+    HL_AGENT_INFO nvarchar(128) NULL,
+    HL_BLOCKEDBY_EXT_ID bigint NULL,
+    HL_BLOCKEDBY_INT_ID bigint NULL,
 PRIMARY KEY CLUSTERED 
 (
 	HL_LOCK_EXT_ID ASC,
@@ -924,6 +951,9 @@ CREATE TABLE TXNS(
 	TXN_LAST_HEARTBEAT bigint NOT NULL,
 	TXN_USER nvarchar(128) NOT NULL,
 	TXN_HOST nvarchar(128) NOT NULL,
+    TXN_AGENT_INFO nvarchar(128) NULL,
+    TXN_META_INFO nvarchar(128) NULL,
+    TXN_HEARTBEAT_COUNT int NULL,
 PRIMARY KEY CLUSTERED 
 (
 	TXN_ID ASC
@@ -939,6 +969,16 @@ CREATE TABLE TXN_COMPONENTS(
 
 ALTER TABLE TXN_COMPONENTS  WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID);
 
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 nvarchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT nvarchar(255) NULL,
+  PRIMARY KEY CLUSTERED
+(
+    MT_KEY1 ASC,
+    MT_KEY2 ASC
+)
+);
 
 
 -- -----------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql b/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql
index 9cf9d25..b0f28bb 100644
--- a/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql
+++ b/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql
@@ -1,6 +1,16 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0' AS MESSAGE;
 
 :r 007-HIVE-11970.mssql.sql;
+:r 008-HIVE-12807.mssql.sql;
+:r 009-HIVE-12814.mssql.sql;
+:r 010-HIVE-12816.mssql.sql;
+:r 011-HIVE-12818.mssql.sql;
+:r 012-HIVE-12819.mssql.sql;
+:r 013-HIVE-12821.mssql.sql;
+:r 014-HIVE-12822.mssql.sql;
+:r 015-HIVE-12823.mssql.sql;
+:r 016-HIVE-12831.mssql.sql;
+:r 017-HIVE-12832.mssql.sql;
 
 UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS MESSAGE;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql b/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql
index de3d29d..66a09a8 100644
--- a/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql
+++ b/metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql
@@ -1,6 +1,16 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0' AS MESSAGE;
 
 :r 007-HIVE-11970.mssql.sql;
+:r 008-HIVE-12807.mssql.sql;
+:r 009-HIVE-12814.mssql.sql;
+:r 010-HIVE-12816.mssql.sql;
+:r 011-HIVE-12818.mssql.sql;
+:r 012-HIVE-12819.mssql.sql;
+:r 013-HIVE-12821.mssql.sql;
+:r 014-HIVE-12822.mssql.sql;
+:r 015-HIVE-12823.mssql.sql;
+:r 016-HIVE-12831.mssql.sql;
+:r 017-HIVE-12832.mssql.sql;
 
 UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS MESSAGE;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/023-HIVE-12807.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/023-HIVE-12807.mysql.sql b/metastore/scripts/upgrade/mysql/023-HIVE-12807.mysql.sql
new file mode 100644
index 0000000..31a2dd1
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/023-HIVE-12807.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `COMPACTION_QUEUE` ADD `CQ_HIGHEST_TXN_ID` bigint;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/024-HIVE-12814.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/024-HIVE-12814.mysql.sql b/metastore/scripts/upgrade/mysql/024-HIVE-12814.mysql.sql
new file mode 100644
index 0000000..5d5f3ca
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/024-HIVE-12814.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `COMPACTION_QUEUE` ADD `CQ_META_INFO` varbinary(2048);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/025-HIVE-12816.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/025-HIVE-12816.mysql.sql b/metastore/scripts/upgrade/mysql/025-HIVE-12816.mysql.sql
new file mode 100644
index 0000000..87e48b4
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/025-HIVE-12816.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `COMPACTION_QUEUE` ADD `CQ_HADOOP_JOB_ID` varchar(32);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/026-HIVE-12818.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/026-HIVE-12818.mysql.sql b/metastore/scripts/upgrade/mysql/026-HIVE-12818.mysql.sql
new file mode 100644
index 0000000..e241eee
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/026-HIVE-12818.mysql.sql
@@ -0,0 +1,17 @@
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varbinary(2048),
+  CC_HADOOP_JOB_ID varchar(32)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/027-HIVE-12819.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/027-HIVE-12819.mysql.sql b/metastore/scripts/upgrade/mysql/027-HIVE-12819.mysql.sql
new file mode 100644
index 0000000..f1e25d5
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/027-HIVE-12819.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `TXNS` ADD `TXN_AGENT_INFO` varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/028-HIVE-12821.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/028-HIVE-12821.mysql.sql b/metastore/scripts/upgrade/mysql/028-HIVE-12821.mysql.sql
new file mode 100644
index 0000000..a951021
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/028-HIVE-12821.mysql.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `TXNS` ADD `TXN_HEARTBEAT_COUNT` int;
+ALTER TABLE `HIVE_LOCKS` ADD `HL_HEARTBEAT_COUNT` int;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql b/metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql
new file mode 100644
index 0000000..ffd0bab
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `TXNS` ADD `TXN_META_INFO` varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/030-HIVE-12823.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/030-HIVE-12823.mysql.sql b/metastore/scripts/upgrade/mysql/030-HIVE-12823.mysql.sql
new file mode 100644
index 0000000..42c9b17
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/030-HIVE-12823.mysql.sql
@@ -0,0 +1 @@
+ALTER TABLE `HIVE_LOCKS` ADD `HL_AGENT_INFO` varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/031-HIVE-12831.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/031-HIVE-12831.mysql.sql b/metastore/scripts/upgrade/mysql/031-HIVE-12831.mysql.sql
new file mode 100644
index 0000000..0b19bba
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/031-HIVE-12831.mysql.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `HIVE_LOCKS` ADD `HL_BLOCKEDBY_EXT_ID` bigint;
+ALTER TABLE `HIVE_LOCKS` ADD `HL_BLOCKEDBY_INT_ID` bigint;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/032-HIVE-12832.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/032-HIVE-12832.mysql.sql b/metastore/scripts/upgrade/mysql/032-HIVE-12832.mysql.sql
new file mode 100644
index 0000000..98c7706
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/032-HIVE-12832.mysql.sql
@@ -0,0 +1,7 @@
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/hive-schema-1.3.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/hive-schema-1.3.0.mysql.sql b/metastore/scripts/upgrade/mysql/hive-schema-1.3.0.mysql.sql
index 6c211a6..d9232d2 100644
--- a/metastore/scripts/upgrade/mysql/hive-schema-1.3.0.mysql.sql
+++ b/metastore/scripts/upgrade/mysql/hive-schema-1.3.0.mysql.sql
@@ -813,7 +813,7 @@ CREATE TABLE IF NOT EXISTS `NOTIFICATION_SEQUENCE`
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-SOURCE hive-txn-schema-0.13.0.mysql.sql;
+SOURCE hive-txn-schema-1.3.0.mysql.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/hive-schema-2.0.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/hive-schema-2.0.0.mysql.sql b/metastore/scripts/upgrade/mysql/hive-schema-2.0.0.mysql.sql
index ff0b643..82e0128 100644
--- a/metastore/scripts/upgrade/mysql/hive-schema-2.0.0.mysql.sql
+++ b/metastore/scripts/upgrade/mysql/hive-schema-2.0.0.mysql.sql
@@ -813,7 +813,7 @@ CREATE TABLE IF NOT EXISTS `NOTIFICATION_SEQUENCE`
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-SOURCE hive-txn-schema-0.13.0.mysql.sql;
+SOURCE hive-txn-schema-2.0.0.mysql.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql b/metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql
index d7e384c..06c3d90 100644
--- a/metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql
+++ b/metastore/scripts/upgrade/mysql/hive-schema-2.1.0.mysql.sql
@@ -813,7 +813,7 @@ CREATE TABLE IF NOT EXISTS `NOTIFICATION_SEQUENCE`
 -- ----------------------------
 -- Transaction and Lock Tables
 -- ----------------------------
-SOURCE hive-txn-schema-0.13.0.mysql.sql;
+SOURCE hive-txn-schema-2.0.0.mysql.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql b/metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql
new file mode 100644
index 0000000..ea42757
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql
@@ -0,0 +1,122 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+
+CREATE TABLE TXNS (
+  TXN_ID bigint PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED bigint NOT NULL,
+  TXN_LAST_HEARTBEAT bigint NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar(128),
+  TXN_META_INFO varchar(128),
+  TXN_HEARTBEAT_COUNT int
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID bigint,
+  TC_DATABASE varchar(128) NOT NULL,
+  TC_TABLE varchar(128),
+  TC_PARTITION varchar(767),
+  FOREIGN KEY (TC_TXNID) REFERENCES TXNS (TXN_ID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID bigint,
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID bigint NOT NULL,
+  HL_LOCK_INT_ID bigint NOT NULL,
+  HL_TXNID bigint,
+  HL_DB varchar(128) NOT NULL,
+  HL_TABLE varchar(128),
+  HL_PARTITION varchar(767),
+  HL_LOCK_STATE char(1) not null,
+  HL_LOCK_TYPE char(1) not null,
+  HL_LAST_HEARTBEAT bigint NOT NULL,
+  HL_ACQUIRED_AT bigint,
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT int,
+  HL_AGENT_INFO varchar(128),
+  HL_BLOCKEDBY_EXT_ID bigint,
+  HL_BLOCKEDBY_INT_ID bigint,
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID),
+  KEY HIVE_LOCK_TXNID_INDEX (HL_TXNID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE INDEX HL_TXNID_IDX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID bigint PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START bigint,
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID bigint,
+  CQ_META_INFO varbinary(2048),
+  CQ_HADOOP_JOB_ID varchar(32)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varbinary(2048),
+  CC_HADOOP_JOB_ID varchar(32)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql b/metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql
new file mode 100644
index 0000000..ea42757
--- /dev/null
+++ b/metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql
@@ -0,0 +1,122 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+
+CREATE TABLE TXNS (
+  TXN_ID bigint PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED bigint NOT NULL,
+  TXN_LAST_HEARTBEAT bigint NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar(128),
+  TXN_META_INFO varchar(128),
+  TXN_HEARTBEAT_COUNT int
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID bigint,
+  TC_DATABASE varchar(128) NOT NULL,
+  TC_TABLE varchar(128),
+  TC_PARTITION varchar(767),
+  FOREIGN KEY (TC_TXNID) REFERENCES TXNS (TXN_ID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID bigint,
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID bigint NOT NULL,
+  HL_LOCK_INT_ID bigint NOT NULL,
+  HL_TXNID bigint,
+  HL_DB varchar(128) NOT NULL,
+  HL_TABLE varchar(128),
+  HL_PARTITION varchar(767),
+  HL_LOCK_STATE char(1) not null,
+  HL_LOCK_TYPE char(1) not null,
+  HL_LAST_HEARTBEAT bigint NOT NULL,
+  HL_ACQUIRED_AT bigint,
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT int,
+  HL_AGENT_INFO varchar(128),
+  HL_BLOCKEDBY_EXT_ID bigint,
+  HL_BLOCKEDBY_INT_ID bigint,
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID),
+  KEY HIVE_LOCK_TXNID_INDEX (HL_TXNID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE INDEX HL_TXNID_IDX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID bigint PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START bigint,
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID bigint,
+  CQ_META_INFO varbinary(2048),
+  CQ_HADOOP_JOB_ID varchar(32)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO varbinary(2048),
+  CC_HADOOP_JOB_ID varchar(32)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT bigint NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar(128) NOT NULL,
+  MT_KEY2 bigint NOT NULL,
+  MT_COMMENT varchar(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql b/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql
index 1b32d93..477c10b 100644
--- a/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql
+++ b/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql
@@ -1,5 +1,16 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0' AS ' ';
 SOURCE 021-HIVE-7018.mysql.sql;
 SOURCE 022-HIVE-11970.mysql.sql;
+SOURCE 023-HIVE-12807.mysql.sql;
+SOURCE 024-HIVE-12814.mysql.sql;
+SOURCE 025-HIVE-12816.mysql.sql;
+SOURCE 026-HIVE-12818.mysql.sql;
+SOURCE 027-HIVE-12819.mysql.sql;
+SOURCE 028-HIVE-12821.mysql.sql;
+SOURCE 029-HIVE-12822.mysql.sql;
+SOURCE 030-HIVE-12823.mysql.sql;
+SOURCE 031-HIVE-12831.mysql.sql;
+SOURCE 032-HIVE-12832.mysql.sql;
+
 UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS ' ';

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql b/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql
index 1340f27..4fc1ea7 100644
--- a/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql
+++ b/metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql
@@ -1,6 +1,17 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0' AS ' ';
 SOURCE 021-HIVE-7018.mysql.sql;
 SOURCE 022-HIVE-11970.mysql.sql;
+SOURCE 023-HIVE-12807.mysql.sql;
+SOURCE 024-HIVE-12814.mysql.sql;
+SOURCE 025-HIVE-12816.mysql.sql;
+SOURCE 026-HIVE-12818.mysql.sql;
+SOURCE 027-HIVE-12819.mysql.sql;
+SOURCE 028-HIVE-12821.mysql.sql;
+SOURCE 029-HIVE-12822.mysql.sql;
+SOURCE 030-HIVE-12823.mysql.sql;
+SOURCE 031-HIVE-12831.mysql.sql;
+SOURCE 032-HIVE-12832.mysql.sql;
+
 UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS ' ';
 

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/023-HIVE-12807.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/023-HIVE-12807.oracle.sql b/metastore/scripts/upgrade/oracle/023-HIVE-12807.oracle.sql
new file mode 100644
index 0000000..0313e96
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/023-HIVE-12807.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_HIGHEST_TXN_ID NUMBER(19);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/024-HIVE-12814.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/024-HIVE-12814.oracle.sql b/metastore/scripts/upgrade/oracle/024-HIVE-12814.oracle.sql
new file mode 100644
index 0000000..d9a5575
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/024-HIVE-12814.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_META_INFO BLOB;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/025-HIVE-12816.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/025-HIVE-12816.oracle.sql b/metastore/scripts/upgrade/oracle/025-HIVE-12816.oracle.sql
new file mode 100644
index 0000000..9a96d8c
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/025-HIVE-12816.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD CQ_HADOOP_JOB_ID varchar2(32);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/026-HIVE-12818.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/026-HIVE-12818.oracle.sql b/metastore/scripts/upgrade/oracle/026-HIVE-12818.oracle.sql
new file mode 100644
index 0000000..9ecb43e
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/026-HIVE-12818.oracle.sql
@@ -0,0 +1,17 @@
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID NUMBER(19) PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START NUMBER(19),
+  CC_END NUMBER(19),
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID NUMBER(19),
+  CC_META_INFO BLOB,
+  CC_HADOOP_JOB_ID varchar2(32)
+) ROWDEPENDENCIES;
+
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/027-HIVE-12819.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/027-HIVE-12819.oracle.sql b/metastore/scripts/upgrade/oracle/027-HIVE-12819.oracle.sql
new file mode 100644
index 0000000..0d74a98
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/027-HIVE-12819.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD TXN_AGENT_INFO varchar2(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/028-HIVE-12821.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/028-HIVE-12821.oracle.sql b/metastore/scripts/upgrade/oracle/028-HIVE-12821.oracle.sql
new file mode 100644
index 0000000..152d2ab
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/028-HIVE-12821.oracle.sql
@@ -0,0 +1,2 @@
+ALTER TABLE TXNS ADD TXN_HEARTBEAT_COUNT number(10);
+ALTER TABLE HIVE_LOCKS ADD HL_HEARTBEAT_COUNT number(10);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql b/metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql
new file mode 100644
index 0000000..63c0d77
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD TXN_META_INFO varchar2(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/030-HIVE-12823.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/030-HIVE-12823.oracle.sql b/metastore/scripts/upgrade/oracle/030-HIVE-12823.oracle.sql
new file mode 100644
index 0000000..f938603
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/030-HIVE-12823.oracle.sql
@@ -0,0 +1 @@
+ALTER TABLE HIVE_LOCKS ADD HL_AGENT_INFO varchar2(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/031-HIVE-12381.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/031-HIVE-12381.oracle.sql b/metastore/scripts/upgrade/oracle/031-HIVE-12381.oracle.sql
new file mode 100644
index 0000000..35a9b9d
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/031-HIVE-12381.oracle.sql
@@ -0,0 +1,2 @@
+ALTER TABLE HIVE_LOCKS ADD HL_BLOCKEDBY_EXT_ID number(19);
+ALTER TABLE HIVE_LOCKS ADD HL_BLOCKEDBY_INT_ID number(19);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/032-HIVE-12832.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/032-HIVE-12832.oracle.sql b/metastore/scripts/upgrade/oracle/032-HIVE-12832.oracle.sql
new file mode 100644
index 0000000..2b58d2e
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/032-HIVE-12832.oracle.sql
@@ -0,0 +1,7 @@
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar2(128) NOT NULL,
+  MT_KEY2 number(19) NOT NULL,
+  MT_COMMENT varchar2(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/hive-schema-1.3.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/hive-schema-1.3.0.oracle.sql b/metastore/scripts/upgrade/oracle/hive-schema-1.3.0.oracle.sql
index d2e7945..e162988 100644
--- a/metastore/scripts/upgrade/oracle/hive-schema-1.3.0.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/hive-schema-1.3.0.oracle.sql
@@ -780,7 +780,7 @@ CREATE INDEX FUNC_RU_N49 ON FUNC_RU (FUNC_ID);
 ------------------------------
 -- Transaction and lock tables
 ------------------------------
-@hive-txn-schema-0.13.0.oracle.sql;
+@hive-txn-schema-1.3.0.oracle.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/hive-schema-2.0.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/hive-schema-2.0.0.oracle.sql b/metastore/scripts/upgrade/oracle/hive-schema-2.0.0.oracle.sql
index 2dcdd77..168473a 100644
--- a/metastore/scripts/upgrade/oracle/hive-schema-2.0.0.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/hive-schema-2.0.0.oracle.sql
@@ -780,7 +780,7 @@ CREATE INDEX FUNC_RU_N49 ON FUNC_RU (FUNC_ID);
 ------------------------------
 -- Transaction and lock tables
 ------------------------------
-@hive-txn-schema-0.13.0.oracle.sql;
+@hive-txn-schema-2.0.0.oracle.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql b/metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql
index 88f2ca6..644463d 100644
--- a/metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/hive-schema-2.1.0.oracle.sql
@@ -780,7 +780,7 @@ CREATE INDEX FUNC_RU_N49 ON FUNC_RU (FUNC_ID);
 ------------------------------
 -- Transaction and lock tables
 ------------------------------
-@hive-txn-schema-0.13.0.oracle.sql;
+@hive-txn-schema-2.0.0.oracle.sql;
 
 -- -----------------------------------------------------------------
 -- Record schema version. Should be the last step in the init script

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql b/metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql
new file mode 100644
index 0000000..788741a
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql
@@ -0,0 +1,120 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+
+CREATE TABLE TXNS (
+  TXN_ID NUMBER(19) PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED NUMBER(19) NOT NULL,
+  TXN_LAST_HEARTBEAT NUMBER(19) NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar2(128),
+  TXN_META_INFO varchar2(128),
+  TXN_HEARTBEAT_COUNT number(10)
+) ROWDEPENDENCIES;
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID NUMBER(19) REFERENCES TXNS (TXN_ID),
+  TC_DATABASE VARCHAR2(128) NOT NULL,
+  TC_TABLE VARCHAR2(128),
+  TC_PARTITION VARCHAR2(767) NULL
+) ROWDEPENDENCIES;
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID NUMBER(19),
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+) ROWDEPENDENCIES;
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID NUMBER(19) NOT NULL,
+  HL_LOCK_INT_ID NUMBER(19) NOT NULL,
+  HL_TXNID NUMBER(19),
+  HL_DB VARCHAR2(128) NOT NULL,
+  HL_TABLE VARCHAR2(128),
+  HL_PARTITION VARCHAR2(767),
+  HL_LOCK_STATE CHAR(1) NOT NULL,
+  HL_LOCK_TYPE CHAR(1) NOT NULL,
+  HL_LAST_HEARTBEAT NUMBER(19) NOT NULL,
+  HL_ACQUIRED_AT NUMBER(19),
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT number(10),
+  HL_AGENT_INFO varchar2(128),
+  HL_BLOCKEDBY_EXT_ID number(19),
+  HL_BLOCKEDBY_INT_ID number(19),
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID)
+) ROWDEPENDENCIES;
+
+CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID NUMBER(19) PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START NUMBER(19),
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID NUMBER(19),
+  CQ_META_INFO BLOB,
+  CQ_HADOOP_JOB_ID varchar2(32)
+) ROWDEPENDENCIES;
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID NUMBER(19) PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START NUMBER(19),
+  CC_END NUMBER(19),
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID NUMBER(19),
+  CC_META_INFO BLOB,
+  CC_HADOOP_JOB_ID varchar2(32)
+) ROWDEPENDENCIES;
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar2(128) NOT NULL,
+  MT_KEY2 number(19) NOT NULL,
+  MT_COMMENT varchar2(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql b/metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql
new file mode 100644
index 0000000..788741a
--- /dev/null
+++ b/metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql
@@ -0,0 +1,120 @@
+-- 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.
+
+--
+-- Tables for transaction management
+-- 
+
+CREATE TABLE TXNS (
+  TXN_ID NUMBER(19) PRIMARY KEY,
+  TXN_STATE char(1) NOT NULL,
+  TXN_STARTED NUMBER(19) NOT NULL,
+  TXN_LAST_HEARTBEAT NUMBER(19) NOT NULL,
+  TXN_USER varchar(128) NOT NULL,
+  TXN_HOST varchar(128) NOT NULL,
+  TXN_AGENT_INFO varchar2(128),
+  TXN_META_INFO varchar2(128),
+  TXN_HEARTBEAT_COUNT number(10)
+) ROWDEPENDENCIES;
+
+CREATE TABLE TXN_COMPONENTS (
+  TC_TXNID NUMBER(19) REFERENCES TXNS (TXN_ID),
+  TC_DATABASE VARCHAR2(128) NOT NULL,
+  TC_TABLE VARCHAR2(128),
+  TC_PARTITION VARCHAR2(767) NULL
+) ROWDEPENDENCIES;
+
+CREATE TABLE COMPLETED_TXN_COMPONENTS (
+  CTC_TXNID NUMBER(19),
+  CTC_DATABASE varchar(128) NOT NULL,
+  CTC_TABLE varchar(128),
+  CTC_PARTITION varchar(767)
+) ROWDEPENDENCIES;
+
+CREATE TABLE NEXT_TXN_ID (
+  NTXN_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_TXN_ID VALUES(1);
+
+CREATE TABLE HIVE_LOCKS (
+  HL_LOCK_EXT_ID NUMBER(19) NOT NULL,
+  HL_LOCK_INT_ID NUMBER(19) NOT NULL,
+  HL_TXNID NUMBER(19),
+  HL_DB VARCHAR2(128) NOT NULL,
+  HL_TABLE VARCHAR2(128),
+  HL_PARTITION VARCHAR2(767),
+  HL_LOCK_STATE CHAR(1) NOT NULL,
+  HL_LOCK_TYPE CHAR(1) NOT NULL,
+  HL_LAST_HEARTBEAT NUMBER(19) NOT NULL,
+  HL_ACQUIRED_AT NUMBER(19),
+  HL_USER varchar(128) NOT NULL,
+  HL_HOST varchar(128) NOT NULL,
+  HL_HEARTBEAT_COUNT number(10),
+  HL_AGENT_INFO varchar2(128),
+  HL_BLOCKEDBY_EXT_ID number(19),
+  HL_BLOCKEDBY_INT_ID number(19),
+  PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID)
+) ROWDEPENDENCIES;
+
+CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID);
+
+CREATE TABLE NEXT_LOCK_ID (
+  NL_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_LOCK_ID VALUES(1);
+
+CREATE TABLE COMPACTION_QUEUE (
+  CQ_ID NUMBER(19) PRIMARY KEY,
+  CQ_DATABASE varchar(128) NOT NULL,
+  CQ_TABLE varchar(128) NOT NULL,
+  CQ_PARTITION varchar(767),
+  CQ_STATE char(1) NOT NULL,
+  CQ_TYPE char(1) NOT NULL,
+  CQ_WORKER_ID varchar(128),
+  CQ_START NUMBER(19),
+  CQ_RUN_AS varchar(128),
+  CQ_HIGHEST_TXN_ID NUMBER(19),
+  CQ_META_INFO BLOB,
+  CQ_HADOOP_JOB_ID varchar2(32)
+) ROWDEPENDENCIES;
+
+CREATE TABLE NEXT_COMPACTION_QUEUE_ID (
+  NCQ_NEXT NUMBER(19) NOT NULL
+);
+INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1);
+
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID NUMBER(19) PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START NUMBER(19),
+  CC_END NUMBER(19),
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID NUMBER(19),
+  CC_META_INFO BLOB,
+  CC_HADOOP_JOB_ID varchar2(32)
+) ROWDEPENDENCIES;
+
+CREATE TABLE AUX_TABLE (
+  MT_KEY1 varchar2(128) NOT NULL,
+  MT_KEY2 number(19) NOT NULL,
+  MT_COMMENT varchar2(255),
+  PRIMARY KEY(MT_KEY1, MT_KEY2)
+);
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql b/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql
index bd283d4..94ee2c4 100644
--- a/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql
@@ -1,6 +1,16 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0' AS Status from dual;
 
 @022-HIVE-11970.oracle.sql;
+@023-HIVE-12807.oracle.sql;
+@024-HIVE-12814.oracle.sql;
+@025-HIVE-12816.oracle.sql;
+@026-HIVE-12818.oracle.sql;
+@027-HIVE-12819.oracle.sql;
+@028-HIVE-12821.oracle.sql;
+@029-HIVE-12822.oracle.sql;
+@030-HIVE-12823.oracle.sql;
+@031-HIVE-12381.oracle.sql;
+@032-HIVE-12832.oracle.sql;
 
 UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS Status from dual;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql b/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql
index ceb09be..f3a774a 100644
--- a/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql
@@ -1,6 +1,16 @@
 SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0' AS Status from dual;
 
 @022-HIVE-11970.oracle.sql;
+@023-HIVE-12807.oracle.sql;
+@024-HIVE-12814.oracle.sql;
+@025-HIVE-12816.oracle.sql;
+@026-HIVE-12818.oracle.sql;
+@027-HIVE-12819.oracle.sql;
+@028-HIVE-12821.oracle.sql;
+@029-HIVE-12822.oracle.sql;
+@030-HIVE-12823.oracle.sql;
+@031-HIVE-12381.oracle.sql;
+@032-HIVE-12832.oracle.sql;
 
 UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1;
 SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS Status from dual;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/022-HIVE-12807.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/022-HIVE-12807.postgres.sql b/metastore/scripts/upgrade/postgres/022-HIVE-12807.postgres.sql
new file mode 100644
index 0000000..d4c7a18
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/022-HIVE-12807.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD COLUMN CQ_HIGHEST_TXN_ID bigint;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/023-HIVE-12814.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/023-HIVE-12814.postgres.sql b/metastore/scripts/upgrade/postgres/023-HIVE-12814.postgres.sql
new file mode 100644
index 0000000..37ef99e
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/023-HIVE-12814.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD COLUMN CQ_META_INFO bytea;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/024-HIVE-12816.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/024-HIVE-12816.postgres.sql b/metastore/scripts/upgrade/postgres/024-HIVE-12816.postgres.sql
new file mode 100644
index 0000000..fa987d9
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/024-HIVE-12816.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE COMPACTION_QUEUE ADD COLUMN CQ_HADOOP_JOB_ID varchar(32);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/025-HIVE-12818.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/025-HIVE-12818.postgres.sql b/metastore/scripts/upgrade/postgres/025-HIVE-12818.postgres.sql
new file mode 100644
index 0000000..5eb2f26
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/025-HIVE-12818.postgres.sql
@@ -0,0 +1,17 @@
+CREATE TABLE COMPLETED_COMPACTIONS (
+  CC_ID bigint PRIMARY KEY,
+  CC_DATABASE varchar(128) NOT NULL,
+  CC_TABLE varchar(128) NOT NULL,
+  CC_PARTITION varchar(767),
+  CC_STATE char(1) NOT NULL,
+  CC_TYPE char(1) NOT NULL,
+  CC_WORKER_ID varchar(128),
+  CC_START bigint,
+  CC_END bigint,
+  CC_RUN_AS varchar(128),
+  CC_HIGHEST_TXN_ID bigint,
+  CC_META_INFO bytea,
+  CC_HADOOP_JOB_ID varchar(32)
+);
+
+

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/026-HIVE-12819.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/026-HIVE-12819.postgres.sql b/metastore/scripts/upgrade/postgres/026-HIVE-12819.postgres.sql
new file mode 100644
index 0000000..eceb910
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/026-HIVE-12819.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD COLUMN TXN_AGENT_INFO varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/027-HIVE-12821.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/027-HIVE-12821.postgres.sql b/metastore/scripts/upgrade/postgres/027-HIVE-12821.postgres.sql
new file mode 100644
index 0000000..ba5a51a
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/027-HIVE-12821.postgres.sql
@@ -0,0 +1,2 @@
+ALTER TABLE TXNS ADD COLUMN TXN_HEARTBEAT_COUNT integer;
+ALTER TABLE HIVE_LOCKS ADD COLUMN HL_HEARTBEAT_COUNT integer;

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql b/metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql
new file mode 100644
index 0000000..f4e9742
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE TXNS ADD COLUMN TXN_META_INFO varchar(128);

http://git-wip-us.apache.org/repos/asf/hive/blob/fe5cd560/metastore/scripts/upgrade/postgres/029-HIVE-12823.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/029-HIVE-12823.postgres.sql b/metastore/scripts/upgrade/postgres/029-HIVE-12823.postgres.sql
new file mode 100644
index 0000000..f7a980b
--- /dev/null
+++ b/metastore/scripts/upgrade/postgres/029-HIVE-12823.postgres.sql
@@ -0,0 +1 @@
+ALTER TABLE HIVE_LOCKS ADD COLUMN HL_AGENT_INFO varchar(128);


Mime
View raw message