diff options
author | Vesa Pentti <vesa.pentti@mariadb.net> | 2018-01-07 19:14:27 +0000 |
---|---|---|
committer | Vesa Pentti <vesa.pentti@mariadb.net> | 2018-01-07 19:14:27 +0000 |
commit | 85d8d30a55b1dd7f1bc876b47ee6b6a53d7d9964 (patch) | |
tree | f17838193af77a44a8aa7658c8b008efd4c1e0c8 /sql/handler.cc | |
parent | ce4cdfa0f8691f47366d50acd6049b8cd7520e8a (diff) | |
download | mariadb-git-bb-10.1-pentve.tar.gz |
MDEV-14185 -- CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDBbb-10.1-pentve
* Did affect only transactional engines like InnoDB
* Note: During table creation handler's 'table_share' is NULL
* Now the transaction isn't marked rw for a temporary table when it's created
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index a5a28ceb777..4de20bca00e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3989,7 +3989,8 @@ handler::mark_trx_read_write() DBUG_ASSERT(has_transactions()); /* table_share can be NULL in ha_delete_table(). See implementation - of standalone function ha_delete_table() in sql_base.cc. + of standalone function ha_delete_table() in sql_base.cc. It can + also be NULL during table creation. */ if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE) ha_info->set_trx_read_write(); @@ -4374,7 +4375,8 @@ handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info_arg) int handler::ha_create_partitioning_metadata(const char *name, const char *old_name, - int action_flag) + int action_flag, + bool should_mark_rw) { /* Normally this is done when unlocked, but in fast_alter_partition_table, @@ -4382,8 +4384,11 @@ handler::ha_create_partitioning_metadata(const char *name, partitions. */ DBUG_ASSERT(m_lock_type == F_UNLCK || - (!old_name && strcmp(name, table_share->path.str))); - mark_trx_read_write(); + (!old_name && table_share && strcmp(name, table_share->path.str))); + if (should_mark_rw) + { + mark_trx_read_write(); + } return create_partitioning_metadata(name, old_name, action_flag); } |