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:
@@ -1134,15 +1134,7 @@ bool Item_func_unix_timestamp::get_timestamp_value(my_time_t *seconds,
|
||||
|
||||
MYSQL_TIME ltime;
|
||||
if (get_arg0_date(<ime, 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, <ime, &error_code);
|
||||
|
Reference in New Issue
Block a user