my_time.c:

  in number_to_datetime(), zero out the MYSQL_TIME structure
  before setting values, to ensure that all fields are initialized; in
  particular, ensure that ->neg is set to zero (fixes valgrind warning
  "Conditional jump ... depends on uninitialised value" in make_date_time)
parent 74f00959
...@@ -1152,6 +1152,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, ...@@ -1152,6 +1152,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
ok: ok:
part1=(long) (nr/LL(1000000)); part1=(long) (nr/LL(1000000));
part2=(long) (nr - (longlong) part1*LL(1000000)); part2=(long) (nr - (longlong) part1*LL(1000000));
bzero((char*) time_res, sizeof(*time_res));
time_res->year= (int) (part1/10000L); part1%=10000L; time_res->year= (int) (part1/10000L); part1%=10000L;
time_res->month= (int) part1 / 100; time_res->month= (int) part1 / 100;
time_res->day= (int) part1 % 100; time_res->day= (int) part1 % 100;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment