summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
commit6dd41e008eb2e384913d970e79aa01cd886891ec (patch)
tree5767ac99dab47612131b29985efd48b903c55dd3 /sql/table.h
parent97aa07abf544870faa0956784f33f158b092b2e5 (diff)
downloadmariadb-git-6dd41e008eb2e384913d970e79aa01cd886891ec.tar.gz
MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
When view is merged by DT_MERGE_FOR_INSERT it is then skipped from processing and doesn't update WHERE clause with vers_setup_conds(). Note that view itself cannot work in vers_setup_conds() because it doesn't have row_start, row_end fields. Thus it is required to descend down to material TABLE_LIST through calls of mysql_derived_prepare() and run vers_setup_conds() from there. Luckily, all views (views of views, views of views of views, etc.) are linked in one list through next_global pointer, so we can skip all views of views and get straight to non-view TABLE_LIST by checking its merge_underlying_list property for zero value (it is assigned by DT_MERGE_FOR_INSERT for merged derived tables). We have to do that only for UPDATE and DELETE. Other DML commands don't use WHERE clause. MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA LOAD DATA does not use WHERE and the above call of vers_setup_conds() is not needed. unit->prepare() led to wrongly locked temporary table.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.h b/sql/table.h
index ca5565250de..86e30034449 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -321,7 +321,7 @@ typedef struct st_grant_info
enum tmp_table_type
{
- NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
+ NO_TMP_TABLE= 0, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };