Merge lp:~laurynas-biveinis/percona-server/i-s-temp-tables-fixes-5.1 into lp:percona-server/5.1
Status: | Work in progress |
---|---|
Proposed branch: | lp:~laurynas-biveinis/percona-server/i-s-temp-tables-fixes-5.1 |
Merge into: | lp:percona-server/5.1 |
Diff against target: |
151 lines (+50/-23) 2 files modified
Percona-Server/sql/sql_show.cc (+46/-23) Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc (+4/-0) |
To merge this branch: | bzr merge lp:~laurynas-biveinis/percona-server/i-s-temp-tables-fixes-5.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Fixing | ||
Laurynas Biveinis (community) | Needs Fixing | ||
Review via email: mp+185493@code.launchpad.net |
Description of the change
No BT or ST but QA blocker.
Fix three INFORMATION_
INFORMATION_
- bug 1222709 (Bug 951588 fix needs revert and re-fixing);
- bug 1113388 (field.cc:3822: virtual longlong Field_long:
Assertion `table->in_use == _current_thd()' failed);
- bug 1223335 (fill_temporary
thd->
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_
introduces a race condition as the field might be read by its owning
thread.
Fix bug 1223335 by locking thd->LOCK_
thd->temporary_
http://
Unmerged 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( ).
"// Assume that invoking handler: :table_ type() on a shared handler is safe" comment should be removed as well from store_temporary _table_ record( ). Too little an issue for a repush, thus will either fix if review requires repush otherwise, either before merging.