From 462808f3b65b60958eaf8013b80857e341cc9f6c Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 20 Dec 2017 13:52:27 +0100 Subject: MDEV-10657: incorrect result returned with binary protocol (prepared statements) If translation table present when we materialize the derived table then change it to point to the materialized table. Added debug info to see really what happens with what derived. --- mysql-test/t/ps.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 4431f722ae0..ea67e1074f9 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3843,4 +3843,19 @@ deallocate prepare stmt; drop view v1,v2,v3; drop table t1,t2,t3; +--echo # +--echo # MDEV-10657: incorrect result returned with binary protocol +--echo # (prepared statements) +--echo # + +create table t1 (code varchar(10) primary key); +INSERT INTO t1(code) VALUES ('LINE1'), ('LINE2'), ('LINE3'); +SELECT X.* +FROM + (SELECT CODE, RN + FROM + (SELECT A.CODE, @cnt := @cnt + 1 AS RN + FROM t1 A, (SELECT @cnt := 0) C) T + ) X; +drop table t1; --echo # End of 5.5 tests -- cgit v1.2.1