Bug #3805 Stored Procedures work only one time
Submitted: 18 May 2004 0:09 Modified: 23 May 2004 13:43
Reporter: Alex Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.0 OS:Linux (Linux 2.6.6)
Assigned to: CPU Architecture:Any

[18 May 2004 0:09] Alex
Description:
Hi,

I wrote a simple SP.

The first time it runs, all works fine but if I change one or either the params and re-CALL I get a 1313 warning (No data to FETCH) and the OUT params are NULL even if record exists or if I resubmit the first couple of params.

If I reconnect to db all works fine again but only for the first call

It seems that I'm the only one with this strange behavior... 

Sorry for my bad english

Thanks
Alex

 

How to repeat:
/* PROCEDURE */
CREATE PROCEDURE qgest_do_login (IN qguUsername VARCHAR(10), IN qguPassword VARCHAR(41), OUT qguId INT, OUT qguName VARCHAR(25))
BEGIN
	SELECT qgu_id, qgu_name INTO qguId, qguName FROM qgest.qgest_users WHERE qgu_username = qguUsername AND qgu_password = PASSWORD(qguPassword);
END

/* TABLE (INNODB) */
CREATE TABLE `qgest_users` 
(
  `qgu_id` int(10) unsigned NOT NULL auto_increment,
  `qgu_name` varchar(25) NOT NULL default '',
  `qgu_username` varchar(10) NOT NULL default '',
  `qgu_password` varchar(41) NOT NULL default '',
  PRIMARY KEY  (`qgu_id`),
  UNIQUE KEY `qgu_name_unq` (`qgu_name`),
  UNIQUE KEY `qgu_login_unq` (`qgu_password`,`qgu_username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
[23 May 2004 13:43] Alexander Keremidarski
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

Alex,

Can you please provide more detailed test case?
I have tried with creating your table and inserting some fake data in there, but couldn't repeat the problem.

Don't worry about your English at all :)