1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +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

@@ -18,12 +18,12 @@ DAYNAME('2020-12-22')
Tuesday
SELECT a, DAYNAME(a) FROM t1 ORDER BY 1;
a DAYNAME(a)
0000-00-00 Sunday
0000-00-00 NULL
1212-12-12 Wednesday
3333-03-03 Tuesday
SELECT b, DAYNAME(b) FROM t1 ORDER BY 1;
b DAYNAME(b)
0000-00-00 00:00:00 Sunday
0000-00-00 00:00:00 NULL
1212-12-11 11:11:11 Tuesday
3333-03-04 03:33:33 Wednesday
DROP DATABASE mcs185_db;