Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
10.3.38
Description
Short circuit evaluation in IF() statements appear not to work as expected:
https://mariadb.com/kb/en/operator-precedence/#short-circuit-evaluation
Example queries:
SET @imchanged=0; |
SELECT IF(FALSE AND (@imchanged:=1), 0, @imchanged) AS `im changed`; # output is '1', expect '0' |
 |
SET @imchanged=0; |
SELECT IF(FALSE, IF((@imchanged:=1), 1, 1), @imchanged) AS `im changed`; # output is '0', expect '0' |
Running these in any MySql version outputs are as expected.