1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV 7701 extra() calls for VP engine

Added Spider patches:
003_mariadb-10.0.15.vp.diff
060_mariadb-10.2.0.partition_reset_top_table_fields.diff

- Support HA_EXTRA_ADD_CHILDREN_LIST,HA_EXTRA_ATTACH_CHILDREN,
  HA_EXTRA_IS_ATTACHED_CHILDREN and HA_EXTRA_DETACH_CHILDREN
  in partition handler for handlers that has HA_CAN_MULTISTEPL_MERGE flag
- Added HA_CAN_MULTISTEPL_MERGE to MERGE handler.
- Added handler::get_child_handlers()
- Change m_num_lock to contain total number of locks. This was needed as
  we now adjust number of locks when extra(HA_EXTRA_ATTACH_CHILDREN) is
  called.
This commit is contained in:
Monty
2016-12-05 12:17:52 +02:00
parent 3d1d4b874d
commit 7abe11499a
6 changed files with 137 additions and 24 deletions

View File

@ -1096,14 +1096,32 @@ unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
table= table->find_table_for_update();
if (table->table && table->table->file->ht->db_type == DB_TYPE_MRG_MYISAM)
if (table->table &&
table->table->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
{
TABLE_LIST *child;
dup= NULL;
/* Check duplicates of all merge children. */
for (child= table->next_global; child && child->parent_l == table;
for (child= table->next_global; child;
child= child->next_global)
{
if (child->table &&
child->table->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
continue;
/*
Ensure that the child has one parent that is the table that is
updated.
*/
TABLE_LIST *tmp_parent= child;
while ((tmp_parent= tmp_parent->parent_l))
{
if (tmp_parent == table)
break;
}
if (!tmp_parent)
break;
if ((dup= find_dup_table(thd, child, child->next_global, check_alias)))
break;
}
@ -1112,6 +1130,8 @@ unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
dup= find_dup_table(thd, table, table_list, check_alias);
return dup;
}
/*
Issue correct error message in case we found 2 duplicate tables which
prevent some update operation
@ -4089,7 +4109,7 @@ restart:
continue;
/* Schema tables may not have a TABLE object here. */
if (tbl->file->ht->db_type == DB_TYPE_MRG_MYISAM)
if (tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
{
/* MERGE tables need to access parent and child TABLE_LISTs. */
DBUG_ASSERT(tbl->pos_in_table_list == tables);
@ -4636,7 +4656,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
*/
DBUG_ASSERT(table_list->table);
table= table_list->table;
if (table->file->ht->db_type == DB_TYPE_MRG_MYISAM)
if (table->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
{
/* A MERGE table must not come here. */
/* purecov: begin tested */