~drizzle-trunk/drizzle/development

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
SELECT MICROSECOND(NULL);
MICROSECOND(NULL)
NULL
SELECT MICROSECOND();
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
SELECT MICROSECOND(1, 0);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ' 0)' at line 1
SELECT MICROSECOND("xxx");
ERROR HY000: Received an invalid datetime value 'xxx'.
SELECT MICROSECOND("0000-00-00");
ERROR HY000: Received an invalid datetime value '0000-00-00'.
SELECT MICROSECOND("0000-01-01");
ERROR HY000: Received an invalid datetime value '0000-01-01'.
SELECT MICROSECOND("0001-00-01");
ERROR HY000: Received an invalid datetime value '0001-00-01'.
SELECT MICROSECOND("0001-01-00");
ERROR HY000: Received an invalid datetime value '0001-01-00'.
SELECT MICROSECOND("2000-02-30");
ERROR HY000: Received an invalid datetime value '2000-02-30'.
SELECT MICROSECOND("1900-02-29");
ERROR HY000: Received an invalid datetime value '1900-02-29'.
SELECT MICROSECOND('1976-15-15');
ERROR HY000: Received an invalid datetime value '1976-15-15'.
SELECT MICROSECOND('23:59:70');
ERROR HY000: Received an invalid datetime value '23:59:70'.
SELECT MICROSECOND('23:70:59');
ERROR HY000: Received an invalid datetime value '23:70:59'.
SELECT MICROSECOND('26:00:00');
ERROR HY000: Received an invalid datetime value '26:00:00'.
SELECT MICROSECOND('26:00:00.9999999');
ERROR HY000: Received an invalid datetime value '26:00:00.9999999'.
SELECT MICROSECOND("2009-01-12");
MICROSECOND("2009-01-12")
0
SELECT MICROSECOND("70-12-31");
MICROSECOND("70-12-31")
0
SELECT MICROSECOND('07/31/2009');
MICROSECOND('07/31/2009')
0
SELECT MICROSECOND("2008-11-30 03:30:15");
MICROSECOND("2008-11-30 03:30:15")
0
SELECT MICROSECOND("2008-11-30T03:30:15");
MICROSECOND("2008-11-30T03:30:15")
0
SELECT MICROSECOND("2008-11-30T03:30:15.123456");
MICROSECOND("2008-11-30T03:30:15.123456")
123456
SELECT MICROSECOND("20081130033015");
MICROSECOND("20081130033015")
0
SELECT MICROSECOND("20081130033015.123456");
MICROSECOND("20081130033015.123456")
123456
SELECT MICROSECOND("20081130033015.12345");
MICROSECOND("20081130033015.12345")
123450
SELECT MICROSECOND("20081130033015.1234");
MICROSECOND("20081130033015.1234")
123400
SELECT MICROSECOND("20081130033015.123");
MICROSECOND("20081130033015.123")
123000
SELECT MICROSECOND("20081130033015.12");
MICROSECOND("20081130033015.12")
120000
SELECT MICROSECOND("20081130033015.1");
MICROSECOND("20081130033015.1")
100000
SELECT MICROSECOND(20081130033015);
MICROSECOND(20081130033015)
0
SELECT MICROSECOND(20081130033015.123456);
MICROSECOND(20081130033015.123456)
123456
SELECT MICROSECOND(20081130033015.12345);
MICROSECOND(20081130033015.12345)
123450
SELECT MICROSECOND(20081130033015.1234);
MICROSECOND(20081130033015.1234)
123400
SELECT MICROSECOND(20081130033015.123);
MICROSECOND(20081130033015.123)
123000
SELECT MICROSECOND(20081130033015.12);
MICROSECOND(20081130033015.12)
120000
SELECT MICROSECOND(20081130033015.1);
MICROSECOND(20081130033015.1)
100000
SELECT MICROSECOND(231115);
MICROSECOND(231115)
0
SELECT MICROSECOND("231115");
MICROSECOND("231115")
0
SELECT MICROSECOND("23:59:59");
MICROSECOND("23:59:59")
0
SELECT MICROSECOND("23:59:59.123456");
MICROSECOND("23:59:59.123456")
123456
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
int_fld INT NOT NULL
, date_fld DATE NOT NULL
, datetime_fld DATETIME NOT NULL
, timestamp_fld TIMESTAMP NOT NULL
, char_fld CHAR(22) NOT NULL
, varchar_fld VARCHAR(22) NOT NULL
, text_fld TEXT NOT NULL
, blob_fld BLOB NOT NULL
);
INSERT INTO t1 VALUES (
20071130
, "2007-11-30"
, "2007-11-30 16:30:19"
, "2007-11-30T16:30:19"
, "2007-11-30 16:30:19"
, "2007-11-30 16:30:19"
, "2007-11-30T16:30:19"
, "2007-11-30T16:30:19"
);
SELECT MICROSECOND(int_fld) FROM t1;
MICROSECOND(int_fld)
0
SELECT MICROSECOND(date_fld) FROM t1;
MICROSECOND(date_fld)
0
SELECT MICROSECOND(datetime_fld) FROM t1;
MICROSECOND(datetime_fld)
0
SELECT MICROSECOND(timestamp_fld) FROM t1;
MICROSECOND(timestamp_fld)
0
SELECT MICROSECOND(char_fld) FROM t1;
MICROSECOND(char_fld)
0
SELECT MICROSECOND(varchar_fld) FROM t1;
MICROSECOND(varchar_fld)
0
SELECT MICROSECOND(text_fld) FROM t1;
MICROSECOND(text_fld)
0
SELECT MICROSECOND(blob_fld) FROM t1;
MICROSECOND(blob_fld)
0
DROP TABLE t1;