~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/subselect.test

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  `email` varchar(60) NOT NULL default '',
155
155
  PRIMARY KEY  (`pseudo`),
156
156
  UNIQUE KEY `email` (`email`)
157
 
) ROW_FORMAT=DYNAMIC;
 
157
);
158
158
 
159
159
INSERT INTO t8 (pseudo,email) VALUES ('joce','test');
160
160
INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1');
199
199
  `maxnumrep` int NOT NULL default '0',
200
200
  PRIMARY KEY  (`numeropost`),
201
201
  UNIQUE KEY `maxnumrep` (`maxnumrep`)
202
 
) ROW_FORMAT=FIXED;
 
202
);
203
203
 
204
204
INSERT INTO t1 (numeropost,maxnumrep) VALUES (40143,1),(43506,2);
205
205
 
209
209
      `date` date NULL,
210
210
      `pseudo` varchar(35) NOT NULL default '',
211
211
       PRIMARY KEY  (`mot`,`pseudo`,`date`,`topic`)
212
 
    ) ROW_FORMAT=DYNAMIC;
 
212
    );
213
213
 
214
214
INSERT INTO t2 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce');
215
215
select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1);
242
242
  `maxnumrep` int NOT NULL default '0',
243
243
  PRIMARY KEY  (`numeropost`),
244
244
  UNIQUE KEY `maxnumrep` (`maxnumrep`)
245
 
) ROW_FORMAT=FIXED;
 
245
);
246
246
 
247
247
INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1);
248
248
-- error 1242
334
334
select * from t1;
335
335
insert into t2 values (1);
336
336
INSERT INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
337
337
select * from t1;
338
338
INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2;
339
339
select * from t1;
344
343
-- error 1054
345
344
INSERT INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
346
345
INSERT INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
347
346
select * from t1;
348
347
--echo #
349
348
--echo #TODO: should be uncommented after bug 380 fix pushed
368
366
replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2));
369
367
select * from t1;
370
368
replace into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2));
371
369
--sorted_result
372
370
select * from t1;
373
371
replace into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2));
374
372
select * from t1;
375
373
replace into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2));
376
374
--sorted_result