Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.47-galera
-
Centos 7
Description
Using SELECT INTO local routine variable, value is assigned to two distinct variables.
Test cast to reproduce issue;
Two tables with one row with different values
CREATE TABLE `test`.`A`(
|
`idA` BIGINT NOT NULL AUTO_INCREMENT,
|
`messageA` MEDIUMBLOB,
|
PRIMARY KEY (`idA`)
|
);
|
|
CREATE TABLE `test`.`B`(
|
`idB` BIGINT NOT NULL AUTO_INCREMENT,
|
`messageB` MEDIUMBLOB,
|
PRIMARY KEY (`idB`)
|
);
|
|
INSERT INTO A(messageA) VALUES (COMPRESS('messageA')); |
INSERT INTO B(messageB) VALUES (COMPRESS('messageB')); |
|
Stored procedure:
DELIMITER $$
|
|
CREATE PROCEDURE `procC`()
|
BEGIN
|
DECLARE pA MEDIUMBLOB;
|
DECLARE pB MEDIUMBLOB;
|
|
SElect messageA
|
into pA
|
FROM A;
|
|
SELECT messageB
|
into pB
|
from B;
|
|
select UNCOMPRESS(pA), UNCOMPRESS(pB);
|
END$$
|
|
DELIMITER ;
|
|
Calling procedure:
CALL procC();
|
|
Expected result:
messageA, messageB
|
Result:
messageB, messageB
|