Fixed bug mdev-4019.

The bug could cause a crash when several connections needed
persistent statistics for the same table.

Also added a missing call of set_statistics_for_table() in the code
of the function mysql_update.
This commit is contained in:
Igor Babaev 2013-01-13 00:40:38 -08:00
commit 7d5c56cb41
7 changed files with 85 additions and 2 deletions

View file

@ -32,6 +32,7 @@
#include "sql_view.h" // check_key_in_view
#include "sp_head.h"
#include "sql_trigger.h"
#include "sql_statistics.h"
#include "probes_mysql.h"
#include "debug_sync.h"
#include "key.h" // is_key_used
@ -404,6 +405,7 @@ int mysql_update(THD *thd,
#endif
/* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
set_statistics_for_table(thd, table);
select= make_select(table, 0, 0, conds, 0, &error);
if (error || !limit || thd->is_error() ||