1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-28 06:45:06 +03:00
Sergey Zefirov 50d95bf60a
MCOL-5196 REPLACE function may trigger invalid capacity assertion (#2522)
When length of string to replace minus length of string to replace to is
bigger than input string and processing mode allows for binary (memcmp
or std::string::find()) comparison, REPLACE may trigger invalid capacity
assertion and query processing will stop.

The fix is to properly count the number of occurences of the string to
replace, basically.
2022-08-22 21:34:38 +03:00

16 lines
305 B
Plaintext

--disable_warnings
DROP DATABASE IF EXISTS mcol5196;
--enable_warnings
CREATE DATABASE mcol5196;
USE mcol5196;
CREATE TABLE t1 (a VARCHAR(7) CHARACTER SET latin1 COLLATE latin1_bin) ENGINE=COLUMNSTORE;
INSERT INTO t1(a) VALUES ('aa');
SELECT REPLACE(a, 'pqrs', 'a') FROM t1;
DROP DATABASE mcol5196;