summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-12-02 20:18:51 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-12-02 20:18:51 +0200
commit47af809c617a9582a71ff0a13aeed4c74d848ef6 (patch)
tree374595893cfcdc147203da32bfac612391bffa8d /sql/sql_base.cc
parent36429430c6bd18b7cccd459711ddd0ab30a2e63e (diff)
downloadmariadb-git-47af809c617a9582a71ff0a13aeed4c74d848ef6.tar.gz
Proper handling of ORDER BY table.column in UNION's
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index fc7629caae3..63affe5fde6 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1957,8 +1957,14 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
table_name=buff;
}
if (report_error)
- my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0),
- table_name, thd->where);
+ {
+ if (thd->lex.current_select->get_master()->order_list.elements)
+ my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE, ER(ER_TABLENAME_NOT_ALLOWED_HERE),
+ MYF(0), table_name, thd->where);
+ else
+ my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0),
+ table_name, thd->where);
+ }
else
return (Field*) not_found_field;
}