summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-09-10 16:12:50 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-09-10 16:15:23 +0300
commit6b61f1bbad1a57509d1cd0c09e80e31fffcfc67d (patch)
tree6ee6542fdfe676c1d91e330ef3b46186f9e69267 /storage
parentb02c722e7ad5c1de0697ff8beb085edeb486f594 (diff)
parentfc34e4c067ff6c043ff15a2b7ddd4bb0e2c1ca13 (diff)
downloadmariadb-git-6b61f1bbad1a57509d1cd0c09e80e31fffcfc67d.tar.gz
MDEV-17161 TRUNCATE TABLE fails after upgrade from 10.1
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
-rw-r--r--storage/innobase/handler/ha_innodb.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 2776ca18892..60ed3536950 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -12220,9 +12220,7 @@ create_table_info_t::gcols_in_fulltext_or_spatial()
/** Prepare to create a new table to an InnoDB database.
@param[in] name Table name
@return error number */
-int
-create_table_info_t::prepare_create_table(
- const char* name)
+int create_table_info_t::prepare_create_table(const char* name, bool strict)
{
DBUG_ENTER("prepare_create_table");
@@ -12245,7 +12243,7 @@ create_table_info_t::prepare_create_table(
because InnoDB might actually support the option, but not under
the current conditions. The messages revealing the specific
problems are reported inside this function. */
- if (create_options_are_invalid()) {
+ if (strict && create_options_are_invalid()) {
DBUG_RETURN(HA_WRONG_CREATE_OPTION);
}
@@ -12572,7 +12570,7 @@ ha_innobase::create(
file_per_table, trx);
if ((error = info.initialize())
- || (error = info.prepare_create_table(name))) {
+ || (error = info.prepare_create_table(name, !trx))) {
if (trx) {
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 8b50129c946..1188eb7f033 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -706,7 +706,7 @@ public:
bool create_option_tablespace_is_valid();
/** Prepare to create a table. */
- int prepare_create_table(const char* name);
+ int prepare_create_table(const char* name, bool strict = true);
void allocate_trx();