revision-id: 1748b24f5d42b254cb36fe3eac573473eea72e97 (mariadb-10.4.4-753-g1748b24f5d4) parent(s): 4c61c9b39a75a815a14c9d8cd39782db8c4dc699 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-10 01:25:40 +0300 message: Fix federated.federatedx_create_handler with --ps-protocol, for CLX-77 CLX-77 code used "thd->lex->result!=NULL" to check if the SELECT has an INTO part. This is not correct, as the condition also holds when we're using the PS protocol. Use a more generic check: check whether the SELECT has any side effect. --- storage/federatedx/federatedx_pushdown.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/storage/federatedx/federatedx_pushdown.cc b/storage/federatedx/federatedx_pushdown.cc index 4e99a56a62f..1b19da48e06 100644 --- a/storage/federatedx/federatedx_pushdown.cc +++ b/storage/federatedx/federatedx_pushdown.cc @@ -185,10 +185,11 @@ create_federatedx_select_handler(THD* thd, SELECT_LEX *sel) /* Currently, ha_federatedx_select_handler::init_scan just takes the thd->query and sends it to the backend. - This obviously won't work if the SELECT has an INTO part. - Refuse to work in this case. + This obviously won't work if the SELECT uses an "INTO @var" or + "INTO OUTFILE". It is also unlikely to work if the select has some + other kind of side effect. */ - if (thd->lex->result) + if (sel->uncacheable & UNCACHEABLE_SIDEEFFECT) return NULL; handler= new ha_federatedx_select_handler(thd, sel);