diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-02-19 17:45:33 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-02-19 17:45:33 +0400 |
commit | 097b6440066cb29a7a4ca769a3717ea0ebde6329 (patch) | |
tree | 790ff8fb03e5b4efb6d7de9f61876f1fa8c9791d | |
parent | 84580f950cca0bd0c7369e3e84b60d4dcfe81ba6 (diff) | |
download | mariadb-git-097b6440066cb29a7a4ca769a3717ea0ebde6329.tar.gz |
MDEV-5600: Wrong result on 2nd execution of PS depending on the length of the query
- Item_direct_view_ref didn't clear its pointer to item_equal in ::cleanup.
- Some Item_direct_view_ref objects have statement lifetime (i.e. they
survive across multiple EXECUTE commands). Item_equal objects live only for
the duration of one EXECUTE. This caused Item_direct_view_ref to have a stale pointer,
which could cause all sorts of effects. (In this bug's testcase it was pointing to
the wrong Item_equal, causing wrong query result)
- Fixed by doing what Item_field::cleanup() does - don't keep item_equal pointer value.
- There is no testcase because the only testcase I've got is highly fragile (e.g. the
bug will not show up if @@datadir is of the wrong length).
-rw-r--r-- | sql/item.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index 58abc42dd80..80f8ef966bb 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3103,6 +3103,7 @@ public: void cleanup() { null_ref_table= NULL; + item_equal= NULL; Item_direct_ref::cleanup(); } }; |