Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.5.12
-
OS: Ubuntu-20.04
Description
/* init */ create table t(a int); |
/* init */ insert into t values (0), (1), (2); |
|
mariadb> select * from t where rand('test'); |
+------+ |
| a |
|
+------+ |
| 1 |
|
| 2 |
|
+------+ |
2 rows in set, 1 warning (0.01 sec) |
|
mariadb> update t set a = + 1 where rand('test'); |
ERROR 1292 (22007): Truncated incorrect INTEGER value: 'test' |
The function RAND() with a string type argument has different meanings in SELECT and UPDATE statements, which can cause inconsistent problems.