diff options
author | Monty <monty@mariadb.org> | 2018-02-07 02:39:40 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-02-07 02:39:40 +0200 |
commit | 6ba06cf763a72b5b812fd7eadc076fdf31910c56 (patch) | |
tree | 7cabead8b39b533f2af87cb3de1344d8074f6a5d /mysql-test | |
parent | a0417ccc3af2d33c84f306111aa4eb51baf0594f (diff) | |
download | mariadb-git-6ba06cf763a72b5b812fd7eadc076fdf31910c56.tar.gz |
On upgrade Truncate_versioning_privilege was not correct set
Fixed that Truncate_versioning_privilege works as any other privilege
during upgrade:
- If the privilege field does not exists, add it to the user and db tables.
If the user had super_privilege then the user will also get the new
Truncate_versioning_privilege.
This is done to ensure that if one has GRANT ALL PRIVILEGE before, one
will continue to have it after running mysql_upgrade.
This also fixes a bug where the Truncate_versioning_privilege
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysql_upgrade.result | 18 | ||||
-rw-r--r-- | mysql-test/t/mysql_upgrade.test | 20 |
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 5da7e3149ec..12e52463ce4 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -571,3 +571,21 @@ t1 CREATE TABLE `t1` ( DROP TABLE test.t1; SET GLOBAL enforce_storage_engine=NULL; End of 10.1 tests +Start of 10.3 tests +# +# Ensure that mysql_upgrade correctly sets truncate_versioning_priv +# on upgrade from 10.2 +# +flush privileges; +CREATE USER 'user3'@'%'; +GRANT USAGE ON *.* TO 'user3'@'%'; +GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; +alter table mysql.user drop column Truncate_versioning_priv; +flush privileges; +Run mysql_upgrade with all privileges on a user +flush privileges; +SHOW GRANTS FOR 'user3'@'%'; +Grants for user3@% +GRANT USAGE ON *.* TO 'user3'@'%' +GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%' +DROP USER 'user3'@'%'; diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index a19be30e68f..c8992d58378 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -219,3 +219,23 @@ DROP TABLE test.t1; SET GLOBAL enforce_storage_engine=NULL; --echo End of 10.1 tests + +--echo Start of 10.3 tests + +--echo # +--echo # Ensure that mysql_upgrade correctly sets truncate_versioning_priv +--echo # on upgrade from 10.2 +--echo # + +flush privileges; +CREATE USER 'user3'@'%'; +GRANT USAGE ON *.* TO 'user3'@'%'; +GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; +alter table mysql.user drop column Truncate_versioning_priv; +flush privileges; +--echo Run mysql_upgrade with all privileges on a user +--exec $MYSQL_UPGRADE --force --silent 2>&1 +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info +flush privileges; +SHOW GRANTS FOR 'user3'@'%'; +DROP USER 'user3'@'%'; |