Commit c4adaed0 authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Sergei Golubchik

MDEV-31781 ALTER TABLE ENGINE=s3 fails

s3 is read-only. No need to update to a read-only engine with LOCK=NONE.
parent 30c965f8
......@@ -130,3 +130,7 @@ count(*) sum(a) sum(b)
select count(*), sum(a), sum(b) from t1;
ERROR 42S02: Table 'database.t1' doesn't exist
drop table t2;
# MDEV-31781 ALTER TABLE ENGINE=s3 fails
create table t (a int) engine=Aria;
alter table t engine=S3, algorithm=copy, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: S3. Try LOCK=SHARED
......@@ -93,6 +93,12 @@ select count(*), sum(a), sum(b) from t2;
select count(*), sum(a), sum(b) from t1;
drop table t2;
--echo # MDEV-31781 ALTER TABLE ENGINE=s3 fails
create table t (a int) engine=Aria;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t engine=S3, algorithm=copy, lock=none;
#
# clean up
#
......
......@@ -67,7 +67,7 @@ class __attribute__((visibility("default"))) ha_maria :public handler
~ha_maria() = default;
handler *clone(const char *name, MEM_ROOT *mem_root) override final;
const char *index_type(uint key_number) override final;
ulonglong table_flags() const override final
ulonglong table_flags() const override
{ return int_table_flags; }
ulong index_flags(uint inx, uint part, bool all_parts) const override final;
uint max_supported_keys() const override final
......
......@@ -238,6 +238,7 @@ ha_s3::ha_s3(handlerton *hton, TABLE_SHARE *table_arg)
/* Remove things that S3 doesn't support */
int_table_flags&= ~(HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_CAN_EXPORT);
int_table_flags|= HA_NO_ONLINE_ALTER;
can_enable_indexes= 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment