234
234
select date_format(d,"%d") from t1 order by 1;
238
# Commenting out all str_to_date(). It's an abomination
239
# and hopefully we can get rid of it.
241
# I mean, seriously, this: str_to_date("02 10", "%d %H") is supposed to produce a date!?
237
243
# PS doesn't support fractional seconds
238
--disable_ps_protocol
239
select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a;
242
create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
243
str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
244
str_to_date("2003-01-02", "%Y-%m-%d") as f3,
245
str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
250
create table t1 select "02 10" as a, "%d %H" as b;
251
select str_to_date(a,b) from t1;
252
create table t2 select str_to_date(a,b) from t1;
254
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
255
str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2,
256
str_to_date("2003-01-02", "%Y-%m-%d") as f3,
257
str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4,
258
str_to_date("02 10:11:12", "%d %H:%i:%S") as f5,
259
str_to_date("02 10", "%d %f") as f6;
261
--error 1686 # These are bad datetimes...
262
select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1,
263
addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2,
264
microsecond("1997-12-31 23:59:59.01XXXX") as f3;
266
select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
267
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
244
#--disable_ps_protocol
245
#select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a;
247
#create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
248
# str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
249
# str_to_date("2003-01-02", "%Y-%m-%d") as f3,
250
# str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
255
#create table t1 select "02 10" as a, "%d %H" as b;
256
#select str_to_date(a,b) from t1;
257
#create table t2 select str_to_date(a,b) from t1;
259
#select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
260
# str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2,
261
# str_to_date("2003-01-02", "%Y-%m-%d") as f3,
262
# str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4,
263
# str_to_date("02 10:11:12", "%d %H:%i:%S") as f5,
264
# str_to_date("02 10", "%d %f") as f6;
266
#--error 1686 # These are bad datetimes...
267
#select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1,
268
# addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2,
269
# microsecond("1997-12-31 23:59:59.01XXXX") as f3;
271
#select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
272
# str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
273
#--enable_ps_protocol