summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-25 23:29:45 +0200
committerunknown <monty@mysql.com>2004-03-25 23:29:45 +0200
commit9fbb59ecdb5807c93146f0772bbc8c770bba5747 (patch)
tree7815fb40163d1db39e3991dcd19341ef57d08d74 /sql/sql_union.cc
parent719020af170c193cef3ce6b350d487de20a31c87 (diff)
parente27b39393bd59129b796a0d30e4bedc95256b618 (diff)
downloadmariadb-git-9fbb59ecdb5807c93146f0772bbc8c770bba5747.tar.gz
Merge with 4.0
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-libmysql.def~f5dffcb3ed925d28: Auto merged BitKeeper/deleted/.del-post-incoming~9f2168f531f09f3b: Auto merged BitKeeper/deleted/.del-post-outgoing~1dd3d8f0f6e8f3cd: Auto merged VC++Files/innobase/innobase.dsp: Auto merged VC++Files/strings/MASM6x/strings.dsp: Auto merged client/mysqldump.c: Auto merged innobase/sync/sync0sync.c: Auto merged myisam/mi_check.c: Auto merged mysql-test/t/union.test: Auto merged mysql-test/t/update.test: Auto merged mysys/mf_iocache.c: Auto merged sql/nt_servc.cc: Auto merged mysql-test/r/system_mysql_db.result: Auto merged sql/sql_base.cc: Auto merged
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index f5488f59adf..cb385b482cf 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -112,6 +112,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *lex_select_save= thd_arg->lex->current_select;
SELECT_LEX *sl, *first_select;
select_result *tmp_result;
+ ORDER *tmp_order;
DBUG_ENTER("st_select_lex_unit::prepare");
/*
@@ -207,6 +208,19 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
+ for (tmp_order= (ORDER*) global_parameters->order_list.first;
+ tmp_order ;
+ tmp_order= tmp_order->next;
+ {
+ Item *item= *tmp_order->item;
+ if (((item->type() == Item::FIELD_ITEM) &&
+ ((class Item_field*) item)->table_name))
+ {
+ my_error(ER_BAD_FIELD_ERROR,MYF(0),item->full_name(),"ORDER BY");
+ DBUG_RETURN(-1);
+ }
+ }
+
item_list.empty();
// it is not single select
if (first_select->next_select())