mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix QUOTE() to not reuse the input field for output, which resulted in
incorrect results when the input was a constant across a multi-row SELECT statement. (Bug #8248) sql/item_strfunc.h: Add tmp_value member sql/item_strfunc.cc: Always allocate a new string for QUOTE(), in case the field is being reused for multiple rows. mysql-test/t/func_str.test: Add regression test mysql-test/r/func_str.result: Add test results
This commit is contained in:
@ -193,3 +193,8 @@ select trim(leading 'foo' from 'foo');
|
||||
|
||||
select quote(ltrim(concat(' ', 'a')));
|
||||
select quote(trim(concat(' ', 'a')));
|
||||
|
||||
# Bad results from QUOTE(). Bug #8248
|
||||
CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3;
|
||||
SELECT QUOTE('A') FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user