[MDEV-33148] A connection can control RAND() in following connection Created: 2023-12-31  Updated: 2024-01-09  Resolved: 2024-01-09

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Blocker
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

show variables like 'thread_cache_size';
--connect foo,localhost,root
set rand_seed1=0, rand_seed2=0;
create table t1 (id int auto_increment key, b double);
--disable_query_log
--let $a=30
--while ($a) {
  insert t1 (b) values (rand());
  --dec $a
}
--enable_query_log
set rand_seed1=0, rand_seed2=0;
--disconnect foo
--connect bar,localhost,root
set @a=rand();
select * from t1 where b = @a;
drop table t1;
--disconnect bar

this always prints

id      b
21      0.5129564902865854



 Comments   
Comment by Sergei Golubchik [ 2024-01-01 ]

https://github.com/MariaDB/server/commit/8b0ebe31bb7

Comment by Alexander Barkov [ 2024-01-09 ]

Ok to push

Generated at Thu Feb 08 10:36:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.