mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-29028 Queries using RANDOM_BYTES get stored in query cache
Mark the RANDOM_BYTES function as uncacheable.
This commit is contained in:
committed by
Sergei Golubchik
parent
8b9ac5bfe0
commit
a95268c5b3
@ -1834,3 +1834,35 @@ DROP TABLE t;
|
||||
--echo restore defaults
|
||||
SET GLOBAL query_cache_type= default;
|
||||
SET GLOBAL query_cache_size=@save_query_cache_size;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29028: Queries using RANDOM_BYTES get stored in query cache
|
||||
--echo #
|
||||
|
||||
set @qcache= @@global.query_cache_type;
|
||||
set global query_cache_type= 1;
|
||||
set query_cache_type= 1;
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1000);
|
||||
|
||||
flush status;
|
||||
--let $v1 = `select hex(random_bytes(a)) from t1`
|
||||
select * from information_schema.global_status where variable_name in ('Qcache_inserts','Qcache_hits') order by variable_name;
|
||||
|
||||
--let $v2 = `select hex(random_bytes(a)) from t1`
|
||||
select * from information_schema.global_status where variable_name in ('Qcache_inserts','Qcache_hits') order by variable_name;
|
||||
|
||||
if ($v1 == $v2) {
|
||||
--echo highly improbable $v1 = $v2
|
||||
}
|
||||
|
||||
select random_bytes(1024) = random_bytes(1024) as improbable;
|
||||
|
||||
# Cleanup
|
||||
drop table t1;
|
||||
set global query_cache_type= @qcache;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.10 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user