Bug #54869 view pulling from a view that was renamed crashes mysqld
Submitted: 28 Jun 2010 18:32 Modified: 28 Jul 2010 19:25
Reporter: Chris Hansen Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Views Severity:S3 (Non-critical)
Version:14.12 Distrib 5.0.77, for redhat OS:Linux (Cent OS 5.0)
Assigned to: CPU Architecture:Any
Tags: renamed views, SHOW CREATE TABLE

[28 Jun 2010 18:32] Chris Hansen
Description:
Querying a view or trying to run a backup from a view that is referencing a view that no longer exists (by way of rename) causes the server to crash and the backup to fail

How to repeat:
step 1: create a table
step 2: create a view pulling data from the table
step 3: create a second view pulling data from the first view
step 4: rename the first view
step 5: re-run the view created in step 3..

customer stumbled onto this issue and crashed her server like 10 times in the same day

backups fail with 
"mysqldump: Couldn't execute 'show create table `ZAAreaDistribution`': Lost connection to MySQL server during query (2013)"

Suggested fix:
a simple error report "referencing view no longer exists"
[28 Jun 2010 19:25] Valeriy Kravchuk
This is what I get when testing on current 5.0.92 from bzr:

valeriy-kravchuks-macbook-pro:5.0 openxs$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.92-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create table tv(c1 int);
Query OK, 0 rows affected (0.00 sec)

mysql> create view tv1 as select * from tv;
Query OK, 0 rows affected (0.00 sec)

mysql> create view tv2 as select * from tv1;
Query OK, 0 rows affected (0.00 sec)

mysql> rename table tv1 to tv3;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from tv2;
ERROR 1356 (HY000): View 'test.tv2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

What am I missing? If nothing, please, check with a newer version, 5.0.91, and inform about the results.
[28 Jul 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".