1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-33942 View cuts off the end of string with the utf8 character set in INSERT function

Item_func_insert::fix_length_and_dec() incorrectly calculated max_length
when its collation.collation evaluated to my_charset_bin.

Fixing the code to calculate max_length in terms of octets rather
than in terms of characters when collation.collation is my_charset_bin.
This commit is contained in:
Alexander Barkov
2024-11-05 11:16:10 +04:00
parent c2bf1d4781
commit eb41c1171e
3 changed files with 27 additions and 2 deletions

View File

@@ -2393,6 +2393,16 @@ create view v1 as select left('hello', 4294967295);
select * from v1;
drop view v1;
--echo #
--echo # MDEV-33942 View cuts off the end of string with the utf8 character set in INSERT function
--echo #
SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
CREATE VIEW v1 AS SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
SELECT * FROM v1;
DROP VIEW v1;
--echo #
--echo # End of 10.6 tests
--echo #