Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
872a01b6
Commit
872a01b6
authored
Apr 28, 2014
by
Elena Stepanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6178 mysql_upgrade breaks databases with long user names
Added a test, the problem itself was fixed in MDEV-6068
parent
fbfa0043
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
0 deletions
+90
-0
mysql-test/r/mysql_upgrade.result
mysql-test/r/mysql_upgrade.result
+61
-0
mysql-test/t/mysql_upgrade.test
mysql-test/t/mysql_upgrade.test
+29
-0
No files found.
mysql-test/r/mysql_upgrade.result
View file @
872a01b6
...
...
@@ -329,4 +329,65 @@ performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
#
# MDEV-4332 Increase username length from 16 characters
# MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names
#
GRANT SELECT ON mysql.* TO very_long_user_name_number_1;
GRANT SELECT ON mysql.* TO very_long_user_name_number_2;
GRANT ALL ON *.* TO even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost WITH GRANT OPTION;
GRANT INSERT ON mysql.user TO very_long_user_name_number_1;
GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END;
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
definer
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost
SELECT grantor FROM mysql.tables_priv WHERE db = 'mysql' AND table_name = 'user';
grantor
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost
DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost;
DROP PROCEDURE test.pr;
End of tests
mysql-test/t/mysql_upgrade.test
View file @
872a01b6
...
...
@@ -131,4 +131,33 @@ let $MYSQLD_DATADIR= `select @@datadir`;
# so the following command should never fail.
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
--echo #
--echo # MDEV-4332 Increase username length from 16 characters
--echo # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names
--echo #
connection default;
GRANT SELECT ON mysql.* TO very_long_user_name_number_1;
GRANT SELECT ON mysql.* TO very_long_user_name_number_2;
GRANT ALL ON *.* TO even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost WITH GRANT OPTION;
--change_user even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length
GRANT INSERT ON mysql.user TO very_long_user_name_number_1;
GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END;
--change_user root
--replace_result $MYSQLTEST_VARDIR var
--exec $MYSQL_UPGRADE --force 2>&1
SELECT definer FROM mysql.proc WHERE db = '
test
' AND name = '
pr
';
SELECT grantor FROM mysql.tables_priv WHERE db = '
mysql
' AND table_name = '
user
'
;
DROP
USER
very_long_user_name_number_1
,
very_long_user_name_number_2
,
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length
@
localhost
;
DROP
PROCEDURE
test
.
pr
;
--
echo
End
of
tests
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment