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

@ -0,0 +1,12 @@
DROP DATABASE IF EXISTS MCOL5842;
CREATE DATABASE MCOL5842;
USE MCOL5842;
CREATE TABLE tcs(t TEXT) ENGINE=Columnstore;
INSERT INTO tcs(t) VALUES ('');
SELECT JSON_OBJECT('t', t, 'a', 'b') FROM tcs;
JSON_OBJECT('t', t, 'a', 'b')
{"t": "", "a": "b"}
SELECT GROUP_CONCAT(JSON_OBJECT('t', t, 'a', 'b')) FROM tcs;
GROUP_CONCAT(JSON_OBJECT('t', t, 'a', 'b'))
{"t": "", "a": "b"}
DROP DATABASE MCOL5842;

View File

@ -0,0 +1,12 @@
--disable_warnings
DROP DATABASE IF EXISTS MCOL5842;
--enable_warnings
CREATE DATABASE MCOL5842;
USE MCOL5842;
CREATE TABLE tcs(t TEXT) ENGINE=Columnstore;
INSERT INTO tcs(t) VALUES ('');
SELECT JSON_OBJECT('t', t, 'a', 'b') FROM tcs;
SELECT GROUP_CONCAT(JSON_OBJECT('t', t, 'a', 'b')) FROM tcs;
DROP DATABASE MCOL5842;