summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/table_value_constr.result22
-rw-r--r--mysql-test/main/table_value_constr.test13
2 files changed, 33 insertions, 2 deletions
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result
index 9e0a0968932..5b7f167cbde 100644
--- a/mysql-test/main/table_value_constr.result
+++ b/mysql-test/main/table_value_constr.result
@@ -11,7 +11,7 @@ values (1,2), (3,4), (5.6,0);
3.0 4
5.6 0
values ("abc", "def");
-abc def
+"abc" "def"
abc def
# UNION that uses VALUES structure(s)
select 1,2
@@ -92,7 +92,7 @@ we q
values ("ab", "cdf")
union
select "ab","cdf";
-ab cdf
+"ab" "cdf"
ab cdf
values (1,2)
union
@@ -2097,3 +2097,21 @@ v
#
with t as (values (),()) select 1 from t;
ERROR HY000: Row with no elements is not allowed in table value constructor in this context
+#
+# MDEV-16930: expression in the first row of TVC specifying derived table
+#
+VALUES(1+1,2);
+1+1 2
+2 2
+SELECT * FROM (VALUES(1+1,2)) t;
+1+1 2
+2 2
+PREPARE stmt FROM "SELECT * FROM (VALUES(1+1,2)) t";
+EXECUTE stmt;
+1+1 2
+2 2
+EXECUTE stmt;
+1+1 2
+2 2
+DEALLOCATE PREPARE stmt;
+# End of 10.3 tests
diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test
index eb5ea59f829..9908f8e61f1 100644
--- a/mysql-test/main/table_value_constr.test
+++ b/mysql-test/main/table_value_constr.test
@@ -1075,3 +1075,16 @@ DELIMITER ;|
--error ER_EMPTY_ROW_IN_TVC
with t as (values (),()) select 1 from t;
+
+--echo #
+--echo # MDEV-16930: expression in the first row of TVC specifying derived table
+--echo #
+
+VALUES(1+1,2);
+SELECT * FROM (VALUES(1+1,2)) t;
+PREPARE stmt FROM "SELECT * FROM (VALUES(1+1,2)) t";
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+--echo # End of 10.3 tests