summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-10-21 16:24:40 +0500
committerunknown <bar@mysql.com>2005-10-21 16:24:40 +0500
commitf3ee1afe41d8d43ed2d41025434387249828c6aa (patch)
treeccaffbb30776b841d59e03b2f7621c2ccb861b34
parent3bacfc84be57b750f0be69bcf54f9224988408a8 (diff)
parentbaa9876c6079893f607942c5b49c7148d3f07b72 (diff)
downloadmariadb-git-f3ee1afe41d8d43ed2d41025434387249828c6aa.tar.gz
Merge abarkov@bk-internal:/home/bk/mysql-5.0
into mysql.com:/usr/home/bar/mysql-5.0.b12371
-rw-r--r--mysql-test/r/information_schema.result12
-rw-r--r--mysql-test/t/information_schema.test12
-rw-r--r--sql/sql_parse.cc4
3 files changed, 26 insertions, 2 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 0d53180b6d6..9c3d6d40139 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1013,3 +1013,15 @@ grant all on information_schema.* to 'user1'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
grant select on information_schema.* to 'user1'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+use test;
+create table t1(id int);
+insert into t1(id) values (1);
+select 1 from (select 1 from test.t1) a;
+1
+1
+use information_schema;
+select 1 from (select 1 from test.t1) a;
+1
+1
+use test;
+drop table t1;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f351d315680..9fb57fc187b 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -715,3 +715,15 @@ select ROUTINE_NAME from routines;
grant all on information_schema.* to 'user1'@'localhost';
--error 1044
grant select on information_schema.* to 'user1'@'localhost';
+
+#
+# Bug#14089 FROM list subquery always fails when information_schema is current database
+#
+use test;
+create table t1(id int);
+insert into t1(id) values (1);
+select 1 from (select 1 from test.t1) a;
+use information_schema;
+select 1 from (select 1 from test.t1) a;
+use test;
+drop table t1;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 8ad7920a556..d0585dd1a65 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6197,8 +6197,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
ptr->ignore_leaves= test(table_options & TL_OPTION_IGNORE_LEAVES);
ptr->derived= table->sel;
- if (!my_strcasecmp(system_charset_info, ptr->db,
- information_schema_name.str))
+ if (!ptr->derived && !my_strcasecmp(system_charset_info, ptr->db,
+ information_schema_name.str))
{
ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table ||