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

Check if it's Ok for Item_func_nullif to have two args[x] refer to the same Item

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.1
    • Component/s: OTHER
    • Labels:
      None

      Description

      Item_func_nullif does this trick:

        // Put "a" to args[0] for comparison and to args[2] for the returned value.
        Item_func_nullif(THD *thd, Item *a, Item *b):
          Item_func_hybrid_field_type(thd, a, b, a)  
        {}
      

      to emulate CASE WHEN a=b THEN NULL ELSE a END

      It seems to work fine, but needs theoretical proves that it's OK to do this way.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: