Bug #11446 Views, stored procedures and user defined functions are not backuped
Submitted: 20 Jun 2005 7:26 Modified: 24 Jun 2005 21:28
Reporter: Jan Bouwhuis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.21 OS:Windows (Windows 2003 SP!/XP SP2)
Assigned to: CPU Architecture:Any

[20 Jun 2005 7:26] Jan Bouwhuis
Description:
When using Backup no views, SP of UDF are exported, even when the 'Complete backup' option is selected only tables and data is backuped.
See also bug 11445.

How to repeat:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ test;
USE test;
CREATE TABLE `testtable` (
  `testid` int(10) unsigned NOT NULL auto_increment,
  PRIMARY KEY  (`testid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `testtable` (`testid`) VALUES 
 (1),
 (2),
 (3),
 (4),
 (5);

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`insertid`$$
CREATE PROCEDURE `test`.`insertid`(ID INT(11))
BEGIN
  INSERT into testtable (testid) values (ID);
END$$

CREATE FUNCTION `test`.`doubleid`(ID INT(11)) RETURNS int(11)
BEGIN
  DECLARE RETID INT(11);
  SET  RETID = (SELECT (testid * 2) FROM testtable WHERE testid = ID);
  RETURN RETID;
END$$

DELIMITER ;

#############################################

Perform a backup using the Backup function.

Only the table `testtable` is backuped and the data.

Suggested fix:
Support for backup of views, SP and UDF.
[24 Jun 2005 21:28] Vladimir Kolesnikov
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