diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 23da99f38bb..758a83defed 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -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 diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index 2e6e1fabd8d..f769fe7af04 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -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')); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5d6ca5d5de5..8e3fb0884a9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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 */