summaryrefslogtreecommitdiff
path: root/sql/sql_table.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-08-20 19:15:48 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-08-20 19:15:48 +0200
commit8df0bf13ab5930333ae1148856533e7bff156296 (patch)
tree75374006b84ddce6925e927c4e7abbf59ef1b107 /sql/sql_table.h
parentf4cef8d31f6ee7afefe6cba16f817c01c46a63c2 (diff)
downloadmariadb-git-8df0bf13ab5930333ae1148856533e7bff156296.tar.gz
Bug#54747: Deadlock between REORGANIZE PARTITION and SELECT is not detected
The ALTER PARTITION and SELECT seemed to be deadlocked when having innodb_thread_concurrency = 1. Problem was that there was unreleased latches in the ALTER PARTITION thread which was needed by the SELECT thread to be able to continue. Solution was to release the latches by commit before requesting upgrade to exclusive MDL lock. Updated according to reviewers comments (3). mysql-test/r/partition_innodb.result: updated test result mysql-test/t/partition_innodb.test: added test sql/sql_partition.cc: Moved implicit commit into mysql_change_partition so that if latches are taken, they are always released before waiting on exclusive lock. sql/sql_table.cc: refactored the code to prepare and commit around copy_data_between_tables, to be able to reuse it in mysql_change_partitions sql/sql_table.h: exporting mysql_trans_prepare/commit_alter_copy_data
Diffstat (limited to 'sql/sql_table.h')
-rw-r--r--sql/sql_table.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_table.h b/sql/sql_table.h
index ae5beefea37..eb0b1aa94dd 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -143,6 +143,8 @@ bool mysql_create_table_no_lock(THD *thd, const char *db,
bool mysql_prepare_alter_table(THD *thd, TABLE *table,
HA_CREATE_INFO *create_info,
Alter_info *alter_info);
+bool mysql_trans_prepare_alter_copy_data(THD *thd);
+bool mysql_trans_commit_alter_copy_data(THD *thd);
bool mysql_alter_table(THD *thd, char *new_db, char *new_name,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,