| 1 |
DROP TABLE IF EXISTS t1,t2,t3; |
| 2 |
DROP VIEW IF EXISTS v1,v2,v3; |
| 3 |
create table t1 (a int, b int, c int, d int) engine=ndb; |
| 4 |
insert into t1 values (1,2,3,4),(5,6,7,8); |
| 5 |
create view v1 as select t1.c as a, t1.a as b, t1.d as c, t1.a+t1.b+t1.c as d from t1; |
| 6 |
select * from v1 order by a,b,c; |
| 7 |
a b c d |
| 8 |
3 1 4 6 |
| 9 |
7 5 8 18 |
| 10 |
update v1 set a=a+100 where b=1; |
| 11 |
select * from v1 order by a,b,c; |
| 12 |
a b c d |
| 13 |
7 5 8 18 |
| 14 |
103 1 4 106 |
| 15 |
drop view v1; |
| 16 |
create view v1 as select t1.c as a from t1; |
| 17 |
insert into v1 values (200); |
| 18 |
select * from t1 order by a,b,c,d; |
| 19 |
a b c d |
| 20 |
NULL NULL 200 NULL |
| 21 |
1 2 103 4 |
| 22 |
5 6 7 8 |
| 23 |
drop view v1; |
| 24 |
drop table t1; |