~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/union.test

  • Committer: Brian Aker
  • Date: 2009-04-01 01:25:04 UTC
  • mfrom: (968.2.27 mordred)
  • Revision ID: brian@tangent.org-20090401012504-mq9sxcmph5jc1fh6
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
#
333
333
create table t1 SELECT "a" as a UNION select "aa" as a;
334
334
select * from t1;
 
335
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
335
336
show create table t1;
336
337
drop table t1;
337
338
create table t1 SELECT 12 as a UNION select "aa" as a;
338
339
select * from t1;
 
340
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
339
341
show create table t1;
340
342
drop table t1;
341
343
create table t1 SELECT 12 as a UNION select 12.2 as a;
342
344
select * from t1;
 
345
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
343
346
show create table t1;
344
347
drop table t1;
345
348
 
348
351
 
349
352
create table t1 SELECT it2 from t2 UNION select it1 from t2;
350
353
select * from t1;
 
354
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
351
355
show create table t1;
352
356
drop table t1;
353
357
create table t1 SELECT it2 from t2 UNION select i from t2;
354
358
select * from t1;
 
359
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
355
360
show create table t1;
356
361
drop table t1;
357
362
create table t1 SELECT i from t2 UNION select f from t2;
358
363
select * from t1;
 
364
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
359
365
show create table t1;
360
366
drop table t1;
361
367
create table t1 SELECT f from t2 UNION select d from t2;
362
368
select * from t1;
 
369
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
363
370
show create table t1;
364
371
drop table t1;
365
372
create table t1 SELECT ib from t2 UNION select f from t2;
366
373
select * from t1;
 
374
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
367
375
show create table t1;
368
376
drop table t1;
369
377
create table t1 SELECT ib from t2 UNION select d from t2;
370
378
select * from t1;
 
379
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
371
380
show create table t1;
372
381
drop table t1;
373
382
create table t1 SELECT f from t2 UNION select da from t2;
374
383
select * from t1;
 
384
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
375
385
show create table t1;
376
386
drop table t1;
377
387
create table t1 SELECT da from t2 UNION select dt from t2;
378
388
select * from t1;
 
389
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
379
390
show create table t1;
380
391
drop table t1;
381
392
create table t1 SELECT dt from t2 UNION select trim(sc) from t2;
382
393
select trim(dt) from t1;
 
394
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
383
395
show create table t1;
384
396
drop table t1;
385
397
create table t1 SELECT dt from t2 UNION select sv from t2;
386
398
select * from t1;
 
399
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
387
400
show create table t1;
388
401
drop table t1;
389
402
create table t1 SELECT sc from t2 UNION select sv from t2;
390
403
select * from t1;
 
404
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
391
405
show create table t1;
392
406
drop table t1;
393
407
create table t1 SELECT dt from t2 UNION select b from t2;
394
408
select * from t1;
 
409
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
395
410
show create table t1;
396
411
drop table t1;
397
412
create table t1 SELECT sv from t2 UNION select b from t2;
398
413
select * from t1;
 
414
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
399
415
show create table t1;
400
416
drop table t1;
401
417
create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2;
402
418
select * from t1;
 
419
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
403
420
show create table t1;
404
421
drop table t1;
405
422
create table t1 SELECT sv from t2 UNION select tx from t2;
406
423
select * from t1;
 
424
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
407
425
show create table t1;
408
426
drop table t1;
409
427
create table t1 SELECT b from t2 UNION select tx from t2;
410
428
select * from t1;
 
429
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
411
430
show create table t1;
412
431
drop table t1,t2;
413
432
create table t1 select 1 union select -1;
414
433
select * from t1;
 
434
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
415
435
show create table t1;
416
436
drop table t1;
417
437
-- error 1054
419
439
-- error 1054
420
440
create table t1 select _utf8"test" union select _utf8"testt" ;
421
441
create table t1 select "test" union select "testt" ;
 
442
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
422
443
show create table t1;
423
444
drop table t1;
424
445
 
591
612
(select 'test') union
592
613
(select 'TEST') union
593
614
(select 'TeST');
 
615
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
594
616
show create table t1;
595
617
select count(*) from t1;
596
618
drop table t1;
599
621
(select 'test' collate utf8_bin) union
600
622
(select 'TEST') union
601
623
(select 'TeST');
 
624
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
602
625
show create table t1;
603
626
select count(*) from t1;
604
627
drop table t1;
607
630
(select 'test') union
608
631
(select 'TEST' collate utf8_bin) union
609
632
(select 'TeST');
 
633
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
610
634
show create table t1;
611
635
select count(*) from t1;
612
636
drop table t1;
615
639
(select 'test') union
616
640
(select 'TEST') union
617
641
(select 'TeST' collate utf8_bin);
 
642
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
618
643
show create table t1;
619
644
select count(*) from t1;
620
645
drop table t1;
643
668
create table t1 as
644
669
(select a from t2) union
645
670
(select b collate utf8_swedish_ci from t2);
 
671
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
646
672
show create table t1;
647
673
drop table t1;
648
674
create table t1 as
649
675
(select a from t2) union
650
676
(select b from t2) union
651
677
(select 'c' collate utf8_spanish_ci from t2);
 
678
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
652
679
show create table t1;
653
680
drop table t1;
654
681
drop table t2;
728
755
#  b ENUM("one", "two") character set utf8,
729
756
#  c ENUM("one", "two")
730
757
#);
 
758
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
731
759
#show create table t1;
732
760
#insert into t1 values ('�', 'one', 'one'), ('�', 'two', 'one'), ('�', NULL, NULL);
733
761
#create table t2 select NULL union select a from t1;
743
771
#drop table t2;
744
772
#create table t2 select a from t1 union select b from t1;
745
773
#show columns from t2;
746
 
#drop table t2, t1;
 
774
#drop table t2, t1;`
747
775
 
748
776
749
777
# Bug #14216: UNION + DECIMAL wrong values in result
769
797
 
770
798
create table t1 (a varchar(5));
771
799
create table t2 select * from t1 union select 'abcdefghijkl';
 
800
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
772
801
show create table t2;
773
802
select row_format from information_schema.TABLES where table_schema="test" and table_name="t2";
774
803
alter table t2 ROW_FORMAT=fixed;
 
804
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
775
805
show create table t2;
776
806
drop table t1,t2;
777
807
 
784
814
INSERT INTO t1 VALUES ('a'),('b');
785
815
SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
786
816
create table t3 SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
 
817
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
787
818
show create table t3;
788
819
drop tables t1,t2,t3;
789
820
 
798
829
INSERT INTO t1 VALUES ('a'),('b');
799
830
SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
800
831
create table t3 SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
 
832
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
801
833
show create table t3;
802
834
drop tables t1,t2,t3;
803
835
 
812
844
CREATE TABLE t2 (b varchar(20));
813
845
INSERT INTO t1 VALUES ('a');
814
846
CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;
 
847
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
815
848
SHOW CREATE TABLE t3;
816
849
DROP TABLES t1,t3;
817
850
CREATE TABLE t1 (a tinytext);
818
851
INSERT INTO t1 VALUES ('a');
819
852
CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
 
853
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
820
854
SHOW CREATE TABLE t3;
821
855
DROP TABLES t1,t3;
822
856
CREATE TABLE t1 (a mediumtext);
823
857
INSERT INTO t1 VALUES ('a');
824
858
CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
 
859
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
825
860
SHOW CREATE TABLE t3;
826
861
DROP TABLES t1,t3;
827
862
CREATE TABLE t1 (a tinyblob);
828
863
INSERT INTO t1 VALUES ('a');
829
864
CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
 
865
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
830
866
SHOW CREATE TABLE t3;
831
867
DROP TABLES t1,t2,t3;
832
868
SET max_allowed_packet:= @tmp_max;
848
884
#
849
885
create table t1(f1 char(1), f2 char(5), f3 blob, f4 blob, f5 timestamp, f6 varchar(1) collate utf8_general_ci, f7 text);
850
886
create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
 
887
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
851
888
show create table t2;
852
889
drop table t1, t2;
853
890