From f391ab4f016056d8d118e02cff936e27fbceec50 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 4 Dec 2016 13:57:46 +0400 Subject: [PATCH] MDEV-11438 Assertion `null_value' failed in Item::send(Protocol*, String*) upon casting NULL as JSON. test added. --- mysql-test/r/func_json.result | 3 +++ mysql-test/t/func_json.test | 1 + 2 files changed, 4 insertions(+) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 9b9e0623269..b3478b29b2f 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -244,6 +244,9 @@ json_object("a", '{"b": "abcd"}') select json_object("a", cast('{"b": "abcd"}' as json)); json_object("a", cast('{"b": "abcd"}' as json)) {"a": {"b": "abcd"}} +select cast(NULL AS JSON); +cast(NULL AS JSON) +NULL select json_depth(cast(NULL as JSON)); json_depth(cast(NULL as JSON)) NULL diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 51ea05cf5f2..e3c0264c674 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -108,5 +108,6 @@ select json_object("a", json_object("b", "abcd")); select json_object("a", '{"b": "abcd"}'); select json_object("a", cast('{"b": "abcd"}' as json)); +select cast(NULL AS JSON); select json_depth(cast(NULL as JSON));