Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.22, 10.0(EOL), 10.1(EOL)
-
None
-
CentOS release 6.4
Server version: 5.5.5-10.1.8-MariaDB MariaDB Server
-
10.0.24
Description
I created a small test case to reproduce the problem, which seems to be this: When I have a table with a TEXT column, and when I have a stored procedure that SELECTs that TEXT column into a local TEXT variable, the content of the field is mangled. In the example below, the LOCAL_TEXT variable should contain "quick brown fox". When I select the field into a VARCHAR(45), it retains the value exactly. This problem did not exist prior to this version of MariaDB.
-Thank you
Here is the result of invoking RunTest():
mysql> call RunTest();
|
+-----------------+-----------------+-----------------+
|
| LOCAL TEXT | LOCAL VARCHAR | A1_TEXT |
|
+-----------------+-----------------+-----------------+
|
| brown fox | quick brown fox | quick brown fox |
|
+-----------------+-----------------+-----------------+
|
1 row in set (0.04 sec)
|
|
Query OK, 0 rows affected (0.04 sec)}}
|
The test.sql code is below. Into the table, I inserted the value "quick brown fox" to column A1_TEXT.
cat test.sql
|
-- -----------------------------------------------------
|
-- Table `table1`
|
-- -----------------------------------------------------
|
CREATE TABLE IF NOT EXISTS `table1` (
|
`id` INT NOT NULL AUTO_INCREMENT,
|
`A1_TEXT` TEXT NULL,
|
PRIMARY KEY (`id`))
|
ENGINE = InnoDB;
|
|
DELIMITER $$
|
DROP PROCEDURE IF EXISTS `RunTest`;
|
CREATE PROCEDURE `RunTest`()
|
BEGIN
|
DECLARE L_A1_TEXT TEXT DEFAULT NULL;
|
DECLARE L_A1_VARC VARCHAR(45) DEFAULT NULL;
|
|
SELECT table1.A1_TEXT INTO L_A1_TEXT FROM table1 where id=1;
|
SELECT table1.A1_TEXT INTO L_A1_VARC FROM table1 where id=1;
|
|
SELECT
|
L_A1_TEXT as 'LOCAL TEXT',
|
L_A1_VARC as 'LOCAL VARCHAR',
|
table1.A1_TEXT
|
FROM table1;
|
END
|
$$
|
DELIMITER ;
|
Attachments
Issue Links
- relates to
-
MDEV-9367 ExtractValue function doesn't work in stored procedure first few times
- Closed