Comments - SET

2 years ago Dean Trower

The documentation should specify whether evaluation order can be relied on or not. Are SET statements always evaluated left-to-right? i.e.

SET @a:=0, @b:=0;
SET @a:=1, @b:=2, @c:=@a+@b;

After execution, is @c guaranteed to be 3, or might it be 0, 1, or 2?

(It's well-documented that in a SELECT, order of evalution is NOT well defined, so if the 2nd SET were a SELECT instead, all values from 0 to 3 might be possible. But this needs to be documented for SET also, as it's a different statement with possibly different semantics!)

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.