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
|
Attachments
Issue Links
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | screenshot-1.png [ 36323 ] |
Description |
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? |
{code:sql|title=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 {code} {noformat} compare --------- 0 {noformat} As you can see on the screenshot comparison only difference is the amount of shielding quotes. Why? |
Description |
{code:sql|title=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 {code} {noformat} compare --------- 0 {noformat} As you can see on the screenshot comparison only difference is the amount of shielding quotes. Why? |
{code:sql|title=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 {code} {noformat} compare --------- 0 {noformat} As you can see on the screenshot comparison only difference is the amount of shielding quotes. Why? Yet another example: {code:sql|title=Example:} SHOW CREATE PROCEDURE test DELIMITER $$ CREATE PROCEDURE `test`( ) BEGIN SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2); END$$ DELIMITER ; {code} {code:sql|title=Information schema:} SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.`ROUTINES` IR WHERE IR.ROUTINE_SCHEMA = 'test' AND IR.`SPECIFIC_NAME` = 'test' {code} {noformat} ROUTINE_DEFINITION --------------------------------------------------------------- BEGIN select concat('ABC = '',1,'''), CONCAT('ABC = ',2); END {noformat} {code:sql|title=mysql:} SELECT body FROM `mysql`.`proc` mp WHERE mp.db='test' AND mp.`name` = 'test' {code} {noformat} body ----------------------------------------------------------------- BEGIN select concat('ABC = ''',1,''''), CONCAT('ABC = ',2); END {noformat} |
Summary | Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body. | Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used . |
Summary | Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used . | Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. |
Affects Version/s | 10.0.15 [ 17300 ] | |
Affects Version/s | 10.0.14 [ 17101 ] |
Fix Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 5.3.12 [ 12000 ] | |
Affects Version/s | 5.2.14 [ 12101 ] | |
Affects Version/s | 5.1.67 [ 12100 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 5.5 [ 15800 ] | |
Affects Version/s | 10.0.15 [ 17300 ] | |
Labels | procedure quotes | procedure quotes upstream |
Priority | Major [ 3 ] | Minor [ 4 ] |
Remote Link | This issue links to "Bug #58342 - ROUTINES.ROUTINE_DEFINITION removes double quotes (Web Link)" [ 21605 ] |
Labels | procedure quotes upstream | procedure quotes triggers upstream |
Priority | Minor [ 4 ] | Major [ 3 ] |
Assignee | Jan Lindström [ jplindst ] |
Assignee | Jan Lindström [ jplindst ] | Alexander Barkov [ bar ] |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.0 [ 16000 ] |
Workflow | MariaDB v2 [ 58753 ] | MariaDB v3 [ 65549 ] |
Sprint | 10.1.11 [ 30 ] |
Rank | Ranked lower |
Sprint | 10.1.11 [ 30 ] | 10.1.11, 10.1.12 [ 30, 36 ] |
Rank | Ranked lower |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Alexander Barkov [ bar ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Golubchik [ serg ] | Alexander Barkov [ bar ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.1.12 [ 21502 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 65549 ] | MariaDB v4 [ 148564 ] |
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).