Federated table returns error 1430 from storage engine
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Fix Released
|
High
|
Zsolt Parragi | |||
5.6 |
Fix Released
|
High
|
Zsolt Parragi | |||
5.7 |
Fix Released
|
High
|
Zsolt Parragi |
Bug Description
This is a bug introduced in 5.6.38-83.0. It was not there in 5.6.37-82.2. It seems to be percona specific (not mysql) and probably related to this commit:
https:/
which changes
storage/
The cases in this switch were probably designed as conditionally fall-through on purpose - this change breaks this behaviour and leads to a wrong SQL query built to access the remote server.
Test case:
-- use this server as remote and local server for test-case
-- bug behaviour is the same with 'real' remote server
DROP SERVER IF EXISTS local_server;
CREATE SERVER local_server
FOREIGN DATA WRAPPER mysql
OPTIONS (
HOST '127.0.0.1',
PORT 3306,
USER 'USER',
PASSWORD 'PASS',
DATABASE 'test'
);
-- create sample table
DROP TABLE IF EXISTS test.remote_table;
CREATE TABLE test.remote_table (
a INT,
b INT,
KEY ab (a,b),
KEY ba (b,a)
);
-- create federated table pointing to table above
DROP TABLE IF EXISTS test.local_table;
CREATE TABLE test.local_table (
a INT,
b INT,
KEY ab (a,b),
KEY ba (b,a)
) ENGINE=federated CONNECTION=
-- ok
SELECT * FROM test.local_table;
-- ok
SELECT * FROM test.local_table USE INDEX (ab)
WHERE a<1 AND b=0;
-- returns: Error Code: 1030. Got error 1430 from storage engine
SELECT * FROM test.local_table USE INDEX (ba)
WHERE a<1 AND b=0;
tags: | added: regression |
https:/ /github. com/percona/ percona- server/ pull/2039 /github. com/percona/ percona- server/ pull/2038 /github. com/percona/ percona- server/ pull/2033
https:/
https:/