1
by brian
clean slate |
1 |
# Initialise |
2 |
--disable_warnings
|
|
3 |
drop table if exists t1,t2; |
|
4 |
--enable_warnings
|
|
5 |
||
6 |
#
|
|
7 |
# Testing of the <=> operator |
|
8 |
#
|
|
9 |
||
10 |
#
|
|
11 |
# First some simple tests |
|
12 |
#
|
|
13 |
||
14 |
select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL; |
|
15 |
select 1<=>0,0<=>NULL,NULL<=>0; |
|
16 |
select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; |
|
17 |
select "A"<=>"B","A"<=>NULL,NULL<=>"A"; |
|
18 |
select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1; |
|
19 |
select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0; |
|
20 |
||
21 |
#
|
|
22 |
# Test with tables |
|
23 |
#
|
|
24 |
||
25 |
create table t1 (id int, value int); |
|
26 |
create table t2 (id int, value int); |
|
27 |
||
28 |
insert into t1 values (1,null); |
|
29 |
insert into t2 values (1,null); |
|
30 |
||
31 |
select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1; |
|
32 |
select * from t1 where id <=>id; |
|
33 |
select * from t1 where value <=> value; |
|
34 |
select * from t1 where id <=> value or value<=>id; |
|
35 |
drop table t1,t2; |
|
36 |
||
37 |
#
|
|
38 |
# Bug #12612: quoted bigint unsigned value and the use of "in" in where clause |
|
39 |
#
|
|
40 |
create table t1 (a bigint unsigned); |
|
41 |
insert into t1 values (4828532208463511553); |
|
42 |
select * from t1 where a = '4828532208463511553'; |
|
43 |
select * from t1 where a in ('4828532208463511553'); |
|
44 |
drop table t1; |
|
45 |
||
46 |
# End of 4.1 tests |