yuqi1129 commented on code in PR #13957:
URL: https://github.com/apache/gravitino/pull/13957#discussion_r4626299423


##########
scripts/h2/schema-2.0.0-h2.sql:
##########
@@ -434,6 +434,18 @@ CREATE TABLE IF NOT EXISTS `policy_tag_relation_meta` (
     KEY `policy_tag_relation_meta_idx_tag_id` (`tag_id`)
 ) ENGINE=InnoDB;
 
+CREATE TABLE IF NOT EXISTS `policy_role_relation_meta` (
+    `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment 
id',
+    `policy_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'policy id',
+    `role_name` VARCHAR(128) NOT NULL COMMENT 'role name referenced by the 
policy content',

Review Comment:
   Non-blocking question: should H2 accept policy references up to the Java 
limit of 128 Unicode code points? I tested a role name consisting of 128 😀 
characters. It passed content validation, but policy creation failed when H2 
wrote this column because the name occupies 256 UTF-16 code units. H2’s 
existing role table has the same limit. The change here affects policies that 
reference a name before the role exists.
   
   If the 128-code-point limit is intended across backends, widening this 
derived column to `VARCHAR(256)` in both H2 scripts worked in my test: the 
128-character name round-tripped, and Java still rejected 129 and rolled back 
the write. If matching H2’s role table is intentional, a note about that limit 
would clarify the behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to