summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2008-10-10 17:14:39 +0300
committerMichael Widenius <monty@mysql.com>2008-10-10 17:14:39 +0300
commit3bbba834071dfbad3317efee53de3c3270e70e7b (patch)
tree3b4a61d7cc095dc67b8d679d483cfa3c5c7a6cdf /sql/ha_partition.cc
parent2a9d33f07d18a7180cb02a4f74f42d208dc0e2c0 (diff)
downloadmariadb-git-3bbba834071dfbad3317efee53de3c3270e70e7b.tar.gz
Fix for bug#39226 Maria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES
The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction. Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION include/my_base.h: Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed mysql-test/r/maria.result: Test cases for bugs fixed mysql-test/t/maria.test: Test cases for bugs fixed sql/ha_partition.cc: Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226) Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227) sql/sql_base.cc: Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit storage/maria/ma_extra.c: If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction. This is safe as this is only used as part of flush tables or when the table is not part of a transaction
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b239253fbc7..1acdca9d8e7 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -4935,6 +4935,7 @@ int ha_partition::extra(enum ha_extra_function operation)
case HA_EXTRA_KEYREAD:
case HA_EXTRA_NO_KEYREAD:
case HA_EXTRA_FLUSH:
+ case HA_EXTRA_PREPARE_FOR_FORCED_CLOSE:
DBUG_RETURN(loop_extra(operation));
/* Category 2), used by non-MyISAM handlers */
@@ -4958,8 +4959,7 @@ int ha_partition::extra(enum ha_extra_function operation)
case HA_EXTRA_PREPARE_FOR_DROP:
case HA_EXTRA_FLUSH_CACHE:
{
- if (m_myisam)
- DBUG_RETURN(loop_extra(operation));
+ DBUG_RETURN(loop_extra(operation));
break;
}
case HA_EXTRA_CACHE:
@@ -5153,8 +5153,8 @@ int ha_partition::loop_extra(enum ha_extra_function operation)
DBUG_ENTER("ha_partition::loop_extra()");
/*
- TODO, 5.2: this is where you could possibly add optimisations to add the bitmap
- _if_ a SELECT.
+ TODO, 5.2: this is where you could possibly add optimisations to add the
+ bitmap _if_ a SELECT.
*/
for (file= m_file; *file; file++)
{