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

UPDATE w/ join against MRG_MyISAM table with read-only sub-table fails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 5.5.37
    • 5.5.38, 10.0.11
    • None
    • None

    Description

      An UPDATE statement that reads against (but does not modify) a MRG_MyISAM table with a read-only sub-table fails.

      drop table if exists t1, t2, t2_0;
      CREATE TABLE `t1` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `a` int(11) DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=MyISAM;
       
      CREATE TABLE `t2_0` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `b` int(11) DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=MyISAM;
       
      CREATE TABLE `t2` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `b` int(11) DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=MRG_MyISAM UNION=(`t2_0`);
       
      FLUSH TABLES;

      myisampack -f ./data/test/t2_0
      myisamchk -rq ./data/test/t2_0

      update t1 join t2 using (id) set t1.a=t2.b;

      > update t1 join t2 using (id) set t1.a=t2.b;
      ERROR 1036 (HY000): Table 't2_0' is read only

      This works in MySQL 5.1, but fails in MySQL 5.5 and MariaDB 5.5.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              kolbe Kolbe Kegel (Inactive)
              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.