WL#3415: implement consistent semantics for assigning and using user variables in same statement
Affects: WorkLog-3.4 — Status: Un-Assigned — Priority: High
A statement like the following has undefined meaning: select @a, @a := @a + count(*) from t group by f; The results depend entirely on how the optimizer works, etc. See BUG#1739 and BUG#19792 for full examples. The suggested feature is to define a certain behavior for queries like this, which assign to and use the same variable in a single statement. And then implement that behavior. This is not trivial, as it may constrain how the optimizer works in some cases, etc. Note that Sergei wrote on 29 Jul 2006: > Iggy's patch relies on left-to-right evaluation order. Once I also tried > to fix a similar bug with a similar fix (playing with > Item_func_get_user_var::const_item()) and found that fixing some queries > breaks others, because of the above. > > Since then, I generally set those bugs to "Won't fix". The idea of this WL entry is to fix those "bugs" in a satisfying way.
Copyright (c) 2000, 2018, Oracle Corporation and/or its affiliates. All rights reserved.