1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-04 04:42:30 +03:00

fix(ubsan): MCOL-5844 - iron out UBSAN reports

The most important fix here is the fix of possible buffer overrun in
DATEFORMAT() function. A "%W" format, repeated enough times, would
overflow the 256-bytes buffer for result. Now we use ostringstream to
construct result and we are safe.

Changes in date/time projection functions made me fix difference between
us and server behavior. The new, better behavior is reflected in changes
in tests' results.

Also, there was incorrect logic in TRUNCATE() and ROUND() functions in
computing the decimal "shift."
This commit is contained in:
Serguey Zefirov
2024-11-21 14:52:01 +03:00
committed by Leonid Fedorov
parent 3bcc2e2fda
commit 39a976c39a
26 changed files with 207 additions and 133 deletions

View File

@ -42,6 +42,8 @@ using namespace config;
#include "installdir.h"
#include "format.h"
#include "mcs_int128.h"
namespace
{
boost::mutex mx;
@ -127,6 +129,11 @@ void Message::Args::add(uint64_t u64)
fArgs.push_back(u64);
}
void Message::Args::add(int128_t i128)
{
fArgs.push_back(datatypes::TSInt128(i128).toString());
}
void Message::Args::add(const string& s)
{
fArgs.push_back(s);