[MDEV-10239] Failed to discover table when using nested aggregation queries Created: 2016-06-15  Updated: 2020-12-01

Status: Confirmed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.14, 10.0, 10.1, 10.2
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Sergey Antonyuk Assignee: Olivier Bertrand
Resolution: Unresolved Votes: 0
Labels: None
Environment:

3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux



 Description   

Scenario:

Server-A:

CREATE TABLE t (pps INT UNSIGNED);
INSERT INTO t VALUES(4000000000), (4000000000);

Server-B:

CREATE TABLE d_test ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME=db OPTION_LIST='host=127.0.0.1,port=3337,user=user,password=password' SRCDEF='
SELECT SUM(pps)
FROM (SELECT SUM(pps) as pps FROM (
SELECT SUM( pps ) as pps FROM t) t
) AS S1';

Actual result:
Engine CONNECT failed to discover table db.d_test

The problem appears on the following conditions:
1) Two nested queries
2) Sum of values more than 4 bytes
3) Using aggregate functions in nested queries (SUM, AVG).



 Comments   
Comment by Elena Stepanova [ 2016-06-15 ]

Thanks for the report and the test case.

Comment by Olivier Bertrand [ 2016-06-15 ]

Apparently the cause is a too long srcdef.

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