Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-18383

Change of behaviour of OR in IF-conditions 10.2 -> 10.3

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.4, 10.3.11
    • Fix Version/s: 10.2.23
    • Component/s: Optimizer
    • Labels:
    • Environment:
      Windows 10, Windows Server 2008

      Description

      The behavior of the OR operator in the IF condition has changed from MariaDB 10.2 to 10.3.
      now I noticed that the following syntax doesn't work in SELECT statements anymore:

      SELECT * FROM tab t WHERE IF(@a = 1, t.a = 1 OR t.b = 1,1=1)
      

      Now I'd have to write:

      SELECT * FROM tab t WHERE (IF(@a = 1, t.a = 1, 1=1) OR IF(@a = 1, t.b = 1, 1=1))
      

      Is it a bug or a deliberate change? Is there a setting with which I can reactivate the previous behavior?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shagalla Galina Shalygina
                Reporter:
                FriedemannS Friedemann Schmidt
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: