List:Internals« Previous MessageNext Message »
From:eugene Date:September 11 2005 10:01pm
Subject:bk commit into 5.0 tree (evgen:1.1962)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1962 05/09/12 02:01:18 evgen@stripped +3 -0
  /home/evgen/mysql/bug-12993-comm.txt

  mysql-test/t/view.test
    1.105 05/09/12 02:00:35 evgen@stripped +9 -0
    Test case for bug #12993  View column rename broken in subselect

  mysql-test/r/view.result
    1.110 05/09/12 02:00:08 evgen@stripped +6 -0
    Test case for bug #12993  View column rename broken in subselect

  sql/sql_base.cc
    1.299 05/09/12 01:58:49 evgen@stripped +5 -0
    Fix bug #12993 View column rename broken in subselect
    Now when alias is set on ref, it's set on ref real item too.

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/12993-bug-5.0-mysql

--- 1.298/sql/sql_base.cc	2005-09-09 11:10:53 +04:00
+++ 1.299/sql/sql_base.cc	2005-09-12 01:58:49 +04:00
@@ -2648,10 +2648,15 @@
        *ref != NULL means that *ref contains the item that we need to
        replace. If the item was aliased by the user, set the alias to
        the replacing item.
+       We need to set alias on both ref itself and on ref real item.
       */
       if (*ref && !(*ref)->is_autogenerated_name)
+      {
         item->set_name((*ref)->name, (*ref)->name_length,
                        system_charset_info);
+        item->real_item()->set_name((*ref)->name, (*ref)->name_length,
+                       system_charset_info);
+      }
       if (register_tree_change)
         thd->change_item_tree(ref, item);
       else

--- 1.109/mysql-test/r/view.result	2005-09-07 22:55:47 +04:00
+++ 1.110/mysql-test/r/view.result	2005-09-12 02:00:08 +04:00
@@ -2186,3 +2186,9 @@
 120001a080000542	guser02
 drop view v1, v2;
 drop table t1, t2;
+create table t1(f1 char(1));
+create view v1 as select * from t1;
+select * from (select f1 as f2 from v1) v where v.f2='a';
+f2
+drop view v1;
+drop table t1;

--- 1.104/mysql-test/t/view.test	2005-09-07 22:55:47 +04:00
+++ 1.105/mysql-test/t/view.test	2005-09-12 02:00:35 +04:00
@@ -2059,3 +2059,12 @@
 
 drop view v1, v2;
 drop table t1, t2;
+
+#
+# Bug #12993 View column rename broken in subselect
+#
+create table t1(f1 char(1));
+create view v1 as select * from t1;
+select * from (select f1 as f2 from v1) v where v.f2='a';
+drop view v1;
+drop table t1;
Thread
bk commit into 5.0 tree (evgen:1.1962)eugene12 Sep