Bug #15217 | Using a SP cursor on a table created with PREPARE fails with weird error | ||
---|---|---|---|
Submitted: | 24 Nov 2005 10:43 | Modified: | 23 Jul 2006 3:58 |
Reporter: | Anders Karlsson | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S3 (Non-critical) |
Version: | 5.0.16 | OS: | Windows (Windows XP) |
Assigned to: | Konstantin Osipov | CPU Architecture: | Any |
[24 Nov 2005 10:43]
Anders Karlsson
[24 Nov 2005 10:52]
Anders Karlsson
What I meant to say what seems to work was a CREATE TABLE ... SELECT in one go.
[24 Nov 2005 11:53]
Hartmut Holzgraefe
Verified, in my case i get ERROR 1054 (42S22): Unknown column '��.IGN_COLS�����h40.c1' in 'field list' on the last statement
[7 Apr 2006 11:13]
Konstantin Osipov
Was able to repeat without temporary tables: drop table if exists t1; create table t1(c1 int); insert into t1 values(1); drop procedure if exists p1; delimiter // create procedure p1(tab varchar(64)) begin drop table if exists t2; set @stmt= concat('create table t2 as select * from ', tab); prepare p1 from @stmt; execute p1; deallocate prepare p1; begin declare var1 char(255); declare cur1 cursor for select * from t2; open cur1; fetch cur1 into var1; select concat('data was: /', var1, '/'); close cur1; end; end// delimiter ; call p1('t1'); call p1('t1');
[16 Jun 2006 1:58]
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/commits/7738
[22 Jun 2006 15:39]
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/commits/8086
[27 Jun 2006 14:59]
Konstantin Osipov
Pushed into 5.0.23 merged up to 5.1.12
[23 Jul 2006 3:58]
Paul DuBois
Noted in 5.0.23, 5.1.12 changelogs. Re-executing a stored procedure with a complex stored procedure cursor query could lead to a server crash.