List:Internals« Previous MessageNext Message »
From:ahristov Date:August 16 2005 11:59am
Subject:bk commit into 5.0 tree (andrey:1.1983) BUG#12533
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of andrey. When andrey 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.1983 05/08/16 11:58:53 andrey@lmy004. +3 -0
  fix for bug #12533 (crash on DESCRIBE <view> after renaming base column)
  (fixes after review)

  sql/sql_show.cc
    1.268 05/08/16 11:58:44 andrey@lmy004. +13 -7
    close thread tables even in case of error
    (after review (dlenev) changes)

  mysql-test/t/view.test
    1.98 05/08/16 11:58:44 andrey@lmy004. +16 -0
    test for bug #12533

  mysql-test/r/view.result
    1.104 05/08/16 11:58:43 andrey@lmy004. +10 -0
    results of the test for bug #12533

# 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:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.0-bug12533

--- 1.267/sql/sql_show.cc	2005-08-16 11:18:29 +02:00
+++ 1.268/sql/sql_show.cc	2005-08-16 11:58:44 +02:00
@@ -1979,13 +1979,17 @@
     lex->all_selects_list= lsel;
     res= open_normal_and_derived_tables(thd, show_table_list,
                                         MYSQL_LOCK_IGNORE_FLUSH);
-    if (schema_table->process_table(thd, show_table_list,
+    /*
+      get_all_tables() returns 1 on failure and 0 on success thus
+      return only these and not the result code of ::process_table()
+    */
+    if (!(schema_table->process_table(thd, show_table_list,
                                     table, res, show_table_list->db,
-                                    show_table_list->alias))
-      goto err;
+                                    show_table_list->alias)))
+      error= 0;
+
     close_thread_tables(thd);
     show_table_list->table= 0;
-    error= 0;
     goto err;
   }
 
@@ -2084,11 +2088,13 @@
             lex->derived_tables= 0;
             res= open_normal_and_derived_tables(thd, show_table_list,
                                                 MYSQL_LOCK_IGNORE_FLUSH);
-            if (schema_table->process_table(thd, show_table_list, table,
+            if (!(schema_table->process_table(thd, show_table_list, table,
                                             res, base_name,
-                                            show_table_list->alias))
-              goto err;
+                                            show_table_list->alias)))
+              error= 0;
             close_thread_tables(thd);
+            if (error)
+              goto err;
           }
         }
       }

--- 1.103/mysql-test/r/view.result	2005-08-12 20:08:29 +02:00
+++ 1.104/mysql-test/r/view.result	2005-08-16 11:58:43 +02:00
@@ -2097,3 +2097,13 @@
 f1
 1
 drop view v1;
+DROP TABLE IF EXISTS t1;
+DROP VIEW  IF EXISTS v1;
+CREATE TABLE t1 (f4 CHAR(5));
+CREATE VIEW v1 AS SELECT * FROM t1;
+DESCRIBE v1;
+Field	Type	Null	Key	Default	Extra
+f4	char(5)	YES		NULL	
+ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
+DESCRIBE v1;
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)

--- 1.97/mysql-test/t/view.test	2005-08-12 20:08:20 +02:00
+++ 1.98/mysql-test/t/view.test	2005-08-16 11:58:44 +02:00
@@ -1942,3 +1942,19 @@
 create view v1 as select timestampdiff(day,'1997-01-01 00:00:00','1997-01-02 00:00:00')
as f1;
 select * from v1;
 drop view v1;
+
+#
+# BUG #12533 (crash on DESCRIBE <view> after renaming base table column)
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW  IF EXISTS v1;
+--enable_warnings
+
+CREATE TABLE t1 (f4 CHAR(5));
+CREATE VIEW v1 AS SELECT * FROM t1;
+DESCRIBE v1;
+
+ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
+--error 1356
+DESCRIBE v1;
Thread
bk commit into 5.0 tree (andrey:1.1983) BUG#12533ahristov16 Aug