1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-5414: RAND() in a subselect : different behavior in MariaDB and MySQL

Materialization forced in case if rand() used in view or derived table to avoud several calls of rand for gting value of a field.

Fixed set variable uncachable flag from - it shouldbe a side effect not a random value.
This commit is contained in:
unknown
2013-12-18 15:59:51 +02:00
parent 3ec4296ec4
commit 57400ee681
8 changed files with 261 additions and 3 deletions

View File

@ -4740,6 +4740,16 @@ i1 c1 i1 c1
deallocate prepare stmt;
drop view v1;
drop table t1,t2;
create table t1 (a int);
insert into t1 values (1),(2);
create view v1 (a,r) as select a,rand() from t1;
create table t2 select a, r as r1, r as r2, r as r3 from v1;
select a, r1 = r2, r2 = r3 from t2;
a r1 = r2 r2 = r3
1 1 1
2 1 1
drop view v1;
drop table t1,t2;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------