File: type_year.result

package info (click to toggle)
mysql-dfsg-5.0 5.0.51a-24%2Blenny5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 106,168 kB
  • ctags: 94,516
  • sloc: cpp: 447,179; ansic: 411,410; perl: 38,307; sh: 37,449; tcl: 30,484; pascal: 14,851; yacc: 8,559; makefile: 5,078; java: 4,610; xml: 3,953; sql: 2,920; awk: 1,338; asm: 1,061; sed: 772
file content (48 lines) | stat: -rw-r--r-- 813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
drop table if exists t1;
create table t1 (y year,y2 year(2));
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1;
y	y2
0000	00
1999	99
2000	00
2001	01
1970	70
2069	69
select * from t1 order by y;
y	y2
0000	00
1970	70
1999	99
2000	00
2001	01
2069	69
select * from t1 order by y2;
y	y2
1970	70
1999	99
0000	00
2000	00
2001	01
2069	69
drop table t1;
create table t1 (y year);
insert into t1 values (now());
Warnings:
Warning	1265	Data truncated for column 'y' at row 1
select if(y = now(), 1, 0) from t1;
if(y = now(), 1, 0)
1
drop table t1;
create table t1(a year);
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
Warnings:
Warning	1265	Data truncated for column 'a' at row 3
select * from t1;
a
2001
2001
2001
2001
drop table t1;
End of 5.0 tests