[MDEV-25823] Federated table with certain charset causes unexpected errors for unrelated queries Created: 2021-05-30  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Character Sets, Storage Engine - Federated
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-25824 Federated table with unavailable remo... Open

 Description   

A federated table can be created with a charset which isn't allowed to be set as client character set, such as ucs2.
However, when such table exists, further queries fail in an unexpected session – and not only queries involving the table itself, but also seemingly unrelated ones.

--source include/have_innodb.inc
 
create table t1 (a int);
install soname 'ha_federatedx';
create database fed;
--eval create table fed.t2 (a int) charset ucs2 engine=federated connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1'
select * from information_schema.referential_constraints;

On 10.3-10.6 the query from information_schema fails with ER_WRONG_VALUE_FOR_VAR:

10.3 1e5ebf37

query 'select * from information_schema.referential_constraints' failed: 1231: Received error: 1231 : Variable 'character_set_client' can't be set to the value of 'ucs2'

On 10.2 it doesn't fail, but causes an even weirder ER_SQL_DISCOVER_ERROR warning:

10.2 d06205ba

CONSTRAINT_CATALOG	CONSTRAINT_SCHEMA	CONSTRAINT_NAME	UNIQUE_CONSTRAINT_CATALOG	UNIQUE_CONSTRAINT_SCHEMA	UNIQUE_CONSTRAINT_NAME	MATCH_OPTION	UPDATE_RULE	DELETE_RULE	TABLE_NAME	REFERENCED_TABLE_NAME
Warnings:
Warning	1939	Engine PERFORMANCE_SCHEMA failed to discover table `performance_schema`.`accounts` with 'CREATE TABLE accounts(USER CHAR(128) collate utf8_bin default null,HOST CHAR(60) collate utf8_bin default null,CURRENT_CONNECTIONS bigint not null,TOTAL_CONNECTIONS bigint not null)'


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