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

fix(MCOL-5842): Fix JSON_OBJECT's handling of empty strings

JSON_OBJECT() (and probably some other JSON functions) now properly
handle empty strings in their arguments - JSON_OBJECT used to return
NULL, now it returns empty string.
This commit is contained in:
Serguey Zefirov
2025-02-25 08:09:49 +00:00
committed by Leonid Fedorov
parent b6707dd9f8
commit e37d621a12
3 changed files with 25 additions and 1 deletions

View File

@ -32,7 +32,7 @@ bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullSt
int strLen = jsLen * 12 * jsCS->mbmaxlen / jsCS->mbminlen;
char* buf = (char*)alloca(strLen);
if ((strLen = json_escape(retCS, (const uchar*)rawJS, (const uchar*)rawJS + jsLen, jsCS, (uchar*)buf,
(uchar*)buf + strLen)) > 0)
(uchar*)buf + strLen)) >= 0)
{
buf[strLen] = '\0';
ret.append(buf, strLen);