revision-id: 219d7f769634b007953b4d16c9d484adfd7abd6e (mariadb-10.5.0-242-g219d7f76963) parent(s): 826a38adb2be5ffce8f15d71ce8995046eb8f3db author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-04 12:58:06 +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);