Gbase中如果要rename一张表,所需要的最小权限
以y4用户执行rename表的操作
gbase> alter table t8 rename to t88;
ERROR 1142 (42000): DROP,ALTER command denied to user ‘y4’@‘127.0.0.1’ for table ‘t8’
gbase>
gbase> alter table t8 rename to t88;
ERROR 1142 (42000): INSERT,CREATE command denied to user ‘y4’@‘127.0.0.1’ for table ‘t88’
gbase>
gbase> alter table t8 rename to t88;
Query OK, 0 rows affected (Elapsed: 00:00:00.23)
gbase> show grants for y4;
±--------------------------------------------------------------------------------------------------+
| Grants for y4@% |
±--------------------------------------------------------------------------------------------------+
| GRANT USAGE ON . TO ‘y4’@’%’ IDENTIFIED BY PASSWORD ‘E7E7’ |
| GRANT SELECT ON “testdb”. TO ‘y4’@’%’ |
| GRANT INSERT, CREATE ON “testdb”.“t88” TO ‘y4’@’%’ |
| GRANT DROP, ALTER ON “testdb”.“t8” TO ‘y4’@’%’ |
±--------------------------------------------------------------------------------------------------+
4 rows in set (Elapsed: 00:00:00.00)
gbase中对大表进行rename的操作,一闪而过,rename命令会直接修改底层的.frm文件,以及变更了数据字典中的table name,不会真的重新建表迁移数据。




