Fix for MySQL bug #77448 Inconsistent handling of RAND() in WHERE and HAVING
Fix for MySQL bug #77448 Inconsistent handling of RAND() in WHERE and HAVING

Problem was that for queries of type:

select rand() r, rand()  p, rand() = rand() from a having r = p

The optimizer thought that r = p was same as rand() = rand() and this would always be true.

The problem was that when testing if two expressions are equal, we didn't take into account no determinstic functions.

The fix is to not compare non deterministic functions as equal.

flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,davidl-zend/zenddbi,davidl-zend/zenddbi,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,ollie314/server,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,ollie314/server,ollie314/server,flynn1973/mariadb-aix,flynn1973/mariadb-aix,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,ollie314/server,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix