Bug #4688 | MySQL allows create function referencing to table | ||
---|---|---|---|
Submitted: | 22 Jul 2004 4:18 | Modified: | 5 Mar 2005 14:05 |
Reporter: | Dmitry Lenev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0 | OS: | |
Assigned to: | Dmitry Lenev | CPU Architecture: | Any |
[22 Jul 2004 4:18]
Dmitry Lenev
[25 Nov 2004 23:55]
Peter Gulutzan
MySQL also allows table references in a function's RETURN statement. Example: mysql> create table t (s1 int); Query OK, 0 rows affected (0.29 sec) mysql> create function f43 () returns int return (1 = exists(select 'a' from t)); Query OK, 0 rows affected (0.00 sec) mysql> select f43(); ERROR 2013 (HY000): Lost connection to MySQL server during query
[5 Mar 2005 14:05]
Dmitry Lenev
Hi! Restriction which does not allowed to access tables in stored functions was removed in 5.0.3. So now it is perfectly ok to reference to tables in them. Both test cases work as expected now.