mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(),
DAYOFWEEK(), and WEEKDAY().
This commit is contained in:
@ -1030,16 +1030,17 @@ longlong Item_func_yearweek::val_int()
|
||||
}
|
||||
|
||||
|
||||
/* weekday() has a automatic to_days() on item */
|
||||
|
||||
longlong Item_func_weekday::val_int()
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
ulong tmp_value=(ulong) args[0]->val_int();
|
||||
if ((null_value=(args[0]->null_value || !tmp_value)))
|
||||
return 0; /* purecov: inspected */
|
||||
TIME ltime;
|
||||
|
||||
if (get_arg0_date(<ime, TIME_NO_ZERO_DATE))
|
||||
return 0;
|
||||
|
||||
return (longlong) calc_weekday(tmp_value,odbc_type)+test(odbc_type);
|
||||
return (longlong) calc_weekday(calc_daynr(ltime.year, ltime.month,
|
||||
ltime.day),
|
||||
odbc_type) + test(odbc_type);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user