~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/r/type_time.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
create table t1 (t time);
 
3
insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10  1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34");
 
4
insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32");
 
5
select * from t1;
 
6
t
 
7
10:22:33
 
8
12:34:56
 
9
00:00:10
 
10
00:12:34
 
11
12:34:56
 
12
123:45:59
 
13
00:00:01
 
14
01:23:00
 
15
01:23:45
 
16
00:00:10
 
17
-241:22:33
 
18
490:22:33
 
19
20:33:34
 
20
00:00:30
 
21
00:12:30
 
22
00:12:30
 
23
12:30:00
 
24
12:30:35
 
25
36:30:31
 
26
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
 
27
Warnings:
 
28
Warning 1265    Data truncated for column 't' at row 1
 
29
Warning 1264    Out of range value for column 't' at row 2
 
30
Warning 1264    Out of range value for column 't' at row 3
 
31
Warning 1264    Out of range value for column 't' at row 4
 
32
Warning 1265    Data truncated for column 't' at row 6
 
33
select * from t1;
 
34
t
 
35
10:22:33
 
36
12:34:56
 
37
00:00:10
 
38
00:12:34
 
39
12:34:56
 
40
123:45:59
 
41
00:00:01
 
42
01:23:00
 
43
01:23:45
 
44
00:00:10
 
45
-241:22:33
 
46
490:22:33
 
47
20:33:34
 
48
00:00:30
 
49
00:12:30
 
50
00:12:30
 
51
12:30:00
 
52
12:30:35
 
53
36:30:31
 
54
00:00:10
 
55
00:00:00
 
56
838:59:59
 
57
838:59:59
 
58
262:22:00
 
59
00:00:12
 
60
drop table t1;
 
61
create table t1 (t time);
 
62
insert into t1 values ('09:00:00'),('13:00:00'),('19:38:34'), ('13:00:00'),('09:00:00'),('09:00:00'),('13:00:00'),('13:00:00'),('13:00:00'),('09:00:00');
 
63
select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
 
64
t       time_to_sec(t)  sec_to_time(time_to_sec(t))
 
65
09:00:00        32400   09:00:00
 
66
13:00:00        46800   13:00:00
 
67
19:38:34        70714   19:38:34
 
68
13:00:00        46800   13:00:00
 
69
09:00:00        32400   09:00:00
 
70
09:00:00        32400   09:00:00
 
71
13:00:00        46800   13:00:00
 
72
13:00:00        46800   13:00:00
 
73
13:00:00        46800   13:00:00
 
74
09:00:00        32400   09:00:00
 
75
select sec_to_time(time_to_sec(t)) from t1;
 
76
sec_to_time(time_to_sec(t))
 
77
09:00:00
 
78
13:00:00
 
79
19:38:34
 
80
13:00:00
 
81
09:00:00
 
82
09:00:00
 
83
13:00:00
 
84
13:00:00
 
85
13:00:00
 
86
09:00:00
 
87
drop table t1;
 
88
select cast('100:55:50' as time) < cast('24:00:00' as time);
 
89
cast('100:55:50' as time) < cast('24:00:00' as time)
 
90
0
 
91
select cast('100:55:50' as time) < cast('024:00:00' as time);
 
92
cast('100:55:50' as time) < cast('024:00:00' as time)
 
93
0
 
94
select cast('300:55:50' as time) < cast('240:00:00' as time);
 
95
cast('300:55:50' as time) < cast('240:00:00' as time)
 
96
0
 
97
select cast('100:55:50' as time) > cast('24:00:00' as time);
 
98
cast('100:55:50' as time) > cast('24:00:00' as time)
 
99
1
 
100
select cast('100:55:50' as time) > cast('024:00:00' as time);
 
101
cast('100:55:50' as time) > cast('024:00:00' as time)
 
102
1
 
103
select cast('300:55:50' as time) > cast('240:00:00' as time);
 
104
cast('300:55:50' as time) > cast('240:00:00' as time)
 
105
1
 
106
create table t1 (f1 time);
 
107
insert into t1 values ('24:00:00');
 
108
select cast('24:00:00' as time) = (select f1 from t1);
 
109
cast('24:00:00' as time) = (select f1 from t1)
 
110
1
 
111
drop table t1;
 
112
create table t1(f1 time, f2 time);
 
113
insert into t1 values('20:00:00','150:00:00');
 
114
select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
 
115
1
 
116
1
 
117
drop table t1;
 
118
CREATE TABLE  t1 (
 
119
f2 date NOT NULL,
 
120
f3 int(11) unsigned NOT NULL default '0',
 
121
PRIMARY KEY  (f3, f2)
 
122
);
 
123
insert into t1 values('2007-07-01', 1);
 
124
insert into t1 values('2007-07-01', 2);
 
125
insert into t1 values('2007-07-02', 1);
 
126
insert into t1 values('2007-07-02', 2);
 
127
SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
 
128
sum(f3)
 
129
3
 
130
drop table t1;