~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/union.test

  • Committer: Monty Taylor
  • Date: 2009-03-31 07:57:46 UTC
  • mto: (971.1.10 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: mordred@inaugust.com-20090331075746-7filp1zeagjgwuzm
Removed references to stdbool, since they aren't valid in c++. Added them in C where we need them. Made archive tests c++.

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