List:Internals« Previous MessageNext Message »
From:sinisa Date:March 22 2004 2:35pm
Subject:bk commit into 4.0 tree (Sinisa:1.1761)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of Sinisa. When Sinisa does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1761 04/03/22 16:35:15 Sinisa@stripped +3 -0
  union.result:
     A test case for the bug  that allowed table names to be used in ORDER BY columns (But #3064)
  union.test:
    A test case for the bug  that allowed table names to be used in ORDER BY columns (But #3064)
  sql_union.cc:
    A fix for a bug that allowed table names to be used in ORDER BY columns (But #3064)

  mysql-test/r/union.result
    1.29 04/03/22 16:34:49 Sinisa@stripped +2 -0
     A test case for the bug  that allowed table names to be used in ORDER BY columns (But #3064)

  mysql-test/t/union.test
    1.33 04/03/22 16:34:20 Sinisa@stripped +2 -0
    A test case for the bug  that allowed table names to be used in ORDER BY columns (But #3064)

  sql/sql_union.cc
    1.48 04/03/22 16:33:05 Sinisa@stripped +10 -0
    A fix for a bug that allowed table names to be used in ORDER BY columns (But #3064)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	Sinisa
# Host:	sinisa.nasamreza.org
# Root:	/mnt/work/mysql-4.0

--- 1.28/mysql-test/r/union.result	Thu Dec 11 06:24:05 2003
+++ 1.29/mysql-test/r/union.result	Mon Mar 22 16:34:49 2004
@@ -422,6 +422,8 @@
 create temporary table t1 select a from t1 union select a from t2;
 create table t1 select a from t1 union select a from t2;
 INSERT TABLE 't1' isn't allowed in FROM table list
+select a from t1 union select a from t2 order by t2.a;
+Unknown column 't2.a' in 'ORDER BY'
 drop table t1,t2;
 select length(version()) > 1 as `*` UNION select 2;
 *

--- 1.32/mysql-test/t/union.test	Thu Dec 11 06:24:05 2003
+++ 1.33/mysql-test/t/union.test	Mon Mar 22 16:34:20 2004
@@ -226,6 +226,8 @@
 create temporary table t1 select a from t1 union select a from t2;
 --error 1093
 create table t1 select a from t1 union select a from t2;
+--error 1054
+select a from t1 union select a from t2 order by t2.a;
 drop table t1,t2;
 
 #

--- 1.47/sql/sql_union.cc	Fri Aug 22 18:43:43 2003
+++ 1.48/sql/sql_union.cc	Mon Mar 22 16:33:05 2004
@@ -100,6 +100,7 @@
   else
   {
     Item *item;
+    ORDER *orr;
     List_iterator<Item> it(lex->select_lex.item_list);
     TABLE_LIST *first_table= (TABLE_LIST*) lex->select_lex.table_list.first;
 
@@ -110,6 +111,15 @@
     if (setup_tables(first_table) ||
 	setup_fields(thd,first_table,item_list,0,0,1))
       DBUG_RETURN(-1);
+    for (orr=order;orr;orr=orr->next)
+    {
+      item=*orr->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);
+      }
+    }
   }
 
   bzero((char*) &tmp_table_param,sizeof(tmp_table_param));
Thread
bk commit into 4.0 tree (Sinisa:1.1761)sinisa22 Mar