From 6c7e3e5c13162b7ffa90eaa81b4ba5afaf3e0c1e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 29 Jul 2022 10:24:45 +0200 Subject: bugfix: RAND is VCOL_SESSION_FUNC it's not "non deterministic", it's completely defined by @@rand_seed1 and @@rand_seed2. And as a session func it needs to be re-fixed at the beginning of every statement. --- mysql-test/suite/vcol/r/vcol_misc.result | 16 ++++++++++++++++ mysql-test/suite/vcol/t/vcol_misc.test | 13 +++++++++++++ 2 files changed, 29 insertions(+) (limited to 'mysql-test/suite/vcol') diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index b9812bf2c4a..155d647aa0f 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -533,3 +533,19 @@ drop table t1; # # End of 10.2 tests # +# +# RAND is session func +# +create table t1 (a int, b float default rand(1)); +insert into t1 (a) values (1); +insert into t1 (a) values (2); +insert into t1 (a) values (3); +select * from t1; +a b +1 0.405404 +2 0.405404 +3 0.405404 +drop table t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index e5609003806..e693738d5c7 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -506,3 +506,16 @@ drop table t1; --echo # End of 10.2 tests --echo # +--echo # +--echo # RAND is session func +--echo # +create table t1 (a int, b float default rand(1)); +insert into t1 (a) values (1); +insert into t1 (a) values (2); +insert into t1 (a) values (3); +select * from t1; +drop table t1; + +--echo # +--echo # End of 10.3 tests +--echo # -- cgit v1.2.1