allow get_format(TIMESTAMP, ...) syntax

This commit is contained in:
serg@serg.mylan 2004-08-11 10:27:19 +02:00
parent 8ce4dc97c5
commit 902518ae48
3 changed files with 11 additions and 4 deletions

View file

@ -379,6 +379,9 @@ a
select get_format(DATETIME, 'eur') as a;
a
%Y-%m-%d %H.%i.%s
select get_format(TIMESTAMP, 'eur') as a;
a
%Y-%m-%d %H.%i.%s
select get_format(DATE, 'TEST') as a;
a
NULL

View file

@ -206,6 +206,7 @@ drop table t1;
select get_format(DATE, 'USA') as a;
select get_format(TIME, 'internal') as a;
select get_format(DATETIME, 'eur') as a;
select get_format(TIMESTAMP, 'eur') as a;
select get_format(DATE, 'TEST') as a;
select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));

View file

@ -3533,12 +3533,15 @@ interval:
| SECOND_MICROSECOND_SYM { $$=INTERVAL_SECOND_MICROSECOND; }
| SECOND_SYM { $$=INTERVAL_SECOND; }
| YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; }
| YEAR_SYM { $$=INTERVAL_YEAR; };
| YEAR_SYM { $$=INTERVAL_YEAR; }
;
date_time_type:
DATE_SYM {$$=MYSQL_TIMESTAMP_DATE;}
| TIME_SYM {$$=MYSQL_TIMESTAMP_TIME;}
| DATETIME {$$=MYSQL_TIMESTAMP_DATETIME;};
DATE_SYM {$$=MYSQL_TIMESTAMP_DATE;}
| TIME_SYM {$$=MYSQL_TIMESTAMP_TIME;}
| DATETIME {$$=MYSQL_TIMESTAMP_DATETIME;}
| TIMESTAMP {$$=MYSQL_TIMESTAMP_DATETIME;}
;
table_alias:
/* empty */