3527 Dmitry Shulga 2010-10-13
Fixed bug#36742 - GRANT hostname case handling inconsistent.
@ mysql-test/r/grant.result
It was added result for test case for bug#36742.
@ mysql-test/t/grant.test
It was added test case for bug#36742.
@ sql/sql_yacc.yy
It was added convertation of host name part of user name to lowercase.
modified:
mysql-test/r/grant.result
mysql-test/t/grant.test
sql/sql_yacc.yy
3526 Li-Bing.Song@stripped 2010-10-11
Bug#56226 Table map set to 0 after altering MyISAM table
After ALTER TABLE which changed only table's metadata, row-based
binlog sometimes got corrupted since the tablemap was unexpectedly
set to 0 for subsequent updates to the same table.
ALTER TABLE which changed only table's metadata always reset
table_map_id for the table share to 0. Despite the fact that
0 is a valid value for table_map_id, this step caused problems
as it could have created situation in which we had more than
one table share with table_map_id equal 0. If more than one
table with table_map_id are 0 were updated in the same statement,
updates to these different tables were written into the same
rows event. This caused slave server to crash.
This bug happens only on 5.1. It doesn't affect 5.5+.
This patch solves this problem by ensuring that ALTER TABLE
statements which change metadata only never reset table_map_id
to 0. To do this it changes reopen_table() to correctly use
refreshed table_map_id value instead of using the old one/
resetting it.
@ mysql-test/suite/rpl/r/rpl_alter.result
Add test for BUG#56226
@ mysql-test/suite/rpl/t/rpl_alter.test
Add test for BUG#56226
modified:
mysql-test/suite/rpl/r/rpl_alter.result
mysql-test/suite/rpl/t/rpl_alter.test
sql/sql_base.cc
=== modified file 'mysql-test/r/grant.result'
--- a/mysql-test/r/grant.result 2010-07-08 18:46:26 +0000
+++ b/mysql-test/r/grant.result 2010-10-13 05:28:58 +0000
@@ -1429,3 +1429,14 @@ DROP USER 'testbug'@localhost;
DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+#
+# Bug #36742
+#
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+host user
+localhost myuser
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
=== modified file 'mysql-test/t/grant.test'
--- a/mysql-test/t/grant.test 2010-07-08 18:46:26 +0000
+++ b/mysql-test/t/grant.test 2010-10-13 05:28:58 +0000
@@ -1550,5 +1550,15 @@ DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+--echo #
+--echo # Bug #36742
+--echo #
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2010-08-30 22:16:38 +0000
+++ b/sql/sql_yacc.yy 2010-10-13 05:28:58 +0000
@@ -11567,6 +11567,12 @@ user:
system_charset_info, 0) ||
check_host_name(&$$->host))
MYSQL_YYABORT;
+ /*
+ Convert hostname part of username to lowercase.
+ It's OK to use in-place lowercase as long as
+ the character set is utf8.
+ */
+ my_casedn_str(system_charset_info, $$->host.str);
}
| CURRENT_USER optional_braces
{
Attachment: [text/bzr-bundle] bzr/dmitry.shulga@sun.com-20101013052858-4p8vvy5lrth7zarw.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-bugteam branch (Dmitry.Shulga:3526 to 3527)Bug#36742 | Dmitry Shulga | 13 Oct |