bharos commented on code in PR #13957:
URL: https://github.com/apache/gravitino/pull/13957#discussion_r4632264241
##########
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:
Thanks for testing this. I'd keep it at 128 to match `role_meta` and the
other H2 name columns.
The length check (`EntityFieldLimits.checkMaxLength`) counts code points to
match MySQL and PostgreSQL, while H2 counts UTF-16 units. So every name column
on H2 has this gap: a role named with 65 😀 can't be created on H2 either, and
both fail with the same 400 from `ValueTooLongExceptions`. Widening only this
column would let a policy name a role that H2 can't store.
If H2 should accept 128 code points, that's a change to all its name
columns, so we may consider doing it as a separate issue.
--
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]