Bug #5151 Views: View using dropped function: crashes
Submitted: 23 Aug 2004 1:03 Modified: 6 Sep 2004 13:44
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[23 Aug 2004 1:03] Peter Gulutzan
Description:
I can create a function, create a view based on the function, drop the function, 
and then select from the view. The result is a crash. 

How to repeat:
mysql> create function x1 () returns int return 5; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> create table t (s1 int); 
Query OK, 0 rows affected (0.28 sec) 
 
mysql> create view vxt1 as select x1() from t; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> drop function x1; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> select * from vxt1; 
ERROR 2013 (HY000): Lost connection to MySQL server during query 
 

Suggested fix:
Support RESTRICT|CASCADE.
[1 Sep 2004 18:01] Oleksandr Byelkin
ChangeSet 
  1.1741 04/09/01 19:00:41 bell@sanja.is.com.ua +7 -0 
  adding mysql.proc to table list if view contains stored procedures (BUG#5151)
[6 Sep 2004 13:44] Oleksandr Byelkin
Thank you for bugreport! This bug is fixed and patch for it pushed into source repository.