[MDEV-30609] Commands out of sync after OPTIMIZE on FEDERATED table Created: 2023-02-07  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Federated
Affects Version/s: 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1

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


 Description   

Notes:
On some reason, select from INFORMATION_SCHEMA.TABLE_CONSTRAINTS is important here.
have_innodb.inc is not particularly important, it's just there to avoid warnings upon select from the information schema. The failure happens regardless whether the test runs with InnoDB or not.

--source include/have_innodb.inc
 
INSTALL SONAME 'ha_federatedx';
 
eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
 
CREATE TABLE t1 (a INT);
CREATE TABLE t1_fed ENGINE=FEDERATED CONNECTION = 's/t1';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS;
CREATE TABLE t2 (a INT);
CREATE TABLE t2_fed ENGINE=FEDERATED CONNECTION = 's/t2';
OPTIMIZE TABLE t2_fed;
SELECT * FROM t2_fed;
 
# Cleanup
DROP TABLE t2_fed, t2, t1_fed, t1;
DROP SERVER s;
UNINSTALL SONAME 'ha_federatedx';

10.4 f5dceafd

OPTIMIZE TABLE t2_fed;
Table	Op	Msg_type	Msg_text
test.t2_fed	optimize	status	OK
SELECT * FROM t2_fed;
bug.t 'innodb'                           [ fail ]
        Test ended at 2023-06-17 01:23:12
 
CURRENT_TEST: bug.t
mysqltest: At line 13: query 'SELECT * FROM t2_fed' failed: 2014: Received error: 2014 : Commands out of sync; you can't run this command now

Reproducible on all existing versions, debug- and non-debug alike.
Debug builds further abort with

mysqld: /data/src/10.4/sql/sql_class.cc:1735: virtual THD::~THD(): Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed

but I assume it's just an aftermath of the problem above.


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