~drizzle-developers/drizzle/elliott-release

« back to all changes in this revision

Viewing changes to tests/suite/time_type/t/basic.test

  • Committer: Patrick Crews
  • Date: 2011-02-01 20:33:06 UTC
  • mfrom: (1845.2.288 drizzle)
  • Revision ID: gleebix@gmail.com-20110201203306-mwq2rk0it81tlwxh
Merged Trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
INSERT INTO t1 VALUES (123456.78);
18
18
 
19
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
19
--error ER_INVALID_TIME_VALUE
20
20
INSERT INTO t1 VALUES (1234559.99);
21
21
 
22
22
INSERT INTO t1 VALUES ("1");
27
27
 
28
28
INSERT INTO t1 VALUES ("10.22");
29
29
 
30
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
30
--error ER_INVALID_TIME_VALUE
31
31
INSERT INTO t1 VALUES ("20 10:22:33");
32
32
 
33
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
33
--error ER_INVALID_TIME_VALUE
34
34
INSERT INTO t1 VALUES ("-10  1:22:33.45");
35
35
 
36
36
INSERT INTO t1 VALUES ("1999-02-03 20:33:34");
40
40
insert t1 values ("1230");
41
41
insert t1 values ("12:30");
42
42
insert t1 values ("12:30:35");
43
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
43
--error ER_INVALID_TIME_VALUE
44
44
insert t1 values ("1 12:30:31.32");
45
45
 
46
 
select * from t1;
 
46
--sorted_result
 
47
select t from t1;
47
48
# Test wrong values
48
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
49
--error ER_INVALID_TIME_VALUE
49
50
INSERT INTO t1 VALUES ("10.22.22");
50
51
 
51
52
INSERT INTO t1 VALUES (1234567);
52
53
 
53
54
INSERT INTO t1 VALUES (123456789);
54
55
 
55
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
56
--error ER_INVALID_TIME_VALUE
56
57
INSERT INTO t1 VALUES (123456789.10);
57
58
 
58
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
59
--error ER_INVALID_TIME_VALUE
59
60
INSERT INTO t1 VALUES ("10 22:22");
60
61
 
61
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
62
--error ER_INVALID_TIME_VALUE
62
63
INSERT INTO t1 VALUES ("12.45a");
63
 
select * from t1;
 
64
--sorted_result
 
65
select t from t1;
64
66
DROP TABLE t1;
65
67
 
66
68
CREATE TABLE t1 (t time);
119
121
SELECT CAST('300:55:50' as time) > cast('240:00:00' as time);
120
122
 
121
123
CREATE TABLE t1 (f1 time);
122
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
124
--error ER_INVALID_TIME_VALUE
123
125
INSERT INTO t1 VALUES ('24:00:00');
124
126
 
125
127
SELECT CAST('24:00:00' as time) = (select f1 from t1);
130
132
# Bug#29739: Incorrect time comparison in BETWEEN.
131
133
#
132
134
CREATE TABLE t1(f1 time, f2 time);
133
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE
 
135
--error ER_INVALID_TIME_VALUE
134
136
INSERT INTO t1 VALUES('20:00:00','150:00:00');
135
137
 
136
138
select 1 from t1 where cast('100:00:00' as time) between f1 and f2;