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
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
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}} |
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}} |
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}} |
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 {color:#707070} {code:java} 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')); {code} {color} Stored procedure: {color:#707070} {code:java} 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 ; {code} {color} Calling procedure: {color:#707070} {code:java} CALL procC(); {code} {color} Expected result: {code:java} messageA, messageB {code} Result: {code:java} messageB, messageB {code} |
Component/s | Data Definition - Procedure [ 10119 ] | |
Component/s | Scripts & Clients [ 11002 ] |
Fix Version/s | 5.5.48 [ 21000 ] | |
Labels | assignment blob mediumblob subroutine variable | assignment blob mediumblob subroutine upstream variable |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 75953 ] | MariaDB v4 [ 150505 ] |