File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -596,6 +596,7 @@ var UserPrivTests = []UserPrivilegeTest{
596596 SetUpScript : []string {
597597 "CREATE USER testuser@localhost;" ,
598598 "GRANT REPLICATION_SLAVE_ADMIN ON *.* TO testuser@localhost;" ,
599+ "GRANT CLONE_ADMIN ON *.* TO testuser@localhost;" ,
599600 },
600601 Assertions : []UserPrivilegeTestAssertion {
601602 {
@@ -611,7 +612,7 @@ var UserPrivTests = []UserPrivilegeTest{
611612 Query : "SHOW GRANTS FOR testuser@localhost;" ,
612613 Expected : []sql.Row {
613614 {"GRANT USAGE ON *.* TO `testuser`@`localhost`" },
614- {"GRANT REPLICATION_SLAVE_ADMIN ON *.* TO `testuser`@`localhost`" },
615+ {"GRANT CLONE_ADMIN, REPLICATION_SLAVE_ADMIN ON *.* TO `testuser`@`localhost`" },
615616 },
616617 },
617618 {
Original file line number Diff line number Diff line change 1+ // Copyright 2022 Dolthub, Inc.
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ package plan
16+
17+ // DynamicPrivilege_CloneAdmin is the dynamic privilege required to execute clone commands.
18+ // https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_clone-admin
19+ const DynamicPrivilege_CloneAdmin = "clone_admin"
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ func (p *Privilege) String() string {
217217func (p * Privilege ) IsValidDynamic () bool {
218218 if p .Type == PrivilegeType_Dynamic {
219219 switch p .Dynamic {
220- case DynamicPrivilege_ReplicationSlaveAdmin :
220+ case DynamicPrivilege_ReplicationSlaveAdmin , DynamicPrivilege_CloneAdmin :
221221 return true
222222 }
223223 }
You can’t perform that action at this time.
0 commit comments