From 3e8f7c8516d643a6e6fae95596cb426082c2c7f5 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 11 Oct 2013 19:27:53 +0400 Subject: MDEV-5122: "Commands out of sync", "Malformed packet" or client hang up... - When INSERT catches an error, it should not attempt to send parts of EXPLAIN output. --- mysql-test/t/explain_non_select.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'mysql-test/t/explain_non_select.test') diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index 316cc1bf8d2..f05373c312e 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -169,3 +169,32 @@ explain insert into t2 values (11, 1+(select max(a+1) from t1)); drop table t1,t2; + +--echo # +--echo # MDEV-5122: "Commands out of sync", "Malformed packet" or client hang up on unique key violation +--echo # +drop table if exists t1; + +--disable_warnings +drop function if exists f1; +--enable_warnings + +create table t1 (a int, unique(a)); + +delimiter |; +create function f1(x int) + returns int +begin + insert into t1 values(x),(x); + return 10; +end| +delimiter ;| + +--error ER_DUP_ENTRY +select f1(100); +select 'OK'; + +drop function f1; +drop table t1; + + -- cgit v1.2.1