[MDEV-29601] View in view protocol uses incorrect character set with util connection Created: 2022-09-22  Updated: 2023-09-25  Resolved: 2023-09-25

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.6.16

Type: Bug Priority: Critical
Reporter: Lena Startseva Assignee: Oleksandr Byelkin
Resolution: Won't Fix Votes: 0
Labels: view-protocol

Issue Links:
PartOf
is part of MDEV-27691 make working view-protocol Open

 Description   

Start from 10.6 in view protocol it is used incorrect character set with util connection.

Test:

CREATE TABLE BUG_12595(a varchar(100));
INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '';
drop table BUG_12595;

Expected result:

a

Actual result:

a
hakan%

mysqltest_tmp_v.frm before 10.6 (and with --disable_service_connection)

TYPE=VIEW
query=select `test`.`BUG_12595`.`a` AS `a` from `test`.`BUG_12595` where `test`.`BUG_12595`.`a` like \'hakan\\\\%\' escape \'\'
md5=795ea511c105046a1e37b98c01816f16
updatable=1
algorithm=0
definer_user=root
definer_host=localhost
suid=2
with_check_option=0
timestamp=2022-09-22 05:22:03
create-version=2
source=SELECT * FROM BUG_12595 WHERE a LIKE \'hakan\\%\' ESCAPE \'\'
client_cs_name=latin1
connection_cl_name=latin1_swedish_ci
view_body_utf8=select `test`.`BUG_12595`.`a` AS `a` from `test`.`BUG_12595` where `test`.`BUG_12595`.`a` like \'hakan\\\\%\' escape \'\'
mariadb-version=100427

mysqltest_tmp_v.frm start form 10.6:

TYPE=VIEW
query=select `test`.`BUG_12595`.`a` AS `a` from `test`.`BUG_12595` where `test`.`BUG_12595`.`a` like \'hakan\\\\%\' escape \'\'
md5=795ea511c105046a1e37b98c01816f16
updatable=1
algorithm=0
definer_user=root
definer_host=localhost
suid=2
with_check_option=0
timestamp=2022-11-30 05:35:19
create-version=2
source=SELECT * FROM BUG_12595 WHERE a LIKE \'hakan\\%\' ESCAPE \'\'
client_cs_name=utf8mb4
connection_cl_name=utf8mb4_general_ci
view_body_utf8=select `test`.`BUG_12595`.`a` AS `a` from `test`.`BUG_12595` where `test`.`BUG_12595`.`a` like \'hakan\\\\%\' escape \'\'
mariadb-version=100611



 Comments   
Comment by Oleksandr Byelkin [ 2022-11-29 ]

new frm missing in the description

Comment by Lena Startseva [ 2022-11-30 ]

Added missing frm

Comment by Oleksandr Byelkin [ 2023-09-25 ]

IMHO we can not replicate character change in both connection IMHO it will be easier to prohibit service connection or view protocol if first impossible

Generated at Thu Feb 08 10:09:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.