Fixing a valgrind warning introduced in the previous changeset:
"have_warnings" was set to an uninialized value when converting a negative number to datetime.
This commit is contained in:
parent
661daf16f1
commit
30b007a1ab
@ -303,9 +303,16 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
f_type= MYSQL_TYPE_DATETIME;
|
f_type= MYSQL_TYPE_DATETIME;
|
||||||
res= neg ? -1 : number_to_datetime(nr, sec_part, ltime, fuzzydate, &was_cut);
|
if (neg)
|
||||||
|
{
|
||||||
|
res= -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res= number_to_datetime(nr, sec_part, ltime, fuzzydate, &was_cut);
|
||||||
have_warnings= was_cut && (fuzzydate & TIME_NO_ZERO_IN_DATE);
|
have_warnings= was_cut && (fuzzydate & TIME_NO_ZERO_IN_DATE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (res < 0 || have_warnings)
|
if (res < 0 || have_warnings)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user