Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
UPDATE statements is not reporting the number of rows affected correctly - even though values in the table are correctly updated.
Example test of UPDATE statement
create table t2(a int, b int)engine=infinidb; |
Query OK, 0 rows affected (0.20 sec) |
|
MariaDB [test]> insert into t2 values (1, 2); |
Query OK, 1 row affected (0.07 sec) |
|
MariaDB [test]> insert into t2 values (3, 4); |
Query OK, 1 row affected (0.04 sec) |
|
MariaDB [test]> select * from t2;
|
+------+------+
|
| a | b |
|
+------+------+
|
| 1 | 2 | |
| 3 | 4 | |
+------+------+
|
2 rows in set (0.03 sec) |
|
MariaDB [test]> update t2 set a = 10; |
{color:red}Query OK, 0 rows affected (0.06 sec) |
Rows matched: 0 Changed: 0 Warnings: 0{color} |
|
MariaDB [test]> select * from t2;
|
+------+------+
|
| a | b |
|
+------+------+
|
| 10 | 2 | |
| 10 | 4 | |
+------+------+
|
2 rows in set (0.01 sec) |
As can be seen select after the UPDATE, the UPDATE statement did update the column a to 10 for 2 rows as expected, but the UPDATE reported "0 rows affected"