~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to tests/t/derived.test

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Initialize
 
2
--disable_warnings
2
3
drop table if exists t1,t2,t3;
 
4
--enable_warnings
3
5
 
4
6
select * from (select 2) b;
5
7
-- error 1054
102
104
#
103
105
create table t1 (a int);
104
106
insert into t1 values (1),(2),(3);
105
 
update (select * from t1) as t1 set a = 5;
106
107
-- error 1064
107
108
delete from (select * from t1);
108
109
-- error 1064
127
127
drop table t1;
128
128
 
129
129
#
130
 
# multi-update & multi-delete with derived tables
131
 
#
132
 
CREATE TABLE `t1` (
133
 
  `N` int NOT NULL default '0',
134
 
  `M` int default '0'
135
 
);
136
 
INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
137
 
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
138
 
select * from t1;
139
 
# TODO: Bug lp:311109
140
 
#UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
141
 
UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
142
 
delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
143
 
select * from t1;
144
 
--replace_result P2 p2
145
 
# TODO: Bug lp:311111
146
 
#--error ER_NON_UPDATABLE_TABLE
147
 
#delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
148
 
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
149
 
drop table t1;
150
 
 
151
 
#
152
130
# correct lex->current_select
153
131
#
154
132
CREATE TEMPORARY TABLE t1 (