Unexpected response from UPDATE statement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Spider for MySQL |
New
|
Undecided
|
Unassigned |
Bug Description
UPDATE statement's response would be different from standard MySQL when SET the same values to the matched row. The following showed the example.
===== Standard MySQL =====
mysql> select * from device where _SK_=27 and cid="f58ff20c-
*******
1 row in set (0.00 sec)
mysql> update device set score=93.617 where _SK_=27 and cid="f58ff20c-
Query OK, 0 rows affected (0.01 sec)
Rows matched: 1 Changed: 0 Warnings: 0
When updating score to the same/original value, MySQL would response 1 matched and 0 changed. However, in the mysql-spider
===== Spider MySQL =====
mysql> select * from device where _SK_=27 and cid="f58ff20c-
*******
grace_
1 row in set (0.01 sec)
mysql> update device set score=93.617 where _SK_=27 and cid="f58ff20c-
Query OK, 0 rows affected (0.01 sec)
Rows matched: 0 Changed: 0 Warnings: 0
In this case, we found that it answered 0 row matched, which is a difference from Standard MySQL.
Since some MySQL libraries would take the response to handle the error, this behavior would cause them to raise an exception because what they expected is "1 row matched".
We would be grateful if there's a way to fix this issue, or a workaround solution.
Thank for your assistance.