Merge lp:~laurynas-biveinis/percona-server/bug951588-5.1 into lp:percona-server/5.1
Status: | Merged |
---|---|
Approved by: | Alexey Kopytov |
Approved revision: | no longer in the source branch. |
Merged at revision: | 452 |
Proposed branch: | lp:~laurynas-biveinis/percona-server/bug951588-5.1 |
Merge into: | lp:percona-server/5.1 |
Diff against target: |
113 lines (+53/-4) 4 files modified
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_bug_951588.result (+12/-0) Percona-Server/mysql-test/suite/innodb_plugin/t/percona_bug_951588.test (+29/-0) Percona-Server/sql/handler.cc (+2/-0) Percona-Server/sql/sql_show.cc (+10/-4) |
To merge this branch: | bzr merge lp:~laurynas-biveinis/percona-server/bug951588-5.1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Approve | ||
Review via email: mp+109272@code.launchpad.net |
This proposal supersedes a proposal from 2012-06-06.
Description of the change
Fix bug 951588 (Querying I_S.GLOBAL_
TEMPORARY_TABLES crashes threads working with temp tables)
The issue is caused by fill_global_
enumerating existing temp table handler objects that are possibly in
use by other threads. Then for each object the handler::info() method
is called in store_temporary
current_thd, prebuilt->trx and possibly other fields of any operation
in progress for that temp table handler.
The fix is to not invoke handler::info() method on the existing handler
objects in order not to interfere with their state. Instead we use
handler::clone() method first to get an independent handler pointing
to the same table and use it to invoke the handler::info() method and
read the stats.
Also simplify the code to get rid of "handle" local variable that
aliases already existing "file". Fix the type of "engineType" to
const char* and remove unnecessary cast.
For testing add new debug sync point "start_
of handler:
Add new test percona_bug_951988 that crashes without the fix and
passes with it.
Alexey's review comments have been addressed.
Jenkins: http://
Issue #23438.
Laurynas,
This looks good from a functional perspective. But the code in store_temporary _table_ record( ) is a bit messy, and the patch even adds a bit to that mess instead of cleaning it up.
There are 2 copies of the temp. table handler:
- 'handle' which was only used to get the storage engine type, and now, to clone file_handle_2
- 'file' which was used to get the actual stat values, and is now unused.
What about making 'file' a pointer to the cloned handler object. That would result in a bit cleaner code and less lines to touch?