From af6eee1fc5c40c73edb65c08d16929ccfdc1f5f0 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 14 Mar 2017 17:31:14 +0400 Subject: MDEV-11833 JSON functions don't seem to respect max_allowed_packet. Now let's check JSON length to fit the max_allowed packet. --- mysql-test/r/func_json.result | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/r/func_json.result') diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index b1e52efcf8f..6a77648efa5 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -595,3 +595,26 @@ JSON_search( '{"x": "\\""}', "one", '"') SELECT JSON_search( '{"x": "\\""}', "one", '\\"'); JSON_search( '{"x": "\\""}', "one", '\\"') "$.x" +set @@global.net_buffer_length=1024; +set @@global.max_allowed_packet=2048; +connect newconn, localhost, root,,; +show variables like 'net_buffer_length'; +Variable_name Value +net_buffer_length 1024 +show variables like 'max_allowed_packet'; +Variable_name Value +max_allowed_packet 2048 +select json_array(repeat('a',1024),repeat('a',1024)); +json_array(repeat('a',1024),repeat('a',1024)) +NULL +Warnings: +Warning 1301 Result of json_array() was larger than max_allowed_packet (2048) - truncated +select json_object("a", repeat('a',1024),"b", repeat('a',1024)); +json_object("a", repeat('a',1024),"b", repeat('a',1024)) +NULL +Warnings: +Warning 1301 Result of json_object() was larger than max_allowed_packet (2048) - truncated +connection default; +set @@global.max_allowed_packet = default; +set @@global.net_buffer_length = default; +disconnect newconn; -- cgit v1.2.1