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

CREATE OR REPLACE bypasses S3 restriction for table creation

    XMLWordPrintable

Details

    Description

      Normally creation of a new table with S3 engine is not allowed.
      However, the modified CREATE OR REPLACE (from MDEV-25292) bypasses it and creates the table.
      If it's intentional, then probably the plain CREATE should be allowed to do it too.

      Either MinIO or credentials to AWS are needed to run S3 tests.
      See suite/s3/suite.pm for how the suite initializes connection parameters, configure your MinIO or AWS accordingly, put the test case into suite/s3 and run from there.
      Alternatively, all S3-related options can be provided from the command line.

      drop table if exists t, t2;
       
      create table t (a int) engine=Aria;
      insert into t values (1),(2);
      alter table t engine=S3;
      --error 1005
      create table t2 (a int) engine=S3;
      --error 1005
      create table t2 like t;
      create or replace table t2 like t;
      show create table t2;
       
      # Cleanup
      drop table if exists t, t2;
      

      bb-10.11-midenok 8e82c973e

      alter table t engine=S3;
      create table t2 (a int) engine=S3;
      ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by the engine")
      create table t2 like t;
      ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by the engine")
      create or replace table t2 like t;
      show create table t2;
      Table	Create Table
      t2	CREATE TABLE `t2` (
        `a` int(11) DEFAULT NULL
      ) ENGINE=S3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
      

      Before MDEV-25292, CREATE OR REPLACE would fail with ER_CANT_CREATE_TABLE/131, the same way as both CREATEs.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.