mark some file to been opensource for ce-farm

This commit is contained in:
niyuhang
2023-11-15 11:44:43 +00:00
committed by ob-robot
parent 4900683cff
commit c8ace58297
685 changed files with 1080566 additions and 111051 deletions

View File

@ -0,0 +1,500 @@
drop table if exists t1,t2,t3;
create table t1(a varchar(50) primary key, b int default 0);
select * from t1;
a b
select * from t1 where a > -1;
a b
select * from t1 where a = -1;
a b
select * from t1 where a < -1;
a b
select * from t1 where a > 0;
a b
select * from t1 where a = 0;
a b
select * from t1 where a < 0;
a b
select * from t1 where a > 1;
a b
select * from t1 where a = 1;
a b
select * from t1 where a < 1;
a b
select * from t1;
a b
-1 0
-2 0
-3 0
-4 0
-5 0
-6 0
-7 0
-8 0
-9 0
0 0
1 0
10 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
select * from t1 where a > -1;
a b
0 0
1 0
10 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
select * from t1 where a = -1;
a b
-1 0
select * from t1 where a < -1;
a b
-2 0
-3 0
-4 0
-5 0
-6 0
-7 0
-8 0
-9 0
select * from t1 where a > 0;
a b
1 0
10 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
select * from t1 where a = 0;
a b
0 0
select * from t1 where a < 0;
a b
-1 0
-2 0
-3 0
-4 0
-5 0
-6 0
-7 0
-8 0
-9 0
select * from t1 where a > 1;
a b
10 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
select * from t1 where a = 1;
a b
1 0
select * from t1 where a < 1;
a b
-1 0
-2 0
-3 0
-4 0
-5 0
-6 0
-7 0
-8 0
-9 0
0 0
drop table t1;
create table t1(a varchar(50) primary key, b int, c int);
select * from t1;
a b c
select * from t1 where a > -1;
a b c
select * from t1 where a = -1;
a b c
select * from t1 where a < -1;
a b c
select * from t1 where a > 0;
a b c
select * from t1 where a = 0;
a b c
select * from t1 where a < 0;
a b c
select * from t1 where a > 1;
a b c
select * from t1 where a = 1;
a b c
select * from t1 where a < 1;
a b c
select * from t1;
a b c
-1 -1 -1
-2 -2 -2
-3 -3 -3
-4 -4 -4
-5 -5 -5
-6 -6 -6
-7 -7 -7
-8 -8 -8
-9 -9 -9
0 0 0
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
select * from t1 where a > -1;
a b c
0 0 0
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
select * from t1 where a = -1;
a b c
-1 -1 -1
select * from t1 where a < -1;
a b c
-2 -2 -2
-3 -3 -3
-4 -4 -4
-5 -5 -5
-6 -6 -6
-7 -7 -7
-8 -8 -8
-9 -9 -9
select * from t1 where a > 0;
a b c
1 1 1
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
select * from t1 where a = 0;
a b c
0 0 0
select * from t1 where a < 0;
a b c
-1 -1 -1
-2 -2 -2
-3 -3 -3
-4 -4 -4
-5 -5 -5
-6 -6 -6
-7 -7 -7
-8 -8 -8
-9 -9 -9
select * from t1 where a > 1;
a b c
10 10 10
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
select * from t1 where a = 2;
a b c
2 2 2
select * from t1 where a < 3;
a b c
-1 -1 -1
-2 -2 -2
-3 -3 -3
-4 -4 -4
-5 -5 -5
-6 -6 -6
-7 -7 -7
-8 -8 -8
-9 -9 -9
0 0 0
1 1 1
2 2 2
drop table t1;
create table t1(a int, b int, c int, primary key(a,b));
select * from t1;
a b c
select * from t1 where a > -1;
a b c
select * from t1 where a = -1;
a b c
select * from t1 where a < -1;
a b c
select * from t1 where a > 0;
a b c
select * from t1 where a = 0;
a b c
select * from t1 where a < 0;
a b c
select * from t1 where a > 1;
a b c
select * from t1 where a = 1;
a b c
select * from t1 where a < 1;
a b c
select * from t1 where a > -1 and b > -1;
a b c
select * from t1 where a = -1 and b = -1;
a b c
select * from t1 where a < -1 and b < -1;
a b c
select * from t1 where a > 0 and b > 0;
a b c
select * from t1 where a = 0 and b = 0;
a b c
select * from t1 where a < 0 and b < 0;
a b c
select * from t1 where a > 1 and b > 1;
a b c
select * from t1 where a = 1 and b = 1;
a b c
select * from t1 where a < 1 and b < 1;
a b c
select * from t1 where a > -1 and b < -1;
a b c
select * from t1 where a = -1 and b != -1;
a b c
select * from t1 where a < -1 and b > -1;
a b c
select * from t1 where a > 0 and b < 0;
a b c
select * from t1 where a = 0 and b != 0;
a b c
select * from t1 where a < 0 and b > 0;
a b c
select * from t1 where a > 1 and b < 1;
a b c
select * from t1 where a = 1 and b != 1;
a b c
select * from t1 where a < 1 and b > 1;
a b c
select * from t1 where a > -1;
a b c
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = -1;
a b c
-1 -1 -1
select * from t1 where a < -1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
select * from t1 where a > 0;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 0;
a b c
0 0 0
select * from t1 where a < 0;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
select * from t1 where a > 1;
a b c
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 1;
a b c
1 1 1
select * from t1 where a < 1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
select * from t1 where a > -1 and b > -1;
a b c
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = -1 and b = -1;
a b c
-1 -1 -1
select * from t1 where a < -1 and b < -1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
select * from t1 where a > 0 and b > 0;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 0 and b = 0;
a b c
0 0 0
select * from t1 where a < 0 and b < 0;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
select * from t1 where a > 1 and b > 1;
a b c
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 1 and b = 1;
a b c
1 1 1
select * from t1 where a < 1 and b < 1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
select * from t1 where a > -1 and b < -1;
a b c
select * from t1 where a = -1 and b != -1;
a b c
select * from t1 where a < -1 and b > -1;
a b c
select * from t1 where a > 0 and b < 0;
a b c
select * from t1 where a = 0 and b != 0;
a b c
select * from t1 where a < 0 and b > 0;
a b c
select * from t1 where a > 1 and b < 1;
a b c
select * from t1 where a = 1 and b != 1;
a b c
select * from t1 where a < 1 and b > 1;
a b c
select * from t1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10

View File

@ -0,0 +1,755 @@
drop table if exists t1,t2,t3;
create table t1(a int primary key, b int);
select * from t1;
a b
select * from t1 where a > -1;
a b
select * from t1 where a = -1;
a b
select * from t1 where a < -1;
a b
select * from t1 where a > 0;
a b
select * from t1 where a = 0;
a b
select * from t1 where a < 0;
a b
select * from t1 where a > 1;
a b
select * from t1 where a = 1;
a b
select * from t1 where a < 1;
a b
select * from t1;
a b
-9 NULL
-8 NULL
-7 NULL
-6 NULL
-5 NULL
-4 NULL
-3 NULL
-2 NULL
-1 NULL
0 NULL
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
6 NULL
7 NULL
8 NULL
9 NULL
10 NULL
select * from t1 where a > -1;
a b
0 NULL
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
6 NULL
7 NULL
8 NULL
9 NULL
10 NULL
select * from t1 where a = -1;
a b
-1 NULL
select * from t1 where a < -1;
a b
-9 NULL
-8 NULL
-7 NULL
-6 NULL
-5 NULL
-4 NULL
-3 NULL
-2 NULL
select * from t1 where a > 0;
a b
1 NULL
2 NULL
3 NULL
4 NULL
5 NULL
6 NULL
7 NULL
8 NULL
9 NULL
10 NULL
select * from t1 where a = 0;
a b
0 NULL
select * from t1 where a < 0;
a b
-9 NULL
-8 NULL
-7 NULL
-6 NULL
-5 NULL
-4 NULL
-3 NULL
-2 NULL
-1 NULL
select * from t1 where a > 1;
a b
2 NULL
3 NULL
4 NULL
5 NULL
6 NULL
7 NULL
8 NULL
9 NULL
10 NULL
select * from t1 where a = 1;
a b
1 NULL
select * from t1 where a < 1;
a b
-9 NULL
-8 NULL
-7 NULL
-6 NULL
-5 NULL
-4 NULL
-3 NULL
-2 NULL
-1 NULL
0 NULL
drop table t1;
create table t1(a int primary key, b int, c int);
select * from t1;
a b c
select * from t1 where a > -1;
a b c
select * from t1 where a = -1;
a b c
select * from t1 where a < -1;
a b c
select * from t1 where a > 0;
a b c
select * from t1 where a = 0;
a b c
select * from t1 where a < 0;
a b c
select * from t1 where a > 1;
a b c
select * from t1 where a = 1;
a b c
select * from t1 where a < 1;
a b c
select * from t1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a > -1;
a b c
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = -1;
a b c
-1 -1 -1
select * from t1 where a < -1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
select * from t1 where a > 0;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 0;
a b c
0 0 0
select * from t1 where a < 0;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
select * from t1 where a > 1;
a b c
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 2;
a b c
2 2 2
select * from t1 where a < 3;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
1 1 1
2 2 2
drop table t1;
create table t1(a int, b int, c int, primary key(a,b));
select * from t1;
a b c
select * from t1 where a > -1;
a b c
select * from t1 where a = -1;
a b c
select * from t1 where a < -1;
a b c
select * from t1 where a > 0;
a b c
select * from t1 where a = 0;
a b c
select * from t1 where a < 0;
a b c
select * from t1 where a > 1;
a b c
select * from t1 where a = 1;
a b c
select * from t1 where a < 1;
a b c
select * from t1 where a > -1 and b > -1;
a b c
select * from t1 where a = -1 and b = -1;
a b c
select * from t1 where a < -1 and b < -1;
a b c
select * from t1 where a > 0 and b > 0;
a b c
select * from t1 where a = 0 and b = 0;
a b c
select * from t1 where a < 0 and b < 0;
a b c
select * from t1 where a > 1 and b > 1;
a b c
select * from t1 where a = 1 and b = 1;
a b c
select * from t1 where a < 1 and b < 1;
a b c
select * from t1 where a > -1 and b < -1;
a b c
select * from t1 where a = -1 and b != -1;
a b c
select * from t1 where a < -1 and b > -1;
a b c
select * from t1 where a > 0 and b < 0;
a b c
select * from t1 where a = 0 and b != 0;
a b c
select * from t1 where a < 0 and b > 0;
a b c
select * from t1 where a > 1 and b < 1;
a b c
select * from t1 where a = 1 and b != 1;
a b c
select * from t1 where a < 1 and b > 1;
a b c
select * from t1 where a > -1;
a b c
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = -1;
a b c
-1 -1 -1
select * from t1 where a < -1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
select * from t1 where a > 0;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 0;
a b c
0 0 0
select * from t1 where a < 0;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
select * from t1 where a > 1;
a b c
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 1;
a b c
1 1 1
select * from t1 where a < 1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
select * from t1 where a > -1 and b > -1;
a b c
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = -1 and b = -1;
a b c
-1 -1 -1
select * from t1 where a < -1 and b < -1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
select * from t1 where a > 0 and b > 0;
a b c
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 0 and b = 0;
a b c
0 0 0
select * from t1 where a < 0 and b < 0;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
select * from t1 where a > 1 and b > 1;
a b c
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
select * from t1 where a = 1 and b = 1;
a b c
1 1 1
select * from t1 where a < 1 and b < 1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
select * from t1 where a > -1 and b < -1;
a b c
select * from t1 where a = -1 and b != -1;
a b c
select * from t1 where a < -1 and b > -1;
a b c
select * from t1 where a > 0 and b < 0;
a b c
select * from t1 where a = 0 and b != 0;
a b c
select * from t1 where a < 0 and b > 0;
a b c
select * from t1 where a > 1 and b < 1;
a b c
select * from t1 where a = 1 and b != 1;
a b c
select * from t1 where a < 1 and b > 1;
a b c
select * from t1;
a b c
-9 -9 -9
-8 -8 -8
-7 -7 -7
-6 -6 -6
-5 -5 -5
-4 -4 -4
-3 -3 -3
-2 -2 -2
-1 -1 -1
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
drop table t1;
create table t1(a int, b int, c int, primary key(a,b,c),d int);
select * from t1;
a b c d
select * from t1 where a > -1;
a b c d
select * from t1 where a = -1;
a b c d
select * from t1 where a < -1;
a b c d
select * from t1 where a > 0;
a b c d
select * from t1 where a = 0;
a b c d
select * from t1 where a < 0;
a b c d
select * from t1 where a > 1;
a b c d
select * from t1 where a = 1;
a b c d
select * from t1 where a < 1;
a b c d
select * from t1 where a > -1 and b > -1 and c > -1;
a b c d
select * from t1 where a = -1 and b = -1 and c = -1;
a b c d
select * from t1 where a < -1 and b < -1 and c < -1;
a b c d
select * from t1 where a > 0 and b > 0 and c > 0;
a b c d
select * from t1 where a = 0 and b = 0 and c = 0;
a b c d
select * from t1 where a < 0 and b < 0 and c < 0;
a b c d
select * from t1 where a > 1 and b > 1 and c > 1;
a b c d
select * from t1 where a = 1 and b = 1 and c = 1;
a b c d
select * from t1 where a < 1 and b < 1 and c < 1;
a b c d
select * from t1 where a > -1 and b < -1 and c > -1;
a b c d
select * from t1 where a = -1 and b != -1 and c = -1;
a b c d
select * from t1 where a < -1 and b > -1 and c < -1;
a b c d
select * from t1 where a > 0 and b < 0 and c > 0;
a b c d
select * from t1 where a = 0 and b != 0 and c = 0;
a b c d
select * from t1 where a < 0 and b > 0 and c < 0;
a b c d
select * from t1 where a > 1 and b < 1 and c > 1;
a b c d
select * from t1 where a = 1 and b != 1 and c = 1;
a b c d
select * from t1 where a < 1 and b > 1 and c < 1;
a b c d
select * from t1;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
-1 -1 -1 NULL
0 0 0 NULL
1 1 1 NULL
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a > -1;
a b c d
0 0 0 NULL
1 1 1 NULL
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = -1;
a b c d
-1 -1 -1 NULL
select * from t1 where a < -1;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
select * from t1 where a > 0;
a b c d
1 1 1 NULL
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = 0;
a b c d
0 0 0 NULL
select * from t1 where a < 0;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
-1 -1 -1 NULL
select * from t1 where a > 1;
a b c d
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = 1;
a b c d
1 1 1 NULL
select * from t1 where a < 1;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
-1 -1 -1 NULL
0 0 0 NULL
select * from t1 where a > -1 and b > -1 and c > -1;
a b c d
0 0 0 NULL
1 1 1 NULL
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = -1 and b = -1 and c = -1;
a b c d
-1 -1 -1 NULL
select * from t1 where a < -1 and b < -1 and c < -1;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
select * from t1 where a > 0 and b > 0 and c > 0;
a b c d
1 1 1 NULL
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = 0 and b = 0 and c = 0;
a b c d
0 0 0 NULL
select * from t1 where a < 0 and b < 0 and c < 0;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
-1 -1 -1 NULL
select * from t1 where a > 1 and b > 1 and c > 1;
a b c d
2 2 2 NULL
3 3 3 NULL
4 4 4 NULL
5 5 5 NULL
6 6 6 NULL
7 7 7 NULL
8 8 8 NULL
9 9 9 NULL
10 10 10 NULL
select * from t1 where a = 1 and b = 1 and c = 1;
a b c d
1 1 1 NULL
select * from t1 where a < 1 and b < 1 and c < 1;
a b c d
-9 -9 -9 NULL
-8 -8 -8 NULL
-7 -7 -7 NULL
-6 -6 -6 NULL
-5 -5 -5 NULL
-4 -4 -4 NULL
-3 -3 -3 NULL
-2 -2 -2 NULL
-1 -1 -1 NULL
0 0 0 NULL
select * from t1 where a > -1 and b < -1 and c > -1;
a b c d
select * from t1 where a = -1 and b != -1 and c = -1;
a b c d
select * from t1 where a < -1 and b > -1 and c < -1;
a b c d
select * from t1 where a > 0 and b < 0 and c > 0;
a b c d
select * from t1 where a = 0 and b != 0 and c = 0;
a b c d
select * from t1 where a < 0 and b > 0 and c < 0;
a b c d
select * from t1 where a > 1 and b < 1 and c > 1;
a b c d
select * from t1 where a = 1 and b != 1 and c = 1;
a b c d
select * from t1 where a < 1 and b > 1 and c < 1;
a b c d
drop table t1;

View File

@ -0,0 +1,39 @@
drop table if exists t1,t2,t3;
create table t1(a int primary key, c int);
insert into t1(a) values(-1);
insert into t1(a) values(1);
insert into t1(a) values(0);
select * from t1;
a c
-1 NULL
0 NULL
1 NULL
drop table t1;
create table t1(a int, b int, c int primary key);
insert into t1 values(NULL,NULL,1);
insert into t1 values(NULL,1,2);
insert into t1 values(1,NULL,3);
insert into t1 values(1,1,4);
insert into t1 values(NULL,NULL,5);
insert into t1 values(NULL,1,6);
insert into t1 values(1,NULL,7);
select * from t1;
a b c
NULL NULL 1
NULL 1 2
1 NULL 3
1 1 4
NULL NULL 5
NULL 1 6
1 NULL 7
drop table t1;
create table t1(a varchar(20) ,b varchar(128) primary key);
insert into t1 values(NULL,'abc');
insert into t1 values('1','cde');
insert into t1 values(NULL,'egf');
select * from t1;
a b
NULL abc
1 cde
NULL egf
drop table t1;

View File

@ -0,0 +1,269 @@
--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
# owner: xiaoyi.xy
# owner group: SQL3
# description: foobar
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
#
### single field
#
create table t1(a varchar(50) primary key, b int default 0);
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1(a) values('$i');
dec $i;
}
enable_query_log;
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
drop table t1;
#
## more fields
#
create table t1(a varchar(50) primary key, b int, c int);
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1 values('$i','$i','$i');
dec $i;
}
enable_query_log;
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 2;
select * from t1 where a < 3;
drop table t1;
#
## pk: two fields
#
create table t1(a int, b int, c int, primary key(a,b));
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1;
select * from t1 where a = -1 and b = -1;
select * from t1 where a < -1 and b < -1;
select * from t1 where a > 0 and b > 0;
select * from t1 where a = 0 and b = 0;
select * from t1 where a < 0 and b < 0;
select * from t1 where a > 1 and b > 1;
select * from t1 where a = 1 and b = 1;
select * from t1 where a < 1 and b < 1;
select * from t1 where a > -1 and b < -1;
select * from t1 where a = -1 and b != -1;
select * from t1 where a < -1 and b > -1;
select * from t1 where a > 0 and b < 0;
select * from t1 where a = 0 and b != 0;
select * from t1 where a < 0 and b > 0;
select * from t1 where a > 1 and b < 1;
select * from t1 where a = 1 and b != 1;
select * from t1 where a < 1 and b > 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1 values('$i','$i','$i');
dec $i;
}
enable_query_log;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1;
select * from t1 where a = -1 and b = -1;
select * from t1 where a < -1 and b < -1;
select * from t1 where a > 0 and b > 0;
select * from t1 where a = 0 and b = 0;
select * from t1 where a < 0 and b < 0;
select * from t1 where a > 1 and b > 1;
select * from t1 where a = 1 and b = 1;
select * from t1 where a < 1 and b < 1;
select * from t1 where a > -1 and b < -1;
select * from t1 where a = -1 and b != -1;
select * from t1 where a < -1 and b > -1;
select * from t1 where a > 0 and b < 0;
select * from t1 where a = 0 and b != 0;
select * from t1 where a < 0 and b > 0;
select * from t1 where a > 1 and b < 1;
select * from t1 where a = 1 and b != 1;
select * from t1 where a < 1 and b > 1;
select * from t1;
#drop table t1;
#
## pk as all fields
#
#create table t1(a int, b int, c int, primary key(a,b,c));
# empty table
#select * from t1;
#select * from t1 where a > -1;
#select * from t1 where a = -1;
#select * from t1 where a < -1;
#select * from t1 where a > 0;
#select * from t1 where a = 0;
#select * from t1 where a < 0;
#select * from t1 where a > 1;
#select * from t1 where a = 1;
#select * from t1 where a < 1;
#select * from t1 where a > -1 and b > -1 and c > -1;
#select * from t1 where a = -1 and b = -1 and c = -1;
#select * from t1 where a < -1 and b < -1 and c < -1;
#select * from t1 where a > 0 and b > 0 and c > 0;
#select * from t1 where a = 0 and b = 0 and c = 0;
#select * from t1 where a < 0 and b < 0 and c < 0;
#select * from t1 where a > 1 and b > 1 and c > 1;
#select * from t1 where a = 1 and b = 1 and c = 1;
#select * from t1 where a < 1 and b < 1 and c < 1;
#select * from t1 where a > -1 and b < -1 and c > -1;
#select * from t1 where a = -1 and b != -1 and c = -1;
#select * from t1 where a < -1 and b > -1 and c < -1;
#select * from t1 where a > 0 and b < 0 and c > 0;
#select * from t1 where a = 0 and b != 0 and c = 0;
#select * from t1 where a < 0 and b > 0 and c < 0;
#select * from t1 where a > 1 and b < 1 and c > 1;
#select * from t1 where a = 1 and b != 1 and c = 1;
#select * from t1 where a < 1 and b > 1 and c < 1;
#let $i=10;
#disable_query_log;
#while($i > -10)
#{
# eval insert into t1 values('$i','$i','$i');
# dec $i;
#}
#enable_query_log;
#select * from t1;
#select * from t1 where a > -1;
#select * from t1 where a = -1;
#select * from t1 where a < -1;
#select * from t1 where a > 0;
#select * from t1 where a = 0;
#select * from t1 where a < 0;
#select * from t1 where a > 1;
#select * from t1 where a = 1;
#select * from t1 where a < 1;
#select * from t1 where a > -1 and b > -1 and c > -1;
#select * from t1 where a = -1 and b = -1 and c = -1;
#select * from t1 where a < -1 and b < -1 and c < -1;
#select * from t1 where a > 0 and b > 0 and c > 0;
#select * from t1 where a = 0 and b = 0 and c = 0;
#select * from t1 where a < 0 and b < 0 and c < 0;
#select * from t1 where a > 1 and b > 1 and c > 1;
#select * from t1 where a = 1 and b = 1 and c = 1;
#select * from t1 where a < 1 and b < 1 and c < 1;
#select * from t1 where a > -1 and b < -1 and c > -1;
#select * from t1 where a = -1 and b != -1 and c = -1;
#select * from t1 where a < -1 and b > -1 and c < -1;
#select * from t1 where a > 0 and b < 0 and c > 0;
#select * from t1 where a = 0 and b != 0 and c = 0;
#select * from t1 where a < 0 and b > 0 and c < 0;
#select * from t1 where a > 1 and b < 1 and c > 1;
#select * from t1 where a = 1 and b != 1 and c = 1;
#select * from t1 where a < 1 and b > 1 and c < 1;
#drop table t1;

View File

@ -0,0 +1,271 @@
--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
# owner: xiaoyi.xy
# owner group: SQL3
# description: foobar
# tags: datatype
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
#
### single field
#
create table t1(a int primary key, b int);
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1(a) values($i);
dec $i;
}
enable_query_log;
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
drop table t1;
#
## more fields
#
create table t1(a int primary key, b int, c int);
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1 values($i,$i,$i);
dec $i;
}
enable_query_log;
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 2;
select * from t1 where a < 3;
drop table t1;
#
## pk: two fields
#
create table t1(a int, b int, c int, primary key(a,b));
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1;
select * from t1 where a = -1 and b = -1;
select * from t1 where a < -1 and b < -1;
select * from t1 where a > 0 and b > 0;
select * from t1 where a = 0 and b = 0;
select * from t1 where a < 0 and b < 0;
select * from t1 where a > 1 and b > 1;
select * from t1 where a = 1 and b = 1;
select * from t1 where a < 1 and b < 1;
select * from t1 where a > -1 and b < -1;
select * from t1 where a = -1 and b != -1;
select * from t1 where a < -1 and b > -1;
select * from t1 where a > 0 and b < 0;
select * from t1 where a = 0 and b != 0;
select * from t1 where a < 0 and b > 0;
select * from t1 where a > 1 and b < 1;
select * from t1 where a = 1 and b != 1;
select * from t1 where a < 1 and b > 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1 values($i,$i,$i);
dec $i;
}
enable_query_log;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1;
select * from t1 where a = -1 and b = -1;
select * from t1 where a < -1 and b < -1;
select * from t1 where a > 0 and b > 0;
select * from t1 where a = 0 and b = 0;
select * from t1 where a < 0 and b < 0;
select * from t1 where a > 1 and b > 1;
select * from t1 where a = 1 and b = 1;
select * from t1 where a < 1 and b < 1;
select * from t1 where a > -1 and b < -1;
select * from t1 where a = -1 and b != -1;
select * from t1 where a < -1 and b > -1;
select * from t1 where a > 0 and b < 0;
select * from t1 where a = 0 and b != 0;
select * from t1 where a < 0 and b > 0;
select * from t1 where a > 1 and b < 1;
select * from t1 where a = 1 and b != 1;
select * from t1 where a < 1 and b > 1;
select * from t1;
drop table t1;
#
## pk as all fields
#
create table t1(a int, b int, c int, primary key(a,b,c),d int);
# empty table
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1 and c > -1;
select * from t1 where a = -1 and b = -1 and c = -1;
select * from t1 where a < -1 and b < -1 and c < -1;
select * from t1 where a > 0 and b > 0 and c > 0;
select * from t1 where a = 0 and b = 0 and c = 0;
select * from t1 where a < 0 and b < 0 and c < 0;
select * from t1 where a > 1 and b > 1 and c > 1;
select * from t1 where a = 1 and b = 1 and c = 1;
select * from t1 where a < 1 and b < 1 and c < 1;
select * from t1 where a > -1 and b < -1 and c > -1;
select * from t1 where a = -1 and b != -1 and c = -1;
select * from t1 where a < -1 and b > -1 and c < -1;
select * from t1 where a > 0 and b < 0 and c > 0;
select * from t1 where a = 0 and b != 0 and c = 0;
select * from t1 where a < 0 and b > 0 and c < 0;
select * from t1 where a > 1 and b < 1 and c > 1;
select * from t1 where a = 1 and b != 1 and c = 1;
select * from t1 where a < 1 and b > 1 and c < 1;
let $i=10;
disable_query_log;
while($i > -10)
{
eval insert into t1(a,b,c) values($i,$i,$i);
dec $i;
}
enable_query_log;
select * from t1;
select * from t1 where a > -1;
select * from t1 where a = -1;
select * from t1 where a < -1;
select * from t1 where a > 0;
select * from t1 where a = 0;
select * from t1 where a < 0;
select * from t1 where a > 1;
select * from t1 where a = 1;
select * from t1 where a < 1;
select * from t1 where a > -1 and b > -1 and c > -1;
select * from t1 where a = -1 and b = -1 and c = -1;
select * from t1 where a < -1 and b < -1 and c < -1;
select * from t1 where a > 0 and b > 0 and c > 0;
select * from t1 where a = 0 and b = 0 and c = 0;
select * from t1 where a < 0 and b < 0 and c < 0;
select * from t1 where a > 1 and b > 1 and c > 1;
select * from t1 where a = 1 and b = 1 and c = 1;
select * from t1 where a < 1 and b < 1 and c < 1;
select * from t1 where a > -1 and b < -1 and c > -1;
select * from t1 where a = -1 and b != -1 and c = -1;
select * from t1 where a < -1 and b > -1 and c < -1;
select * from t1 where a > 0 and b < 0 and c > 0;
select * from t1 where a = 0 and b != 0 and c = 0;
select * from t1 where a < 0 and b > 0 and c < 0;
select * from t1 where a > 1 and b < 1 and c > 1;
select * from t1 where a = 1 and b != 1 and c = 1;
select * from t1 where a < 1 and b > 1 and c < 1;
drop table t1;

View File

@ -0,0 +1,100 @@
--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
# owner: xiaoyi.xy
# owner group: SQL3
# description: foobar
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
#
## junyue
## Fix bug: http://bugfree.corp.taobao.com/bug/201170
## There shouldon't be NULL values within primary keys
#
# single int
create table t1(a int primary key, c int);
insert into t1(a) values(-1);
insert into t1(a) values(1);
insert into t1(a) values(0);
#--error 1062
#insert into t1(a) values(NULL);
select * from t1;
drop table t1;
# combo int
create table t1(a int, b int, c int primary key);
insert into t1 values(NULL,NULL,1);
insert into t1 values(NULL,1,2);
insert into t1 values(1,NULL,3);
insert into t1 values(1,1,4);
insert into t1 values(NULL,NULL,5);
insert into t1 values(NULL,1,6);
insert into t1 values(1,NULL,7);
select * from t1;
drop table t1;
# single char
create table t1(a varchar(20) ,b varchar(128) primary key);
insert into t1 values(NULL,'abc');
insert into t1 values('1','cde');
insert into t1 values(NULL,'egf');
select * from t1;
drop table t1;
# combo char
--disable_parsing
create table t1(a varchar(20), b varchar(20), primary key(a,b),c varchar(128));
insert into t1(a,b) values(NULL,NULL);
insert into t1(a,b) values(NULL,'1');
insert into t1(a,b) values('1',NULL);
insert into t1(a,b) values('1','1');
--error 1062
insert into t1(a,b) values(NULL,NULL);
--error 1062
insert into t1(a,b) values(NULL,'1');
--error 1062
insert into t1(a,b) values('1',NULL);
select * from t1;
drop table t1;
# single dt
create table t1(a datetime primary key,b datetime(6));
insert into t1(a) values(NULL);
insert into t1(a) values('2010-01-01 12:00:00');
--error 1062
insert into t1(a) values(NULL);
select * from t1;
drop table t1;
# combo dt
create table t1(a datetime(6), b datetime(6), primary key(a,b), c datetime(6));
insert into t1(a,b) values(NULL,NULL);
insert into t1(a,b) values(NULL,'2010-01-01 12:00:00');
insert into t1(a,b) values('2010-01-01 12:00:00',NULL);
insert into t1(a,b) values('2010-01-01 12:00:00','2010-01-01 12:00:00');
--error 1062
insert into t1(a,b) values(NULL,NULL);
--error 1062
insert into t1(a,b) values(NULL,'2010-01-01 12:00:00');
--error 1062
insert into t1(a,b) values('2010-01-01 12:00:00',NULL);
select * from t1;
drop table t1;
--enable_parsing