You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2020/05/19 07:33:55 UTC

[hive] branch master updated: HIVE-23392: Metastore upgrade script TXN_LOCK_TBL rename inconsistency (Peter Varga via Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

pvary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 47d202b  HIVE-23392: Metastore upgrade script TXN_LOCK_TBL rename inconsistency (Peter Varga via Peter Vary)
47d202b is described below

commit 47d202ba8846bb55bc4835ee09e2c34f6e446c31
Author: Peter Varga <pv...@cloudera.com>
AuthorDate: Tue May 19 09:33:23 2020 +0200

    HIVE-23392: Metastore upgrade script TXN_LOCK_TBL rename inconsistency (Peter Varga via Peter Vary)
---
 .../metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql | 1 +
 .../metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql | 1 +
 .../metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql | 1 +
 .../src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql                | 1 +
 .../src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql            | 1 +
 5 files changed, 5 insertions(+)

diff --git a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
index db2f43d..421524b 100644
--- a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
@@ -81,6 +81,7 @@ UPDATE TXNS SET TXN_ID=TXN_ID_TMP;
 ALTER TABLE TXNS DROP COLUMN TXN_ID_TMP;
 
 RENAME TABLE NEXT_TXN_ID TO TXN_LOCK_TBL;
+RENAME COLUMN TXN_LOCK_TBL.NTXN_NEXT TO TXN_LOCK;
 
 -- This needs to be the last thing done.  Insert any changes above this line.
 UPDATE "APP".VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
diff --git a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
index 7583c5c..7709814 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
@@ -114,6 +114,7 @@ DROP TABLE TXNS;
 Exec sp_rename 'TMP_TXNS', 'TXNS';
 Exec sp_rename 'TMP_TXN_COMPONENTS', 'TXN_COMPONENTS';
 Exec sp_rename 'NEXT_TXN_ID', 'TXN_LOCK_TBL';
+Exec sp_rename 'TXN_LOCK_TBL.NTXN_NEXT', 'TXN_LOCK', 'COLUMN';
 
 ALTER TABLE TXN_COMPONENTS WITH CHECK ADD FOREIGN KEY(TC_TXNID) REFERENCES TXNS (TXN_ID);
 CREATE INDEX TC_TXNID_INDEX ON TXN_COMPONENTS (TC_TXNID);
diff --git a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
index 78a841a..0292066 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
@@ -88,6 +88,7 @@ PREPARE stmt FROM @s;
 EXECUTE stmt;
 DEALLOCATE PREPARE stmt;
 RENAME TABLE NEXT_TXN_ID TO TXN_LOCK_TBL;
+ALTER TABLE TXN_LOCK_TBL RENAME COLUMN NTXN_NEXT TO TXN_LOCK;
 
 -- These lines need to be last.  Insert any changes above.
 UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
index 51f52a4..fb28290 100644
--- a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
@@ -86,6 +86,7 @@ CREATE SEQUENCE TXNS_TXN_ID_SEQ INCREMENT BY 1 START WITH 1000000001 CACHE 20;
 ALTER TABLE TXNS MODIFY TXN_ID default TXNS_TXN_ID_SEQ.nextval;
 
 RENAME TABLE NEXT_TXN_ID TO TXN_LOCK_TBL;
+ALTER TABLE TXN_LOCK_TBL RENAME COLUMN NTXN_NEXT TO TXN_LOCK;
 
 -- These lines need to be last.  Insert any changes above.
 UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
index 63a5c44..ca799ba 100644
--- a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
@@ -211,6 +211,7 @@ select setval('"TXNS_TXN_ID_SEQ"',  (SELECT MAX("TXN_ID") FROM "TXNS"));
 ALTER TABLE "TXNS" ALTER "TXN_ID" SET DEFAULT nextval('"TXNS_TXN_ID_SEQ"');
 
 ALTER TABLE "NEXT_TXN_ID" RENAME TO "TXN_LOCK_TBL";
+ALTER TABLE "TXN_LOCK_TBL" RENAME COLUMN "NTXN_NEXT" TO "TXN_LOCK";
 
 -- These lines need to be last. Insert any changes above.
 UPDATE "VERSION" SET "SCHEMA_VERSION"='4.0.0', "VERSION_COMMENT"='Hive release version 4.0.0' where "VER_ID"=1;