summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/derived.result3
-rw-r--r--mysql-test/t/derived.test1
-rw-r--r--sql/sql_yacc.yy1
3 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 06d2e663221..6a3aa328175 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -1,3 +1,6 @@
+select * from (select 2 from DUAL) b;
+2
+2
SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index b9c9ab8a718..0c366b65797 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -1,3 +1,4 @@
+select * from (select 2 from DUAL) b;
-- error 1054
SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
-- error 1054
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 55f165c0739..e99f2a3b17c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -997,6 +997,7 @@ merge_insert_types:
opt_select_from:
opt_limit_clause {}
+ | FROM DUAL_SYM {}
| select_from select_lock_type;
udf_func_type: