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

dkuzmenko 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 f9497749d1f HIVE-27749: SchemaTool initSchema fails on Mariadb 10.2 
(Sourabh Badhya, reviewed by Denys Kuzmenko, Zsolt Miskolczi)
f9497749d1f is described below

commit f9497749d1f3868464d01e0356a27abe0612a089
Author: Sourabh Badhya <[email protected]>
AuthorDate: Mon Dec 18 17:35:21 2023 +0530

    HIVE-27749: SchemaTool initSchema fails on Mariadb 10.2 (Sourabh Badhya, 
reviewed by Denys Kuzmenko, Zsolt Miskolczi)
    
    Closes #4949
---
 .../src/main/sql/mysql/hive-schema-4.0.0-alpha-2.mysql.sql            | 2 +-
 .../src/main/sql/mysql/hive-schema-4.0.0-beta-1.mysql.sql             | 2 +-
 .../main/sql/mysql/upgrade-4.0.0-alpha-1-to-4.0.0-alpha-2.mysql.sql   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-alpha-2.mysql.sql
 
b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-alpha-2.mysql.sql
index 7aa3d46f2f4..3016f8021f6 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-alpha-2.mysql.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-alpha-2.mysql.sql
@@ -892,7 +892,7 @@ CREATE TABLE IF NOT EXISTS `NOTIFICATION_SEQUENCE`
     PRIMARY KEY (`NNI_ID`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
-ALTER TABLE `NOTIFICATION_SEQUENCE` MODIFY COLUMN `NNI_ID` BIGINT(20) 
GENERATED ALWAYS AS (1) STORED NOT NULL;
+ALTER TABLE `NOTIFICATION_SEQUENCE` ADD CONSTRAINT `ONE_ROW_CONSTRAINT` CHECK 
(`NNI_ID` = 1);
 
 INSERT INTO `NOTIFICATION_SEQUENCE` (`NEXT_EVENT_ID`) SELECT * from (select 1 
as `NOTIFICATION_SEQUENCE`) a WHERE (SELECT COUNT(*) FROM 
`NOTIFICATION_SEQUENCE`) = 0;
 
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-beta-1.mysql.sql
 
b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-beta-1.mysql.sql
index 04a99721fc6..e9d37d35774 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-beta-1.mysql.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0-beta-1.mysql.sql
@@ -894,7 +894,7 @@ CREATE TABLE IF NOT EXISTS `NOTIFICATION_SEQUENCE`
     PRIMARY KEY (`NNI_ID`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
-ALTER TABLE `NOTIFICATION_SEQUENCE` MODIFY COLUMN `NNI_ID` BIGINT(20) 
GENERATED ALWAYS AS (1) STORED NOT NULL;
+ALTER TABLE `NOTIFICATION_SEQUENCE` ADD CONSTRAINT `ONE_ROW_CONSTRAINT` CHECK 
(`NNI_ID` = 1);
 
 INSERT INTO `NOTIFICATION_SEQUENCE` (`NEXT_EVENT_ID`) SELECT * from (select 1 
as `NOTIFICATION_SEQUENCE`) a WHERE (SELECT COUNT(*) FROM 
`NOTIFICATION_SEQUENCE`) = 0;
 
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-1-to-4.0.0-alpha-2.mysql.sql
 
b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-1-to-4.0.0-alpha-2.mysql.sql
index e7a9a6f2116..951ac24507a 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-1-to-4.0.0-alpha-2.mysql.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-1-to-4.0.0-alpha-2.mysql.sql
@@ -5,8 +5,8 @@ ALTER TABLE `COMPLETED_COMPACTIONS` ADD COLUMN `CC_NEXT_TXN_ID` 
bigint;
 ALTER TABLE `COMPLETED_COMPACTIONS` ADD COLUMN `CC_TXN_ID` bigint;
 ALTER TABLE `COMPLETED_COMPACTIONS` ADD COLUMN `CC_COMMIT_TIME` bigint;
 
--- HIVE-26324
-ALTER TABLE `NOTIFICATION_SEQUENCE` MODIFY COLUMN `NNI_ID` INT GENERATED 
ALWAYS AS (1) STORED NOT NULL;
+-- HIVE-27749
+ALTER TABLE `NOTIFICATION_SEQUENCE` ADD CONSTRAINT `ONE_ROW_CONSTRAINT` CHECK 
(`NNI_ID` = 1);
 
 -- HIVE-26443
 ALTER TABLE `COMPACTION_QUEUE` ADD COLUMN `CQ_POOL_NAME` VARCHAR(128);

Reply via email to