Bug #6866 | stored procedures are errornous in conjunction with views | ||
---|---|---|---|
Submitted: | 29 Nov 2004 2:29 | Modified: | 10 Jun 2005 20:08 |
Reporter: | Harald Gölles | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.2 | OS: | Linux (linux) |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
[29 Nov 2004 2:29]
Harald Gölles
[4 Dec 2004 0:04]
Peter Gulutzan
Here is a slightly simpler test case (SuSE 9.2, 5.0.3-alpha-debug) create table t (s1 int); create view v as select * from t; create procedure p () select * from v; call p(); /* the return is 'empty set' but the server has crashed */
[25 Feb 2005 12:50]
Per-Erik Martin
This no longer crashes the server. Instead a syntax error is reported, but this is independent of the use of a stored procedure. The additional simplified test case is now working. mysql> call tp (1); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test`.`t` join `test`.`t2` on((`test`.`t`.`t2` = `test`.`t2`.`t2`))) left join `' at line 1 mysql> mysql> select * from tv where t1 = 1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test`.`t` join `test`.`t2` on((`test`.`t`.`t2` = `test`.`t2`.`t2`))) left join `' at line 1 mysql> select t.*, t2.data2, t3.data3 from t inner join t2 on t.t2 = t2.t2 left join t3 on t.t3 = t3.t3 order by t.t1, t2.t2, t3.t3; +------+------+------+------+-------+-------+ | t1 | t2 | t3 | data | data2 | data3 | +------+------+------+------+-------+-------+ | 1 | 1 | 4 | xx | a | d | +------+------+------+------+-------+-------+ 1 row in set (0.04 sec)
[6 Jun 2005 13:05]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/25641
[6 Jun 2005 14:23]
Igor Babaev
ChangeSet 1.1952 05/06/06 06:05:11 igor@rurik.mysql.com +3 -0 sp.test, sp.result: Added a test case for bug #6866. sql_select.cc: Fixed bug #6866. Bug was due to the fact that on_expr was not backed up for the second execution of the stored procedure. This fix will appear in 5.0.7.
[10 Jun 2005 20:08]
Paul DuBois
Noted in 5.0.7 changelog.
[10 Jun 2005 20:08]
Paul DuBois
Noted in 5.0.7 changelog.