Re: 264aef71a37: Have ha_partition ignore HA_EXTRA..CHILDREN extra() calls if no myisamrg
Hi, Michael, On Feb 23, Michael Widenius wrote:
revision-id: 264aef71a37 (mariadb-10.6.17-15-g264aef71a37) parent(s): 042c3fc432b author: Michael Widenius committer: Michael Widenius timestamp: 2024-02-22 09:20:51 +0200 message:
Have ha_partition ignore HA_EXTRA..CHILDREN extra() calls if no myisamrg
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index e174ef8d219..f2b3ab3aff9 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3030,6 +3031,10 @@ bool ha_partition::create_handlers(MEM_ROOT *mem_root) DBUG_PRINT("info", ("InnoDB")); m_innodb= TRUE; } + else if (ha_legacy_type(hton0) == DB_TYPE_MRG_MYISAM) + { + m_myisammrg= TRUE; + } DBUG_RETURN(FALSE); }
@@ -9419,9 +9424,14 @@ int ha_partition::extra(enum ha_extra_function operation) } /* Category 9) Operations only used by MERGE */ case HA_EXTRA_ADD_CHILDREN_LIST: + if (!m_myisammrg) + DBUG_RETURN(0); DBUG_RETURN(loop_partitions(extra_cb, &operation)); case HA_EXTRA_ATTACH_CHILDREN: { + if (!m_myisammrg) + DBUG_RETURN(0); + int result;
This is, of course, quite horrible. Checking the legacy type, doing something for a specify underlying engine. But I don't see a better way of doing it, short of changing the storage engine API. What if we redefine ::extra() call to return HA_ERR_WRONG_COMMAND for unsupported extra operations? The caller will not abort on it, but it'll allow the caller to know whether the operation was executed or ignored. This will allow partitioning handler to skip all extra() methods that are not implemented in the underlying engine. For all engines and all extra operations. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
participants (1)
-
Sergei Golubchik