summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived.test
diff options
context:
space:
mode:
authorgluh@gluh.mysql.r18.ru <>2003-09-04 17:12:20 +0500
committergluh@gluh.mysql.r18.ru <>2003-09-04 17:12:20 +0500
commit548d7dc948607e8ac228463f42c161aa50288086 (patch)
tree8ea687bd43f9b796927a8422267d6355895d3955 /mysql-test/t/derived.test
parentb34c3934d947f24776ee8b019cc7f65903864709 (diff)
downloadmariadb-git-548d7dc948607e8ac228463f42c161aa50288086.tar.gz
Fix for bug 1176
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r--mysql-test/t/derived.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index c3edbabcd53..3c735878e46 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -94,3 +94,16 @@ drop table t1,t2;
# derived table reference
#
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
+
+#
+# Test for select if database is not selected.
+#
+# Connect without a database
+create table a1 select 1 as a;
+connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
+connection con1;
+--error 1046
+select 2 as a from (select * from a1) b;
+use test;
+select 2 as a from (select * from a1) b;
+drop table a1;