1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

lp:923429 Crash in decimal_cmp on using UNIX_TIMESTAMP with a wrongly formatted timestamp

UNIX_TIMESTAMP() can be null, and returns null for invalid values
This commit is contained in:
Sergei Golubchik
2012-02-21 21:18:41 +01:00
parent f93da174c5
commit c9fc9f7317
4 changed files with 20 additions and 13 deletions

View File

@@ -1134,15 +1134,7 @@ bool Item_func_unix_timestamp::get_timestamp_value(my_time_t *seconds,
MYSQL_TIME ltime;
if (get_arg0_date(&ltime, 0))
{
/*
We have to set null_value again because get_arg0_date will also set it
to true if we have wrong datetime parameter (and we should return 0 in
this case).
*/
null_value= args[0]->null_value;
return 1;
}
uint error_code;
*seconds= TIME_to_timestamp(current_thd, &ltime, &error_code);