Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24389

CREATE TABLE ... ENGINE=S3 fails with (errno: 131 "Command not supported by the engine")

Details

    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")
      
      

      Attachments

        Issue Links

          Activity

            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.

            elenst Elena Stepanova added a comment - 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.
            claudio.nanni Claudio Nanni added a comment -

            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.

            claudio.nanni Claudio Nanni added a comment - 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.
            darkain Vincent Milum Jr added a comment - - edited

            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

            darkain Vincent Milum Jr added a comment - - edited 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

            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

            serg Sergei Golubchik added a comment - 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

            People

              Unassigned Unassigned
              claudio.nanni Claudio Nanni
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.