In the FLOAT/DOUBLE to string conversions a class global string was used
to store the result. Unfortunately it is possible for an instance of
this class to be used by multiple threads of PrimProc simultaneously.
This would cause a race and data corruption or more likely a crash.
This fix passes a string object from the caller to use instead.
Fixes the following:
* Read past buffer end in intToDatetime / intToTime
* Allow intToTime to convert datetime
* Allow intToTime to convert shortened time values
* Allow stringToTime to convert datetime and int time values
* Fix saturation / bad values in intToTime and stringToTime
* Fix TIME return in STR_TO_DATE()
* Fix NULL return on type inequality for TIMEDIFF()
* Fix zero day calculation error in ADDTIME()/SUBTIME()
* Fix DATETIME to int calculation error in aggregate bit operations
* Make the new harderning flags optional with -DSECURITY_HARDENED_NEW
This fixes hex() so that it outputs the hex of the ASCII for the time
data to make it aligned with MariaDB. It also fixes the following
functions so that they use NOW() as a DATETIME with the input TIME added
to it:
* weekday()
* yearweek()
* monthname()
* last_day()
* year()
* weekofyear()
* week()
* to_days()
* quarter()
* month()
* dayofyear()
* dayofweek()
* dayofmonth()
* day()
* date()
If negative count number is more than the number of characters in the
string then it should always return the string.
For example if a table contains SUBSTRING_INDEX('zzz', 'z', -5) should
return 'zzz'. Before this patch it would return NULL.
MariaDB Server 10.2.14 changed the order that CASE items are processed.
This broke the engine's CASE handling. This patch uses the new order
instead since this is what will be used in 10.2 and 10.3 going forward.
In ha_calpont_execplan, Allow OR to be parsed; in searched_case parsing, reverse the order of processing arguments so that ptWorkStack.pop() is executed in the same order as the arguments being processed.
In func_case, modify to pass left and right to getBoolVal, if they exist.
cpimport would truncate UTF8 data half way through a character which
would cause problems for functions using that data. This patch
calculates the correct truncation point when inserting the data.
DOUBLE typecast was not supported and the failure detection caused a
crash.
This patch adds support for DOUBLE typecast and fixes the crash caused
when a non-supported function is detected as part of an arithmatic.
DOUBLE typecast was not supported and the failure detection caused a
crash.
This patch adds support for DOUBLE typecast and fixes the crash caused
when a non-supported function is detected as part of an arithmatic.