summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-03-22 14:48:56 +0300
committerAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-03-22 14:48:56 +0300
commit7117e0635c60f5db23ebb0f4b0866ce93b8ffaed (patch)
tree02b955582a97c6c1aaf1ebd3e887b04520f98302 /mysql-test
parentb629abf3ae26ef9b828efc1dafa85cb098a987b0 (diff)
downloadmariadb-git-7117e0635c60f5db23ebb0f4b0866ce93b8ffaed.tar.gz
A patch for Bug#11763413 (56115: SELECT doesn't work in
prepared statements with cursor protocol). The problem was a bug in Materialized-cursor implementation. Materialized_cursor::open() called send_result_metadata() with items pointing to already closed table. The fix is to send metadata when the table is still open. NOTE: this is a "partial" fix: metadata are different with and without --cursor-protocol, but that's a different large problem, one indication of which is reported as Bug 24176.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result16
-rw-r--r--mysql-test/t/ps.test16
2 files changed, 30 insertions, 2 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 17f639cdca3..afa105a39b8 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3731,5 +3731,19 @@ CREATE TABLE t1 (a INT);
BEGIN;
PREPARE stmt1 FROM "SELECT * FROM t1";
DROP TABLE t1;
+
+#
+# Bug#56115: invalid memory reads when PS selecting from
+# information_schema tables
+# Bug#58701: crash in Field::make_field, cursor-protocol
+#
+# NOTE: MTR should be run both with --ps-protocol and --cursor-protocol.
+#
+
+SELECT *
+FROM (SELECT 1 UNION SELECT 2) t;
+1
+1
+2
#
-# End of 6.0 tests.
+# End of 5.5 tests.
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index eaef1cf3000..e00bd785789 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3344,7 +3344,21 @@ connection default;
DROP TABLE t1;
disconnect con1;
+--echo
+--echo #
+--echo # Bug#56115: invalid memory reads when PS selecting from
+--echo # information_schema tables
+--echo # Bug#58701: crash in Field::make_field, cursor-protocol
+--echo #
+--echo # NOTE: MTR should be run both with --ps-protocol and --cursor-protocol.
+--echo #
+--echo
+
+SELECT *
+FROM (SELECT 1 UNION SELECT 2) t;
+
+
--echo #
---echo # End of 6.0 tests.
+--echo # End of 5.5 tests.
###########################################################################