Bug #13842 Unable to restore a backup containing stored procedure
Submitted: 7 Oct 2005 13:58 Modified: 17 Oct 2005 12:56
Reporter: Denis Lavoie Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:v1.1.3 with MySQL 5.0.13-rc-nt OS:Windows (Windows XP)
Assigned to: Mike Lischke CPU Architecture:Any

[7 Oct 2005 13:58] Denis Lavoie
Description:
Problem:
Error occurs when I restore by backup containing Stored procedure.  Only tables and indexes are restored, the stored procedure failed to be restored.

How to repeat:
I created a simple database with one table and one stored procedure.  I make a backup of that database and tried to restore it and I got the following error message:

Warning: Do not know how to handle this statement at line 51:
CREATE PROCEDURE `PRC_ReadTest`()
BEGIN
  select * from mytesttable;
END%%
Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized.

Here is the script generated by the backup option:

-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.0.13-rc-nt

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

--
-- Create schema mytestdatabase
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ mytestdatabase;
USE mytestdatabase;

--
-- Table structure for table `mytestdatabase`.`mytesttable`
--

DROP TABLE IF EXISTS `mytesttable`;
CREATE TABLE `mytesttable` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(45) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `mytestdatabase`.`mytesttable`
--

/*!40000 ALTER TABLE `mytesttable` DISABLE KEYS */;
INSERT INTO `mytesttable` (`id`,`name`) VALUES 
 (1,'Denis Lavoie'),
 (2,'Restore problem with stored procedure!');
/*!40000 ALTER TABLE `mytesttable` ENABLE KEYS */;

--
-- Procedure `mytestdatabase`.`PRC_ReadTest`
--

DROP PROCEDURE IF EXISTS `PRC_ReadTest`;
DELIMITER %%;
CREATE PROCEDURE `PRC_ReadTest`()
BEGIN

  select * from mytesttable;

END%%
DELIMITER ;%%
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
[17 Oct 2005 12:56] Mike Lischke
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html