summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorDmitry Shulga <dmitry.shulga@mariadb.com>2021-07-18 13:28:12 +0700
committerDmitry Shulga <dmitry.shulga@mariadb.com>2021-07-18 13:28:12 +0700
commitddbe57c727fc2fd25d26e52266e0ed2de4ebbb1d (patch)
tree8ac386587d3c5b0d488f43634930024bf50753b5 /mysql-test
parent0f6e170c34700a2964556839c676c1b7768f3ffb (diff)
downloadmariadb-git-bb-10.2-MDEV-26145.tar.gz
MDEV-26145: Incorrect metadata is sent on running query with union in PS modebb-10.2-MDEV-26145
Test cases like the following one produce different result sets if it's run with and without th option --ps-protocol. CREATE TABLE t1(a INT); --enable_metadata (SELECT MAX(a) FROM t1) UNION (SELECT MAX(a) FROM t1); --disable_metadata DROP TABLE t1; Result sets differ in metadata for the query (SELECT MAX(a) FROM t1) UNION (SELECT MAX(a) FROM t1); The reason for different content of query metadata is that for queries with union the items being created on JOIN preparing phase is placed into item_list from SELECT_LEX_UNIT whereas for queries without union item_list from SELECT_LEX is used instead.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysql_client_test.result5
-rw-r--r--mysql-test/t/mysql_client_test.test4
2 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/mysql_client_test.result b/mysql-test/r/mysql_client_test.result
index 9538475fb86..37a735286da 100644
--- a/mysql-test/r/mysql_client_test.result
+++ b/mysql-test/r/mysql_client_test.result
@@ -126,6 +126,11 @@ Data:
EOF
mysql_stmt_next_result(): 0; field_count: 0
# ------------------------------------
+# cat MYSQL_TMP_DIR/test_mdev26145.out.log
+# ------------------------------------
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def MAX(a) MAX(a) 3 11 0 Y 32768 0 63
+# ------------------------------------
SET @@global.general_log= @old_general_log;
SET @@global.slow_query_log= @old_slow_query_log;
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 8c2f5e2c32b..aa9b1d5a77c 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -35,6 +35,10 @@ echo ok;
--echo # ------------------------------------
--cat_file $MYSQL_TMP_DIR/test_wl4435.out.log
--echo # ------------------------------------
+--echo # cat MYSQL_TMP_DIR/test_mdev26145.out.log
+--echo # ------------------------------------
+--cat_file $MYSQL_TMP_DIR/test_mdev26145.out.log
+--echo # ------------------------------------
--echo
SET @@global.general_log= @old_general_log;