Merge lp:~vlad-lesin/percona-server/5.5-bug1083377 into lp:percona-server/5.5

Proposed by Vlad Lesin
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 377
Proposed branch: lp:~vlad-lesin/percona-server/5.5-bug1083377
Merge into: lp:percona-server/5.5
Diff against target: 79 lines (+28/-4)
3 files modified
Percona-Server/mysql-test/r/information_schema.result (+4/-0)
Percona-Server/mysql-test/t/information_schema.test (+8/-0)
Percona-Server/sql/sql_acl.cc (+16/-4)
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/5.5-bug1083377
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Sergei Glushchenko (community) g2 Approve
Review via email: mp+137239@code.launchpad.net

Description of the change

Fix for bug #1083377. The original patch can be found here: http://bazaar.launchpad.net/~maria-captains/maria/5.3/revision/2643.153.26 .

Jenkins:
http://jenkins.percona.com/view/PS 5.5/job/percona-server-5.5-param/591/

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/mysql-test/r/information_schema.result'
--- Percona-Server/mysql-test/r/information_schema.result 2012-10-17 03:47:45 +0000
+++ Percona-Server/mysql-test/r/information_schema.result 2012-11-30 15:41:27 +0000
@@ -1757,6 +1757,10 @@
1757length(CAST(b AS CHAR))1757length(CAST(b AS CHAR))
175820175820
1759DROP TABLE ubig;1759DROP TABLE ubig;
1760grant usage on *.* to mysqltest_1@localhost;
1761select 1 from information_schema.tables where table_schema=repeat('a', 2000);
17621
1763drop user mysqltest_1@localhost;
1760End of 5.1 tests.1764End of 5.1 tests.
1761#1765#
1762# Additional test for WL#3726 "DDL locking for all metadata objects"1766# Additional test for WL#3726 "DDL locking for all metadata objects"
17631767
=== modified file 'Percona-Server/mysql-test/t/information_schema.test'
--- Percona-Server/mysql-test/t/information_schema.test 2012-07-31 05:33:11 +0000
+++ Percona-Server/mysql-test/t/information_schema.test 2012-11-30 15:41:27 +0000
@@ -1444,6 +1444,14 @@
14441444
1445DROP TABLE ubig;1445DROP TABLE ubig;
14461446
1447#Bug 1083377
1448grant usage on *.* to mysqltest_1@localhost;
1449connect (con1, localhost, mysqltest_1,,);
1450connection con1;
1451select 1 from information_schema.tables where table_schema=repeat('a', 2000);
1452connection default;
1453disconnect con1;
1454drop user mysqltest_1@localhost;
14471455
1448--echo End of 5.1 tests.1456--echo End of 5.1 tests.
14491457
14501458
=== modified file 'Percona-Server/sql/sql_acl.cc'
--- Percona-Server/sql/sql_acl.cc 2012-08-07 06:10:00 +0000
+++ Percona-Server/sql/sql_acl.cc 2012-11-30 15:41:27 +0000
@@ -1754,14 +1754,20 @@
1754 acl_entry *entry;1754 acl_entry *entry;
1755 DBUG_ENTER("acl_get");1755 DBUG_ENTER("acl_get");
17561756
1757 mysql_mutex_lock(&acl_cache->lock);1757 tmp_db= strmov(strmov(key, ip ? ip : "") + 1, user) + 1;
1758 end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db);1758 end= strnmov(tmp_db, db, key + sizeof(key) - tmp_db);
1759
1760 if (end >= key + sizeof(key)) // db name was truncated
1761 DBUG_RETURN(0); // no privileges for an invalid db name
1762
1759 if (lower_case_table_names)1763 if (lower_case_table_names)
1760 {1764 {
1761 my_casedn_str(files_charset_info, tmp_db);1765 my_casedn_str(files_charset_info, tmp_db);
1762 db=tmp_db;1766 db=tmp_db;
1763 }1767 }
1764 key_length= (size_t) (end-key);1768 key_length= (size_t) (end-key);
1769
1770 mysql_mutex_lock(&acl_cache->lock);
1765 if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search((uchar*) key,1771 if (!db_is_pattern && (entry=(acl_entry*) acl_cache->search((uchar*) key,
1766 key_length)))1772 key_length)))
1767 {1773 {
@@ -5114,11 +5120,17 @@
5114bool check_grant_db(THD *thd,const char *db)5120bool check_grant_db(THD *thd,const char *db)
5115{5121{
5116 Security_context *sctx= thd->security_ctx;5122 Security_context *sctx= thd->security_ctx;
5117 char helping [NAME_LEN+USERNAME_LENGTH+2];5123 char helping [NAME_LEN+USERNAME_LENGTH+2], *end;
5118 uint len;5124 uint len;
5119 bool error= TRUE;5125 bool error= TRUE;
51205126
5121 len= (uint) (strmov(strmov(helping, sctx->priv_user) + 1, db) - helping) + 1;5127 end= strmov(helping, sctx->priv_user) + 1;
5128 end= strnmov(end, db, helping + sizeof(helping) - end);
5129
5130 if (end >= helping + sizeof(helping)) // db name was truncated
5131 return 1; // no privileges for an invalid db name
5132
5133 len= (uint) (end - helping) + 1;
51225134
5123 mysql_rwlock_rdlock(&LOCK_grant);5135 mysql_rwlock_rdlock(&LOCK_grant);
51245136

Subscribers

People subscribed via source and target branches