lp:~laurynas-biveinis/percona-server/i-s-temp-tables-fixes-5.1

Created by Laurynas Biveinis and last modified
Get this branch:
bzr branch lp:~laurynas-biveinis/percona-server/i-s-temp-tables-fixes-5.1
Only Laurynas Biveinis can upload to this branch. If you are Laurynas Biveinis please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Recent revisions

578. By Laurynas Biveinis

Fix three INFORMATION_SCHEMA.TEMPORARY_TABLES and
INFORMATION_SCHEMA.GLOBAL_TEMPORARY_TABLES bugs:

- bug 1222709 (Bug 951588 fix needs revert and re-fixing);
- bug 1113388 (field.cc:3822: virtual longlong Field_long::val_int():
  Assertion `table->in_use == _current_thd()' failed);
- bug 1223335 (fill_temporary_tables() does not protect
  thd->temporary_tables access with LOCK_temporary_tables).

The bug 1222709 and its duplicats stem from the bug 951588 fix calling
handler::clone() on a temp table handler in an attempt to make
handler::info() call safe for concurrency as it would be called on a
non-shared handler then. The problem with this approach is that
handler::clone() itself is not safe for concurrent calls. Thus remove
its call, and fix the original bug 951588 issue by only calling
handler::info() when it is safe to do so, that is, when the current
I_S-query-executing thread is the same as the temp table owning one.
For the rest, do not call handler::info() and just read the existing
statistic values.

At the same time, if zeroes are encountered in the stat file fields,
assume that handler::info() has never been called on the temp table
handler and return NULL instead of 0.

At the same time revert the ha_innodb::clone() changes that were
required to support the previous bug 951588 fix use.

Fix bug 1113388 by removing the temporary THD::in_use patching in
fill_global_temporary_tables(), which now server no purpose and only
introduces a race condition as the field might be read by its owning
thread.

Fix bug 1223335 by locking thd->LOCK_temporary_tables around
thd->temporary_tables iteration in fill_temporary_tables().

577. By Laurynas Biveinis

Merge lp:~gl-az/percona-server/ST-31919-5.1 again to fix the previous merge of the same branch

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:percona-server/5.6
This branch contains Public information 
Everyone can see this information.