Re: 44b4a3e64fa: MDEV-31777 ER_GET_ERRNO upon online alter on CONNECT table
Hi, Nikita, Generally, please, prefer table flags over new virtual function. E.g. *online= new_table->file->ha_table_flags() & HA_CAN_ONLINE_ALTER; But in this particular case there's no reason for a engine to not support online alter, it's just CONNECT being very weird. Like you wrote, it doesn't support REPLACE either and we didn't introduce a flag for that. This should be solved inside CONNECT. E.g it can throw an error just like it does for REPLACE. It can upgrade the lock: --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -5125,10 +5125,12 @@ @see get_lock_data() in lock.cc */ -THR_LOCK_DATA **ha_connect::store_lock(THD *, +THR_LOCK_DATA **ha_connect::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { + if (thd_sql_command(thd) == SQLCOM_ALTER_TABLE && lock_type == TL_READ) + lock_type= TL_READ_NO_INSERT; if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) lock.type=lock_type; *to++= &lock; or it can implement reading and inserting to the same table :) Either way, I don't think we need to extend the storage engine API for this specific case. Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org On Aug 03, Nikita Malyavin wrote:
revision-id: 44b4a3e64fa (mariadb-11.0.1-190-g44b4a3e64fa) parent(s): b508107c7a3 author: Nikita Malyavin committer: Nikita Malyavin timestamp: 2023-07-29 00:13:48 +0400 message:
MDEV-31777 ER_GET_ERRNO upon online alter on CONNECT table
Forbid Online for CONNECT.
diff --git a/sql/handler.h b/sql/handler.h index 480c79017ab..4a1363d2e93 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -4911,6 +4911,8 @@ class handler :public Sql_alloc bool commit);
+ virtual bool is_online_alter_supported() const { return true; } + protected:
participants (1)
-
Sergei Golubchik