diff options
author | Michael Widenius <monty@mariadb.org> | 2014-07-30 13:27:52 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2014-07-30 13:27:52 +0300 |
commit | 53643152296f007eb698d44f067016889b4d8470 (patch) | |
tree | 64e361e634f43062f8f362ff764d649896ba9d5e /sql/sql_derived.cc | |
parent | a1c1700b89ca22f8883d5ad0ee7d97eb0e1d60ff (diff) | |
download | mariadb-git-53643152296f007eb698d44f067016889b4d8470.tar.gz |
Fix for MDEV-6493: Assertion `table->file->stats.records > 0 || error' failure, or 'Invalid write' valgrind warnings, or crash on scenario with Aria table, view, LOCK TABLES
This bug only happens in case of paritioned tables used in LOCK TABLES and implicit_commit() was called
(as part of trying to execute a CREATE TABLE withing lock tables)
The problem was that Aria could not move the tables from one transaction to the new one, as thd->open_tables contained
a partitioned tables and not an Aria table.
Fix:
- Store a list of all open tables that are part of a share in share->open_tables
- In maria::implict_commit() use transaction->used_tables & share->open_tables to find out which tables
was part of the current transaction instead of using thd->open_tables, which may contain partitioned tables.
mysql-test/suite/maria/maria_partition.result:
Added test case
mysql-test/suite/maria/maria_partition.test:
Added test case
storage/maria/ha_maria.cc:
Use trn->used tables and share->open_tables to find out which tables was part of the current transaction instead of using thd->open_tables.
storage/maria/ma_close.c:
Remove closed table from share->open_list
storage/maria/ma_open.c:
Add table to share->open_list
storage/maria/ma_state.c:
Added comment
storage/maria/maria_def.h:
Added share->open_list, a list of all tables that is using this share.
Diffstat (limited to 'sql/sql_derived.cc')
0 files changed, 0 insertions, 0 deletions