FROM_UNIXTIME() function always returns AUTO_SEC_PART_DIGITS
(value=39). In case the microsecond value was set in MYSQL_TIME,
the decimal part should be SEC_PART_DIGITS (=6).
Fixed max_length values in ma_stmt_codecs for integer types:
- all types included an extra byte for trailing zero character
- maximum value for year column type is 2155 (and not 0xFFFF).
Due to gcc bug 323 (optimized code gives strange floating point results)
we need to declare floating point variable as volatile, to make sure it
will be reread from memory when converting a long long value to float.
Various coverity scan fixes, including CONC-452 and CONC-453.
Special thanks to Lukas Javorsky for fixing numerous covscan
issues (This patch includes part of his pull request #126).
Coverity scan build was using the following cmake parameters:
-WITH_EXTERNAL_ZLIB=ON -DWITH_UNIT_TESTS=OFF.
CWE-416 (use after free) in dtoa.c (from netlib) is still open.
Field's display width should not constraint the value in the
column. The manual says that if the column's value is longer
than the display width it's still displayed in full.
Followup for 3e8973c
if the length of the provided result buffer is equal or smaller than the converted number and
ZEROFILL FLAG is set, a truncation error will be reported.
Fix a regression in new my_atoll()/my_atoull()
to set error, if there are non-digits found in the string.
Spaces at the start and end of string are ignored (however, not between the
digits).
Fix implementations of str_to_TIME() and my_atoll()
Implement own version my_strtoll() (similar to strtoull(), not requiring
null termination).
Use it to for optimized implementation of numbers and dates.
libmariadb\libmariadb\ma_stmt_codec.c(263): warning C4244: '*=': conversion from 'double' to 'unsigned long', possible loss of data
generally avoid slow floating point pow() when all you need is to
multiply an integer by a small power of 10.
If a datetime or time value is represented a a string and has a fractional part with less than 6 digits,
it should be interpreted as a 6-digit representation:
.9 becomes 900000
.09 becomes 90000
etc.
- added support for negative time values
- invalid strings (and/or conversion) and invalid values will result in MYSQL_TIMESTAMP_ERROR time type
- added support for 2digit year representation:
values < 69 will be converted to 20YY
values >= 69 will be converted to 19YY
- The metadata length value for a column with a zerofill flag was calculated with a fixed length instead of using the reported length.
- fixed a possible stackoverflow, if the display width for a column with zerofill flag is greater then 22. (libmysql ps implementation truncates the result after 21 digits and reports truncation error).
1. Do not remove the last character from the blob
(indeed, why C/C would corrupt the retrieved value?)
2. Always append a teminating '\0' if fetching into a string,
also when nothing was fetched (blob length = 0)
this fixes various test failures in --ps-protocol in the server
When converting datetime with microseconds to string (binary protocol) number of decimal
places was ignored. Thanks to Patrick Huesmann for providing a fix.
Fixed float/double/decimal converion for prepared statements:
since _gcvt (Windows) and gcvt (*nix) deliver different results
we use now dtoa.c from server package, which is licensed under
LGPL.