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

Context Replay for MRG_MyISAM tables: Table is read-only error

    XMLWordPrintable

Details

    • Unexpected results

    Description

      Issue found in merge.merge test

      Issue:

      --------
      Replay throws below error

      MariaDB [m8]> REPLACE INTO m8.t2(a) VALUES (2);
      ERROR 1036 (HY000): Table 't2' is read only

      Case:

      -------------
      CREATE TABLE t1 (a int,primary key(a)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (2);
      CREATE TABLE t2 (a int,primary key(a)) ENGINE=MRG_MyISAM UNION=(t1);

      set optimizer_record_context=ON;
      EXPLAIN SELECT * FROM t2 WHERE a = 2;
      SELECT context INTO DUMPFILE 'context1.txt' FROM INFORMATION_SCHEMA.OPTIMIZER_CONTEXT;
      source context1.txt;

      First explain:

      MariaDB [m8]> EXPLAIN SELECT * FROM t2 WHERE a = 2;
      +------+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
      | id   | select_type | table | type  | possible_keys | key     | key_len | ref   | rows | Extra       |
      +------+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
      |    1 | SIMPLE      | t2    | const | PRIMARY       | PRIMARY | 4       | const | 1    | Using index |
      +------+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+
      

      Replay:

      MariaDB [m8]> REPLACE INTO m8.t2(a) VALUES (2);
      ERROR 1036 (HY000): Table 't2' is read only
       
      MariaDB [m8]> EXPLAIN SELECT * FROM t2 WHERE a = 2;
      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra                                               |
      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | Impossible WHERE noticed after reading const tables |
      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.