364
361
set @blob_len = 512;
365
362
set @suffix_len = @blob_len - @prefix_len;
367
create table t1_512 (a1 blob(512), a2 blob(512));
368
create table t2_512 (b1 blob(512), b2 blob(512));
369
create table t3_512 (c1 blob(512), c2 blob(512));
364
create table t1_512 (a1 blob, a2 blob);
365
create table t2_512 (b1 blob, b2 blob);
366
create table t3_512 (c1 blob, c2 blob);
371
368
insert into t1_512 values
372
369
(concat('1 - 00', repeat('x', @suffix_len)), concat('2 - 00', repeat('x', @suffix_len)));
446
443
set @blob_len = 1024;
447
444
set @suffix_len = @blob_len - @prefix_len;
449
create table t1_1024 (a1 blob(1024), a2 blob(1024));
450
create table t2_1024 (b1 blob(1024), b2 blob(1024));
451
create table t3_1024 (c1 blob(1024), c2 blob(1024));
446
create table t1_1024 (a1 blob, a2 blob);
447
create table t2_1024 (b1 blob, b2 blob);
448
create table t3_1024 (c1 blob, c2 blob);
453
450
insert into t1_1024 values
454
451
(concat('1 - 00', repeat('x', @suffix_len)), concat('2 - 00', repeat('x', @suffix_len)));
528
525
set @blob_len = 1025;
529
526
set @suffix_len = @blob_len - @prefix_len;
531
create table t1_1025 (a1 blob(1025), a2 blob(1025));
532
create table t2_1025 (b1 blob(1025), b2 blob(1025));
533
create table t3_1025 (c1 blob(1025), c2 blob(1025));
528
create table t1_1025 (a1 blob, a2 blob);
529
create table t2_1025 (b1 blob, b2 blob);
530
create table t3_1025 (c1 blob, c2 blob);
535
532
insert into t1_1025 values
536
533
(concat('1 - 00', repeat('x', @suffix_len)), concat('2 - 00', repeat('x', @suffix_len)));
606
603
drop table t1_1025, t2_1025, t3_1025;
608
605
# test for BIT fields
609
create table t1bit (a1 bit(3), a2 bit(3));
610
create table t2bit (b1 bit(3), b2 bit(3));
612
insert into t1bit values (b'000', b'100');
613
insert into t1bit values (b'001', b'101');
614
insert into t1bit values (b'010', b'110');
616
insert into t2bit values (b'001', b'101');
617
insert into t2bit values (b'010', b'110');
618
insert into t2bit values (b'110', b'111');
620
set @@optimizer_switch=no_semijoin;
622
explain extended select bin(a1), bin(a2)
624
where (a1, a2) in (select b1, b2 from t2bit);
626
select bin(a1), bin(a2)
628
where (a1, a2) in (select b1, b2 from t2bit);
630
drop table t1bit, t2bit;
632
# test mixture of BIT and BLOB
633
create table t1bb (a1 bit(3), a2 blob(3));
634
create table t2bb (b1 bit(3), b2 blob(3));
636
insert into t1bb values (b'000', '100');
637
insert into t1bb values (b'001', '101');
638
insert into t1bb values (b'010', '110');
640
insert into t2bb values (b'001', '101');
641
insert into t2bb values (b'010', '110');
642
insert into t2bb values (b'110', '111');
644
explain extended select bin(a1), a2
646
where (a1, a2) in (select b1, b2 from t2bb);
650
where (a1, a2) in (select b1, b2 from t2bb);
652
drop table t1bb, t2bb;
653
drop table t1, t2, t3, t1i, t2i, t3i, columns;
606
#create table t1bit (a1 bit(3), a2 bit(3));
607
#create table t2bit (b1 bit(3), b2 bit(3));
609
#insert into t1bit values (b'000', b'100');
610
#insert into t1bit values (b'001', b'101');
611
#insert into t1bit values (b'010', b'110');
613
#insert into t2bit values (b'001', b'101');
614
#insert into t2bit values (b'010', b'110');
615
#insert into t2bit values (b'110', b'111');
617
#set @@optimizer_switch=no_semijoin;
619
#explain extended select bin(a1), bin(a2)
621
#where (a1, a2) in (select b1, b2 from t2bit);
623
#select bin(a1), bin(a2)
625
#where (a1, a2) in (select b1, b2 from t2bit);
627
#drop table t1bit, t2bit;
629
## test mixture of BIT and BLOB
630
#create table t1bb (a1 bit(3), a2 blob(3));
631
#create table t2bb (b1 bit(3), b2 blob(3));
633
#insert into t1bb values (b'000', '100');
634
#insert into t1bb values (b'001', '101');
635
#insert into t1bb values (b'010', '110');
637
#insert into t2bb values (b'001', '101');
638
#insert into t2bb values (b'010', '110');
639
#insert into t2bb values (b'110', '111');
641
#explain extended select bin(a1), a2
643
#where (a1, a2) in (select b1, b2 from t2bb);
647
#where (a1, a2) in (select b1, b2 from t2bb);
649
#drop table t1bb, t2bb;
650
#drop table t1, t2, t3, t1i, t2i, t3i, columns;
651
drop table t1, t2, t3;
655
653
/******************************************************************************
656
654
* Test the cache of the left operand of IN.