[MDEV-6954] SET STATEMENT rand_seedX = ...FOR ... makes the next rand() to return 0 Created: 2014-10-27  Updated: 2015-03-16  Resolved: 2015-03-14

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: 10.1.3
Fix Version/s: 10.1.4

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 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



 Comments   
Comment by Oleksandr Byelkin [ 2014-10-29 ]

The variable is prohibited in SET STATEMENT for now.

Comment by Oleksandr Byelkin [ 2014-10-30 ]

variables can be turned to usual ones

Comment by Oleksandr Byelkin [ 2015-03-11 ]

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

Comment by Oleksandr Byelkin [ 2015-03-11 ]

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.

Comment by Oleksandr Byelkin [ 2015-03-13 ]

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.

Comment by Sergei Golubchik [ 2015-03-14 ]

ok to push

Generated at Thu Feb 08 07:15:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.