← Back to team overview

maria-discuss team mailing list archive

JSON and binary strings

 

BINARY is one of the datatypes you can use with dynamic columns. If you try
saving binary string and then retrieve it with COLUMN_JSON() then you get an
invalid JSON document back. All the JSON decoders I tested reject such
documents.

It doesn't make sense to me that COLUMN_JSON() would return a document
that's invalid according to the JSON spec and can't be decoded. But I don't
know what it should do. It seems that BINARY in dynamic columns means that
COLUMN_JSON() is in an impossible position.

[On a related note, if you save a valid utf8 string that includes control
characters (e.g. "I went down to the river,\nI set down on the bank.") then
COLUMN_JSON() fails to escape them. While similar, this I think is a bug.]

Tom