summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorVesa Pentti <vesa.pentti@mariadb.net>2018-01-07 19:14:27 +0000
committerVesa Pentti <vesa.pentti@mariadb.net>2018-01-08 16:00:08 +0000
commit373ae4e86edd772f367bd8b57be07878246b5b9f (patch)
tree7ec398ae2f0140f1374bd6b38695ec879bfcef07 /sql/handler.cc
parent5208e898079ef7f226bdb2275e5a528ad3663b67 (diff)
downloadmariadb-git-bb-10.2-pentve.tar.gz
MDEV-14185 -- CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDBbb-10.2-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.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 7eed722a971..fcba43fd492 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3997,7 +3997,8 @@ void handler::mark_trx_read_write_internal()
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();
@@ -4383,7 +4384,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,
@@ -4391,8 +4393,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);
}