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

mchades pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 2895bb941d [#7467] fix(mysql) There is a syntax error in the 
policy_version_info table in the upgrade-0.9.0-to-1.0.0-mysql.sql file. (#7468)
2895bb941d is described below

commit 2895bb941d8f401577081332b7090d07353c502b
Author: KeeProMise <[email protected]>
AuthorDate: Wed Jun 25 12:06:25 2025 +0800

    [#7467] fix(mysql) There is a syntax error in the policy_version_info table 
in the upgrade-0.9.0-to-1.0.0-mysql.sql file. (#7468)
    
    ### What changes were proposed in this pull request?
    
    fix syntax
    
    ### Why are the changes needed?
    
    MySQL [gravitino]> CREATE TABLE IF NOT EXISTS `policy_version_info` (
    -> `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto
    increment id',
    -> `metalake_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'metalake id',
        ->     `policy_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'policy id',
    -> `version` INT UNSIGNED NOT NULL COMMENT 'policy info version',
    -> `policy_comment` TEXT DEFAULT NULL COMMENT 'policy info comment',
    -> `enabled` TINYINT(1) DEFAULT 1 COMMENT 'whether the policy is
    enabled, 0 is disabled, 1 is enabled',
        ->     `content` MEDIUMTEXT DEFAULT NULL COMMENT 'policy content',
    -> `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'policy
    deleted at',
        ->     PRIMARY KEY (`id`),
    -> UNIQUE KEY `uk_pod_ver_del` (`policy_id`, `version`, `deleted_at`),
        ->     KEY `idx_mid` (`metalake_id`),
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT
    'policy version info';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the
    manual that corresponds to your MySQL server version for the right
    syntax to use near ') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
    COLLATE=utf8mb4_bin COMMENT 'policy vers' at line 13
    
    Fix: #7467
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    Execute the modified statement in any MySQL client.
---
 scripts/mysql/upgrade-0.9.0-to-1.0.0-mysql.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mysql/upgrade-0.9.0-to-1.0.0-mysql.sql 
b/scripts/mysql/upgrade-0.9.0-to-1.0.0-mysql.sql
index fb32e96b27..54d54cd789 100644
--- a/scripts/mysql/upgrade-0.9.0-to-1.0.0-mysql.sql
+++ b/scripts/mysql/upgrade-0.9.0-to-1.0.0-mysql.sql
@@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS `policy_version_info` (
     `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'policy 
deleted at',
     PRIMARY KEY (`id`),
     UNIQUE KEY `uk_pod_ver_del` (`policy_id`, `version`, `deleted_at`),
-    KEY `idx_mid` (`metalake_id`),
+    KEY `idx_mid` (`metalake_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT 'policy 
version info';
 
 CREATE TABLE IF NOT EXISTS `policy_relation_meta` (

Reply via email to