func_equal.test 822 Bytes
Newer Older
1 2 3 4 5
# Initialise
--disable_warnings
drop table if exists t1,t2;
--enable_warnings

unknown's avatar
unknown committed
6 7 8 9 10 11 12 13
#
# Testing of the <=> operator
#

#
# First some simple tests
#

unknown's avatar
unknown committed
14
select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL;
unknown's avatar
unknown committed
15 16 17
select 1<=>0,0<=>NULL,NULL<=>0;
select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
select "A"<=>"B","A"<=>NULL,NULL<=>"A";
unknown's avatar
unknown committed
18 19
select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1;
select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0;
unknown's avatar
unknown committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

#
# Test with tables
#

create table t1 (id int, value int);
create table t2 (id int, value int);

insert into t1 values (1,null);
insert into t2 values (1,null);

select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
select * from t1 where id <=>id;
select * from t1 where value <=> value;
select * from t1 where id <=> value or value<=>id;
drop table t1,t2;