maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #06698
Re: Please review MDEV-5458 RQG hits 'sql/tztime.cc:799: my_time_t sec_since_epoch(int, int, int, int, int, int): Assertion `mon > 0 && mon < 13' failed.'
Hi, Alexander!
First, please cc: such requests to maria-developers@ instead. Thanks!
On Jan 22, Alexander Barkov wrote:
>
> Please review a patch for a crashing bug MDEV-5458.
>
> Item_func_min_max::get_date() did not always honor the flags
> given (such as NO_ZERO_IN_DATE and NO_ZERO_DATE)
> in could erroneously return a not-NULL value instead of NULL.
>
> The patch moves the call for check_date_with_warn()
> *AFTER* conversion from DATETIME to TIME, to make
> sure that the returned value always matches the requested
> flags.
>
> Previously it was done before conversion. The value before
> conversion could be OK for the flags given, but the value
> after conversion could be not OK.
>
> Also, I added a new function adjust_time_range_with_warn()
> to avoid duplicate code. Reused it in three places.
All ok. Just one comment:
> === modified file 'sql/mysql_priv.h'
> --- sql/mysql_priv.h 2013-12-02 11:09:34 +0000
> +++ sql/mysql_priv.h 2014-01-22 14:53:38 +0000
> @@ -2582,6 +2582,7 @@ check_date(const MYSQL_TIME *ltime, ulon
> }
> bool check_date_with_warn(const MYSQL_TIME *ltime, uint fuzzy_date,
> timestamp_type ts_type);
> +bool adjust_time_range_with_warn(MYSQL_TIME *ltime, uint dec);
> int test_if_number(char *str,int *res,bool allow_wildcards);
> void change_byte(uchar *,uint,char,char);
> bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
This is 5.3, right? Take care when merging to 5.5, there's no
mysql_priv.h there, only sql_priv.h and this declaration should not end
up there, but in sql_time.h
Regards,
Sergei
Follow ups