List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:March 28 2005 8:30am
Subject:bk commit into 5.0 tree (sergefp:1.1845) BUG#8703
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey 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.1845 05/03/28 10:30:21 sergefp@stripped +3 -0
  Fix for BUG#8703 "Insert into table select from view crashes":
  In find_table_in_list() don't try accessing underlying table for view
  that doesn't have one (tables which are members of the view are present in
  the table list and will be checked in next loop iterations)

  sql/sql_base.cc
    1.231 05/03/28 10:30:16 sergefp@stripped +1 -1
    Fix for BUG#8703 "Insert into table select from view crashes":
    In find_table_in_list() don't try accessing underlying table for view
    that doesn't have one (tables which are members of the view are present in
    the table list and will be checked in next loop iterations)

  mysql-test/t/view.test
    1.63 05/03/28 10:30:16 sergefp@stripped +10 -0
    Testcase for BUG#8703

  mysql-test/r/view.result
    1.72 05/03/28 10:30:16 sergefp@stripped +8 -0
    Testcase for BUG#8703

# 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:	sergefp
# Host:	newbox.mylan
# Root:	/home/psergey/mysql-5.0-look30

--- 1.230/sql/sql_base.cc	2005-03-16 17:10:55 +03:00
+++ 1.231/sql/sql_base.cc	2005-03-28 10:30:16 +04:00
@@ -702,7 +702,7 @@
       if ((table->table == 0 || table->table->s->tmp_table == NO_TMP_TABLE)
&&
           ((!strcmp(table->db, db_name) &&
             !strcmp(table->table_name, table_name)) ||
-           (table->view &&
+           (table->view && table->table &&
             !strcmp(table->table->s->db, db_name) &&
             !strcmp(table->table->alias, table_name))))
         break;

--- 1.71/mysql-test/r/view.result	2005-03-23 11:32:40 +03:00
+++ 1.72/mysql-test/r/view.result	2005-03-28 10:30:16 +04:00
@@ -1778,3 +1778,11 @@
 s2
 drop view v1;
 drop table t1;
+create table t1 (a int);
+create table t2 like t1;
+create table t3 like t1;
+create view v1 as select t1.a x, t2.a y from t1 join t2 where t1.a=t2.a;
+insert into t3 select x from v1;
+insert into t2 select x from v1;
+drop table t1,t2,t3;
+drop view v1;

--- 1.62/mysql-test/t/view.test	2005-03-15 20:54:39 +03:00
+++ 1.63/mysql-test/t/view.test	2005-03-28 10:30:16 +04:00
@@ -1716,3 +1716,13 @@
 drop view v1;
 drop table t1;
 
+# Test for BUG#8703 "insert into table select from view crashes"
+create table t1 (a int);
+create table t2 like t1;
+create table t3 like t1;
+create view v1 as select t1.a x, t2.a y from t1 join t2 where t1.a=t2.a;
+insert into t3 select x from v1;
+insert into t2 select x from v1;
+drop table t1,t2,t3;
+drop view v1;
+
Thread
bk commit into 5.0 tree (sergefp:1.1845) BUG#8703Sergey Petrunia28 Mar