diff options
author | Michael Widenius <monty@mariadb.org> | 2019-06-19 00:35:44 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2019-06-19 00:35:44 +0300 |
commit | 8acbf9c1f961aa1008ef509e059e1a09943f5ed3 (patch) | |
tree | f3b0b2c2d0510aea9e06a75eb4f949d0281ebd48 /sql/temporary_tables.cc | |
parent | b23c82fef38839f9f6b758091dfb5064c017f608 (diff) | |
download | mariadb-git-8acbf9c1f961aa1008ef509e059e1a09943f5ed3.tar.gz |
MDEV-19595 fixed
The test cases for the MDEV found several independent bugs
in MariaDB server and Aria:
- If a temporary table was marked as crashed, it could never
be deleted.
- Opening of a crashed temporary table gave an error message
but the error was never forwarded to the caller which caused
an assert() in my_ok()
- init_read_record() did mmap of all temporary tables, which is
probably not a good idea as this area can potentially be
very big. Changed code to only mmap internal temporary tables.
- mmap-ed tables where not unmapped in case of repair/optimize
which caused bad data in table and crashes if the original
table files where replaced with new ones (as the old mmap
was still in place). Fixed by removing the mmap in case
of repair.
- Cleaned up usage of code that disabled mmap in Aria
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 15a81f4b375..ae7cb274843 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -382,6 +382,9 @@ bool THD::open_temporary_table(TABLE_LIST *tl) rgi_slave->is_parallel_exec && wait_for_prior_commit()) DBUG_RETURN(true); + + if (!table && is_error()) + DBUG_RETURN(true); // Error when opening table } if (!table) @@ -1103,7 +1106,7 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share, if (open_table_from_share(this, share, alias, open_in_engine ? (uint)HA_OPEN_KEYFILE : 0, - EXTRA_RECORD, ha_open_options, table, + EXTRA_RECORD, open_options | ha_open_options, table, open_in_engine ? false : true)) { my_free(table); |