diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2020-03-10 01:25:40 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2020-03-10 11:22:33 +0300 |
commit | 3fcb770f1c0be6e89644583494990baffeedcba9 (patch) | |
tree | 40c66951c91e6b81f53df4ea78072507f29c71bf | |
parent | d414f8a9824262212ab5a0416da816f6377179ea (diff) | |
download | mariadb-git-3fcb770f1c0be6e89644583494990baffeedcba9.tar.gz |
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.
-rw-r--r-- | storage/federatedx/federatedx_pushdown.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/federatedx/federatedx_pushdown.cc b/storage/federatedx/federatedx_pushdown.cc index acd90e95b1c..baaf8245aea 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; /* |