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

uuid() function evaluates at wrong time in query

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.2.13
    • Fix Version/s: 5.5.60, 10.0.35, 10.1.33, 10.2.15, 10.3.6
    • Component/s: OTHER
    • Labels:
    • Environment:
      Darwin crest.fritz.box 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

      Description

      The following code returns one uuid with count 10 instead of 10 uuids with count 1 for each line.

      mysql test --execute 'select count(1), uuid() as uid from seq_0_to_9 group by uid;'
      

      This seems as if the uuid function is only ever actually called once, instead of once for each element in the sequence.

      This does not happen fi you leave of the group by like this:

      mysql yeepa_test --execute 'select seq, uuid() as uid from seq_0_to_9;'
      

      To my understanding this is wrong and the sequence should return 10 uuids with a count of one each.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                dwt Martin Häcker
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: