Details
Description
The function RAND() with a string type argument is TRUE in WHERE clause, but the SELECT statements with this WHERE clause never select the first row.
/* init */ DROP TABLE IF EXISTS t; |
/* init */ CREATE TABLE t(c1 INT); |
/* init */ INSERT INTO t(c1) VALUES (3), (2), (1); |
|
mariadb> SELECT RAND('t'); |
+---------------------+ |
| RAND('t') | |
+---------------------+ |
| 0.15522042769493574 |
|
+---------------------+ |
1 row in set, 1 warning (0.00 sec) |
|
mariadb> SELECT * FROM t WHERE RAND('t'); |
+------+ |
| c1 |
|
+------+ |
| 2 |
|
| 1 |
|
+------+ |
2 rows in set, 1 warning (0.00 sec) |