1#
2# MDEV-5539 Empty results in UNION with Sphinx engine
3#
4--replace_result $SPHINXSEARCH_PORT PORT
5eval create table ts (id bigint unsigned not null, w int not null, query varchar(255) not null, index(query)) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*";
6let $q1=SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500';
7let $q2=SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500';
8eval SELECT a.* FROM ($q1) AS a UNION SELECT b.* FROM ($q2) AS b;
9eval SELECT a.* FROM ($q2) AS a UNION SELECT b.* FROM ($q1) AS b;
10drop table ts;
11
12