mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#16470 crash on grant if old grant tables
Loading 4.1 into 5.0 or 5.1 failed silently because procs_priv table missing. This caused the server to crash on any attempt to store new grants because of uninitialized structures. This patch breaks up the grant loading function into two phases to allow for procs_priv table to fail with an warning instead of crashing the server.
This commit is contained in:
@@ -6293,24 +6293,23 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Reload/resets privileges and the different caches.
|
||||
/**
|
||||
@brief Reload/resets privileges and the different caches.
|
||||
|
||||
SYNOPSIS
|
||||
reload_acl_and_cache()
|
||||
thd Thread handler (can be NULL!)
|
||||
options What should be reset/reloaded (tables, privileges,
|
||||
slave...)
|
||||
tables Tables to flush (if any)
|
||||
write_to_binlog Depending on 'options', it may be very bad to write the
|
||||
query to the binlog (e.g. FLUSH SLAVE); this is a
|
||||
pointer where reload_acl_and_cache() will put 0 if
|
||||
it thinks we really should not write to the binlog.
|
||||
Otherwise it will put 1.
|
||||
@param thd Thread handler (can be NULL!)
|
||||
@param options What should be reset/reloaded (tables, privileges, slave...)
|
||||
@param tables Tables to flush (if any)
|
||||
@param write_to_binlog True if we can write to the binlog.
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
!=0 error. thd->killed or thd->net.report_error is set
|
||||
@note Depending on 'options', it may be very bad to write the
|
||||
query to the binlog (e.g. FLUSH SLAVE); this is a
|
||||
pointer where reload_acl_and_cache() will put 0 if
|
||||
it thinks we really should not write to the binlog.
|
||||
Otherwise it will put 1.
|
||||
|
||||
@return Error status code
|
||||
@retval 0 Ok
|
||||
@retval !=0 Error; thd->killed or thd->net.report_error is set
|
||||
*/
|
||||
|
||||
bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
|
||||
|
||||
Reference in New Issue
Block a user