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

A view can mask a table that supports discovery

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.6
    • Fix Version/s: 10.0.7
    • Component/s: None
    • Labels:
      None

      Description

      CREATE TABLE t1 (i INT) ENGINE=TokuDB;
      CREATE VIEW t1 AS SELECT "I am a view" AS a;
      
      SELECT * FROM t1;
      
      SELECT * FROM t1;
      a
      I am a view
      

      Not reproducible with MyISAM or InnoDB:

      CREATE TABLE t1 (i INT) ENGINE=MyISAM;
      CREATE VIEW t1 AS SELECT "I am a view" AS a;
      bug.t3_tokudb                            [ fail ]
              Test ended at 2013-12-13 00:46:34
      
      CURRENT_TEST: bug.t3_tokudb
      mysqltest: At line 2: query 'CREATE VIEW t1 AS SELECT "I am a view" AS a' failed: 1050: Table 't1' already exists
      

      Not reproducible on 5.5.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Same with Archive. Or — I suppose — any engine that supports table discovery.

            Show
            serg Sergei Golubchik added a comment - Same with Archive. Or — I suppose — any engine that supports table discovery.
            Hide
            elenst Elena Stepanova added a comment -

            Indeed, I did not consider that TokuDB is different from lets say InnoDB in terms of table discovery.
            I've modified the summary.

            It is a problem also because it can easily cause replication failure. If I add, for example, "SELECT * FROM t1" after table creation, then the view creation fails as expected; but in case of replication, only two CREATE statements will be replicated (the latter with the error code), while SELECT won't be in the binlog, so on slave the second CREATE will pass, which will cause different error codes on master and slave, which means replication failure.

            Show
            elenst Elena Stepanova added a comment - Indeed, I did not consider that TokuDB is different from lets say InnoDB in terms of table discovery. I've modified the summary. It is a problem also because it can easily cause replication failure. If I add, for example, "SELECT * FROM t1" after table creation, then the view creation fails as expected; but in case of replication, only two CREATE statements will be replicated (the latter with the error code), while SELECT won't be in the binlog, so on slave the second CREATE will pass, which will cause different error codes on master and slave, which means replication failure.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h