mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
A fix for Bug#7209 "Client error with "Access Denied" on updates
when high concurrency": remove HASH::current_record and make it an external search parameter, so that it can not be the cause of a race condition under high concurrent load. The bug was in a race condition in table_hash_search, when column_priv_hash.current_record was overwritten simultaneously by multiple threads, causing the search for a suitable grant record to fail. No test case as the bug is repeatable only under concurrent load.
This commit is contained in:
@ -1988,14 +1988,15 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
|
||||
char helping [NAME_LEN*2+USERNAME_LENGTH+3];
|
||||
uint len;
|
||||
GRANT_TABLE *grant_table,*found=0;
|
||||
HASH_SEARCH_STATE state;
|
||||
|
||||
len = (uint) (strmov(strmov(strmov(helping,user)+1,db)+1,tname)-helping)+ 1;
|
||||
for (grant_table=(GRANT_TABLE*) hash_search(&column_priv_hash,
|
||||
(byte*) helping,
|
||||
len) ;
|
||||
for (grant_table=(GRANT_TABLE*) hash_first(&column_priv_hash,
|
||||
(byte*) helping,
|
||||
len, &state) ;
|
||||
grant_table ;
|
||||
grant_table= (GRANT_TABLE*) hash_next(&column_priv_hash,(byte*) helping,
|
||||
len))
|
||||
len, &state))
|
||||
{
|
||||
if (exact)
|
||||
{
|
||||
|
Reference in New Issue
Block a user