mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Bug#46815 CONCAT_WS returning wrong data
The problem is that argument buffer can be used as result buffer and it leads to argument value change. The fix is to use 'old buffer' as result buffer only if first argument is not constant item.
This commit is contained in:
@@ -2196,4 +2196,13 @@ SELECT LOAD_FILE(a) FROM t1;
|
||||
LOAD_FILE(a)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f2 VARCHAR(20));
|
||||
CREATE TABLE t2 (f2 VARCHAR(20));
|
||||
INSERT INTO t1 VALUES ('MIN'),('MAX');
|
||||
INSERT INTO t2 VALUES ('LOAD');
|
||||
SELECT CONCAT_WS('_', (SELECT t2.f2 FROM t2), t1.f2) AS concat_name FROM t1;
|
||||
concat_name
|
||||
LOAD_MIN
|
||||
LOAD_MAX
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user