Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.1.67, 5.2.14, 5.3.12, 5.5(EOL), 10.0(EOL)
-
Linux Fedora 21
-
10.1.11, 10.1.12
Description
Demonstration: |
SELECT |
(SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.`ROUTINES` IR WHERE IR.ROUTINE_SCHEMA = 'BPLNew' AND IR.`SPECIFIC_NAME` = 'get_dict_source') |
=
|
(SELECT body FROM `mysql`.`proc` mp WHERE mp.db='BPLnew' AND mp.`name` = 'get_dict_source') compare |
compare
|
---------
|
0
|
As you can see on the screenshot comparison only difference is the amount of shielding quotes.
Why?
Yet another example:
Example: |
SHOW CREATE PROCEDURE test |
|
DELIMITER $$
|
|
CREATE PROCEDURE `test`( |
)
|
BEGIN
|
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2); |
END$$ |
|
DELIMITER ;
|
Information schema: |
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.`ROUTINES` IR WHERE IR.ROUTINE_SCHEMA = 'test' AND IR.`SPECIFIC_NAME` = 'test' |
ROUTINE_DEFINITION
|
---------------------------------------------------------------
|
BEGIN
|
select concat('ABC = '',1,'''), CONCAT('ABC = ',2);
|
END
|
mysql: |
SELECT body FROM `mysql`.`proc` mp WHERE mp.db='test' AND mp.`name` = 'test' |
body
|
-----------------------------------------------------------------
|
BEGIN
|
select concat('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
END
|
Thanks for the report.
It's an upstream issue http://bugs.mysql.com/bug.php?id=58342 (still reproducible on MySQL 5.1 - 5.7).