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

SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.1.3
    • Fix Version/s: 10.1.4
    • Component/s: Admin statements
    • Labels:
      None

      Description

      Values of rand_seed1 and rand_seed2 can be set, but cannot be seen – server always shows fake zeros for them.
      However, after executing SET STATEMENT rand_seed..., the values are set to actual zeros, and the next rand() returns 0. It should not happen.

      MariaDB [test]> set statement rand_seed1=1, rand_seed2=1 for select 1;
      +---+
      | 1 |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
      
      MariaDB [test]> select rand();
      +--------+
      | rand() |
      +--------+
      |      0 |
      +--------+
      1 row in set (0.00 sec)
      

      I don't see this problem in Percona.

      commit e64f5d8f758bcc1a8856ba9fba01780533f80747
      Author: Oleksandr Byelkin <sanja@mariadb.com>
      Date:   Sun Oct 26 16:27:54 2014 +0100
      
          Fixed test suite global variable saving
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment -

              The variable is prohibited in SET STATEMENT for now.

              Show
              sanja Oleksandr Byelkin added a comment - The variable is prohibited in SET STATEMENT for now.
              Hide
              sanja Oleksandr Byelkin added a comment -

              variables can be turned to usual ones

              Show
              sanja Oleksandr Byelkin added a comment - variables can be turned to usual ones
              Hide
              sanja Oleksandr Byelkin added a comment -

              They can not to be turned to usual variables because they do not have default value, but its value could be fetched.

              Show
              sanja Oleksandr Byelkin added a comment - They can not to be turned to usual variables because they do not have default value, but its value could be fetched.
              Hide
              sanja Oleksandr Byelkin added a comment -

              revision-id: 7ceff99ff25b74bb188848ce0e5f9e2f1ddac3d0
              parent(s): 9f4ee16bf351ea2969d73abcdea92e70538c723c
              committer: Oleksandr Byelkin
              branch nick: server
              timestamp: 2015-03-11 11:02:13 +0100
              message:

              MDEV-6954: SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0

              The variables now return real values. They can't be made usual variables because they do not have DEFAULT value.

              Show
              sanja Oleksandr Byelkin added a comment - revision-id: 7ceff99ff25b74bb188848ce0e5f9e2f1ddac3d0 parent(s): 9f4ee16bf351ea2969d73abcdea92e70538c723c committer: Oleksandr Byelkin branch nick: server timestamp: 2015-03-11 11:02:13 +0100 message: MDEV-6954 : SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0 The variables now return real values. They can't be made usual variables because they do not have DEFAULT value.
              Hide
              sanja Oleksandr Byelkin added a comment -

              revision-id: 21eea36bfdc30447fb2f8607d53aba5df1082834
              parent(s): 9f4ee16bf351ea2969d73abcdea92e70538c723c
              committer: Oleksandr Byelkin
              branch nick: server
              timestamp: 2015-03-13 17:09:14 +0100
              message:

              MDEV-6954: SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0

              The variables now return real values. They can't be made usual variables because they do not have DEFAULT value.

              Show
              sanja Oleksandr Byelkin added a comment - revision-id: 21eea36bfdc30447fb2f8607d53aba5df1082834 parent(s): 9f4ee16bf351ea2969d73abcdea92e70538c723c committer: Oleksandr Byelkin branch nick: server timestamp: 2015-03-13 17:09:14 +0100 message: MDEV-6954 : SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0 The variables now return real values. They can't be made usual variables because they do not have DEFAULT value.
              Hide
              serg Sergei Golubchik added a comment -

              ok to push

              Show
              serg Sergei Golubchik added a comment - ok to push

                People

                • Assignee:
                  sanja Oleksandr Byelkin
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: