oceanbase

Форк
0
59 строк · 1.6 Кб
1
--disable_query_log
2
set @@session.explicit_defaults_for_timestamp=off;
3
--enable_query_log
4
#### owner: peihan.dph
5
#### owner group: sql3
6
#### description: 测试相等比较运算符
7
# Initialise
8
--disable_warnings
9
drop table if exists t1,t2;
10
--enable_warnings
11
#
12
##
13
## Testing of the <=> operator
14
##
15
#
16
##
17
## First some simple tests
18
##
19
#
20
select 0<=>0,0.0<=>0.0,0E0=0E0,'A'<=>'A',NULL<=>NULL;
21
select 1<=>0,0<=>NULL,NULL<=>0;
22
select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
23
select 'A'<=>'B','A'<=>NULL,NULL<=>'A';
24
select 0<=>0.0, 0.0<=>0E0, 0E0<=>'0', 10.0<=>1E1, 10<=>10.0, 10<=>1E1;
25
select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0;
26
#
27
##
28
## Test with tables
29
##
30
#
31
create table t1 (id int primary key, value int);
32
create table t2 (id int primary key, value int);
33
#
34
insert into t1 values (1,null);
35
insert into t2 values (1,null);
36
#
37
select t1.*, t2.*, t1.value=t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
38
select * from t1 where id =id;
39
select * from t1 where value = value;
40
select * from t1 where id = value or value=id;
41
select * from t1 where value = null;
42
select * from t1 where (value) = (null);
43
--error 1064
44
select * from t1 where ROW(value) = ROW(null);
45
select * from t1 where (id, value) = (1, null);
46
drop table t1,t2;
47
#
48
##
49
## Bug #12612: quoted bigint unsigned value and the use of 'in' in where clause
50
##
51
create table t1 (a bigint primary key);
52
insert into t1 values (4828532208463511553);
53
select * from t1 where a = '4828532208463511553';
54
select * from t1 where a = 4828532208463511553;
55
select * from t1 where a in ('4828532208463511553');
56
select * from t1 where a in (4828532208463511553,1);
57
drop table t1;
58
#
59
## End of 4.1 tests
60

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.