[MDEV-24389] CREATE TABLE ... ENGINE=S3 fails with (errno: 131 "Command not supported by the engine") Created: 2020-12-10  Updated: 2023-03-24  Resolved: 2020-12-10

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - S3
Affects Version/s: 10.5.7
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Claudio Nanni Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-30649 ALTER TABLE ENGINE doesn't copy data ... Open

 Description   

Create an S3 table fails, but I can create it as InnoDB and then change the engine to S3:

MariaDB [s3_schema]> create table ts3_001 (id int) engine=s3;
ERROR 1005 (HY000): Can't create table `s3_schema`.`ts3_001` (errno: 131 "Command not supported by the engine")
MariaDB [s3_schema]> create table ts3_001 (id int) engine=innodb;
Query OK, 0 rows affected (0.887 sec)
 
MariaDB [s3_schema]> alter table ts3_001 engine=s3;
Query OK, 0 rows affected (1.105 sec)              
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [s3_schema]> show create table ts3_001;
+---------+---------------------------------------------------------------------------------------------------------+
| Table   | Create Table                                                                                            |
+---------+---------------------------------------------------------------------------------------------------------+
| ts3_001 | CREATE TABLE `ts3_001` (
  `id` int(11) DEFAULT NULL
) ENGINE=S3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 |
+---------+---------------------------------------------------------------------------------------------------------+
1 row in set (0.622 sec)

If then I copy the same create table and execute it, it fails as well:

MariaDB [s3_schema]> CREATE TABLE `ts3_002` (
    ->   `id` int(11) DEFAULT NULL
    -> ) ENGINE=S3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1;
ERROR 1005 (HY000): Can't create table `s3_schema`.`ts3_002` (errno: 131 "Command not supported by the engine")



 Comments   
Comment by Elena Stepanova [ 2020-12-10 ]

That's how S3 works https://mariadb.com/kb/en/using-the-s3-storage-engine/

Given that it's a read-only engine, there would be no point creating a table anyway, as you can't write into it.

Comment by Claudio Nanni [ 2020-12-11 ]

elenst It surely makes sense on second thought, but could we make it more clear in the docs?

CREATE TABLE is not supported because...

In my opinion an explicit statement would help, some parts of the docs can even mislead you in thinking some sort of CREATE TABLE is supported, like:

"s3_block_size: Set to 4M as default. This is the default block size for a table, if not specified in CREATE TABLE."

I also think there is an use case for CREATE TABLE, I'll open another Jira for that, this is closed now.

Comment by Vincent Milum Jr [ 2023-02-13 ]

I think this bug should be re-evaluated.

In my particular case, I'm trying to do:

CREATE TABLE tbl2 ENGINE=S3 (SELECT * FROM tbl1);

This reason for this is because SPIDER engine itself when using ALTER TABLE ENGINE doesn't copy data, instead just creating an empty table which is worthless. This is noted in the following bug: MDEV-30649

Comment by Sergei Golubchik [ 2023-03-24 ]

CREATE ... SELECT makes sense, indeed. But it'd be difficult make it work, it's more realistic to fix MDEV-30649 than to use CREATE ENGINE=S3 SELECT as a workaround

Generated at Thu Feb 08 09:29:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.