Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
5.5.37
-
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
- is blocked by
-
MDEV-5981 name resolution issues with views and multi-update in ps-protocol
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
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. |
An UPDATE statement that reads against (but does not modify) a MRG_MyISAM table with a read-only sub-table fails. {noformat} 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; {noformat} {noformat} myisampack -f ./data/test/t2_0 myisamchk -rq ./data/test/t2_0 {noformat} {noformat} update t1 join t2 using (id) set t1.a=t2.b; {noformat} {noformat} > update t1 join t2 using (id) set t1.a=t2.b; ERROR 1036 (HY000): Table 't2_0' is read only {noformat} This works in MySQL 5.1, but fails in MySQL 5.5 and MariaDB 5.5. |
Fix Version/s | 10.0.11 [ 15200 ] | |
Fix Version/s | 5.5.38 [ 15400 ] | |
Assignee | Oleksandr Byelkin [ sanja ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | defaullt [ 39103 ] | MariaDB v2 [ 43419 ] |
Workflow | MariaDB v2 [ 43419 ] | MariaDB v3 [ 62513 ] |
Workflow | MariaDB v3 [ 62513 ] | MariaDB v4 [ 147815 ] |
The problem here is that MySQL 5.5 did cause problems in how privileges are checked in multi-table-update.
We are fixing this and several other multi-table-update problems as part of
MDEV-5981name resolution issues with views and multi-update in ps-protocol.This should be fixed at the same time or after this task is done.