mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN
MYSQLDUMP OUTPUT Problem: mysqldump when used with option --routines, dumps all the routines of the specified database into output. The statements in this output are written in such a way that they are version safe using C style version commenting (of the format /*!<version num> <sql statement>*/). If a semicolon is present right before closing of the comment in dump output, it results in a syntax error while importing. Solution: Version comments for dumped routines are specifically to protect the ones older than 5.0. When the import is done on 5.0 or later versions, entire create statement gets executed as all the check conditions at the beginning of the comments are cleared. Since the trade off is between the performance of newer versions which are more in use and protection of very old versions which are no longer supported, it is proposed that these comments be removed altogether to maintain stability of the versions supported.
This commit is contained in:
@ -2706,8 +2706,8 @@ UNLOCK TABLES;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = '' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
|
||||
RETURN a+b */;;
|
||||
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
|
||||
RETURN a+b ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
@ -2723,11 +2723,11 @@ DELIMITER ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = '' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1
|
||||
CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1
|
||||
begin
|
||||
set f1= concat( 'hello', f1 );
|
||||
return f1;
|
||||
end */;;
|
||||
end ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
@ -2743,8 +2743,8 @@ DELIMITER ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER="root"@"localhost"*/ /*!50003 PROCEDURE "a'b"()
|
||||
select 1 */;;
|
||||
CREATE DEFINER="root"@"localhost" PROCEDURE "a'b"()
|
||||
select 1 ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
@ -2760,8 +2760,8 @@ DELIMITER ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = '' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
|
||||
BEGIN SELECT a+b INTO c; end */;;
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
|
||||
BEGIN SELECT a+b INTO c; end ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
@ -2777,10 +2777,10 @@ DELIMITER ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = '' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc2`(OUT a INT)
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc2`(OUT a INT)
|
||||
BEGIN
|
||||
select sum(id) from t1 into a;
|
||||
END */;;
|
||||
END ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
@ -3766,8 +3766,8 @@ create procedure mysqldump_test_db.sp1() select 'hello';
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = '' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`()
|
||||
select 'hello' */;;
|
||||
CREATE DEFINER=`user1`@`%` PROCEDURE `sp1`()
|
||||
select 'hello' ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
|
Reference in New Issue
Block a user