summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@sanjaLaptopT>2017-12-20 13:52:27 +0100
committerOleksandr Byelkin <sanja@sanjaLaptopT>2017-12-20 13:52:27 +0100
commit24b4585ad0648f21519f47a04762e1b208918749 (patch)
tree00594ae17668aa56bf99a6aa19fe8048831bb908 /mysql-test
parent924db8b4ed3f268cbe91a1734611f4dc2311c7be (diff)
downloadmariadb-git-bb-5.5-MDEV-10657.tar.gz
MDEV-10657: incorrect result returned with binary protocol (prepared statements)bb-5.5-MDEV-10657
If translation table present when we materialize the derived table then change it to point on the materialized table. Added debug info to see really what happens with what derived.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result18
-rw-r--r--mysql-test/t/ps.test15
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 3fed0a5b0d1..209d3d85108 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -4316,4 +4316,22 @@ set join_cache_level=@join_cache_level_save;
deallocate prepare stmt;
drop view v1,v2,v3;
drop table t1,t2,t3;
+#
+# MDEV-10657: incorrect result returned with binary protocol
+# (prepared statements)
+#
+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;
+CODE RN
+LINE1 1
+LINE2 2
+LINE3 3
+drop table t1;
# End of 5.5 tests
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