1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

when printing Item_in_optimizer, use precedence of wrapped Item

when Item::print() is called with the QT_PARSABLE flag, WHERE i NOT IN
(SELECT ...) gets printed as WHERE !i IN (SELECT ...) instead of WHERE
!(i in (SELECT ...)) because Item_in_optimizer returns DEFAULT_PRECEDENCE.
it should return the precedence of the inner operation.
This commit is contained in:
Sidney Cammeresi
2020-06-12 10:23:46 -07:00
parent ab9bd6284c
commit 114a843669
5 changed files with 11 additions and 10 deletions

View File

@@ -396,6 +396,7 @@ public:
{ return args[1]; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_in_optimizer>(thd, this); }
enum precedence precedence() const { return args[1]->precedence(); }
};