1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

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.
This commit is contained in:
Sergey Zefirov
2022-08-22 21:34:38 +03:00
committed by GitHub
parent bbb3c69e31
commit 50d95bf60a
3 changed files with 34 additions and 7 deletions

View File

@ -0,0 +1,15 @@
--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;