Skip to content

Commit

Permalink
[#5498] improvement: Modify the length limit of privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
jerqi committed Nov 8, 2024
1 parent eb3b6db commit 75aa451
Show file tree
Hide file tree
Showing 11 changed files with 1,143 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ private ConfigConstants() {}

/** The version number for the 0.7.0 release. */
public static final String VERSION_0_7_0 = "0.7.0";

/** The version number for the 0.8.0 release. */
public static final String VERSION_0_8_0 = "0.8.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String startH2Database(Config config) {
Statement statement = connection.createStatement()) {
String sqlContent =
FileUtils.readFileToString(
new File(gravitinoHome + "/scripts/h2/schema-0.7.0-h2.sql"), StandardCharsets.UTF_8);
new File(gravitinoHome + "/scripts/h2/schema-0.8.0-h2.sql"), StandardCharsets.UTF_8);

statement.execute(sqlContent);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void init() {

private static void prepareJdbcTable() {
// Read the ddl sql to create table
String scriptPath = "h2/schema-0.7.0-h2.sql";
String scriptPath = "h2/schema-0.8.0-h2.sql";
try (SqlSession sqlSession =
SqlSessionFactoryHelper.getInstance().getSqlSessionFactory().openSession(true);
Connection connection = sqlSession.getConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static void setup() {
new File(
gravitinoHome
+ String.format(
"/scripts/mysql/schema-%s-mysql.sql", ConfigConstants.VERSION_0_5_0)),
"/scripts/mysql/schema-%s-mysql.sql", ConfigConstants.VERSION_0_8_0)),
"UTF-8");
String[] initMySQLBackendSqls =
Arrays.stream(mysqlContent.split(";"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public String startAndInitPGBackend() {
gravitinoHome
+ String.format(
"/scripts/postgresql/schema-%s-postgresql.sql",
ConfigConstants.VERSION_0_7_0)),
ConfigConstants.VERSION_0_8_0)),
"UTF-8");

String[] initPGBackendSqls =
Expand Down Expand Up @@ -239,7 +239,7 @@ public String startAndInitMySQLBackend() {
new File(
gravitinoHome
+ String.format(
"/scripts/mysql/schema-%s-mysql.sql", ConfigConstants.VERSION_0_7_0)),
"/scripts/mysql/schema-%s-mysql.sql", ConfigConstants.VERSION_0_8_0)),
"UTF-8");

String[] initMySQLBackendSqls =
Expand Down
291 changes: 291 additions & 0 deletions scripts/h2/schema-0.8.0-h2.sql

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions scripts/h2/upgrade-0.7.0-to-0.8.0-h2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file--
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"). You may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
ALTER TABLE `role_meta_securable_object` ALTER COLUMN `privilege_names` TEXT(81920);
ALTER TABLE `role_meta_securable_object` ALTER COLUMN `privilege_conditions` TEXT(81920);
282 changes: 282 additions & 0 deletions scripts/mysql/schema-0.8.0-mysql.sql

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions scripts/mysql/upgrade-0.7.0-to-0.8.0-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file--
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"). You may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
ALTER TABLE `role_meta_securable_object` MODIFY COLUMN `privilege_names` TEXT(81920);
ALTER TABLE `role_meta_securable_object` MODIFY COLUMN `privilege_conditions` TEXT(81920);
Loading

0 comments on commit 75aa451

Please sign in to comment.