Bug #17206 Update through VIEW is not working
Submitted: 7 Feb 2006 21:28 Modified: 14 Feb 2006 9:55
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.1.7 OS:Linux (Linux 32 Bit OS)
Assigned to: Tomas Ulin CPU Architecture:Any

[7 Feb 2006 21:28] Jonathan Miller
Description:
MySQL supports updating tables through VIEWs however, this is not currently working when using NDB storage engine.

I pulled and rebuilt about 3 hours ago.

simple test case below.

Current output:
+ DROP TABLE IF EXISTS t1;
+ create table t1 (a int);
+ create view v1 as select a from t1;
+ insert into v1 values (1);
+ insert into v1 values (2);
+ select * from v1 order by a;
+ a
+ 1
+ 2
+ update v1 set a=3 where a=1;
+ show warnings;
+ Level Code    Message
+ select * from v1 order by a;
+ a
+ 1
+ 2
+ DROP TABLE t1;

How to repeat:
# Begin clean up test section
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int);
create view v1 as select a from t1;
insert into v1 values (1);
insert into v1 values (2);
select * from v1 order by a;
update v1 set a=3 where a=1;
show warnings;
select * from v1 order by a;
DROP TABLE t1;

Suggested fix:
allow singe tables to be updated by Views.
[8 Feb 2006 16:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2326
[8 Feb 2006 20:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2335
[13 Feb 2006 18:57] Tomas Ulin
pushed to 5.1.7
[14 Feb 2006 9:55] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented fix in 5.1.7 changelog. Bug closed.