summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-05-25 17:01:38 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-05-25 17:01:38 -0300
commit3c279d9a5a45d734c7cdd2b641520e199e342f95 (patch)
treefead1c9e257aedfb5c08da6db9ed7997e8af9fcf /sql/table.h
parenta3c080be7ac95ce7f6f384a07f9ff0b31fd33a0f (diff)
downloadmariadb-git-3c279d9a5a45d734c7cdd2b641520e199e342f95.tar.gz
Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
The problem was that TRUNCATE TABLE didn't take a exclusive lock on a table if it resorted to truncating via delete of all rows in the table. Specifically for InnoDB tables, this could break proper isolation as InnoDB ends up aborting some granted locks when truncating a table. The solution is to take a exclusive metadata lock before TRUNCATE TABLE can proceed. This guarantees that no other transaction is using the table. Incompatible change: Truncate via delete no longer fails if sql_safe_updates is activated (this was a undocumented side effect).
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/sql/table.h b/sql/table.h
index ea585208b83..cb773052c8b 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -20,6 +20,7 @@
#include "sql_plist.h"
#include "sql_list.h" /* Sql_alloc */
#include "mdl.h"
+#include "datadict.h"
#ifndef MYSQL_CLIENT
@@ -305,14 +306,6 @@ enum tmp_table_type
NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
-
-enum frm_type_enum
-{
- FRMTYPE_ERROR= 0,
- FRMTYPE_TABLE,
- FRMTYPE_VIEW
-};
-
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
typedef struct st_filesort_info