[BUGFIX] Use the return value of the UPDATE statement correctly in the LastSearchesRepository::update method#4501
[BUGFIX] Use the return value of the UPDATE statement correctly in the LastSearchesRepository::update method#4501RZivaralam wants to merge 2 commits into
LastSearchesRepository::update method#4501Conversation
LastSearchesRepository::update method
|
You can also reproduce this issue quite easily. Try searching for the same term multiple times in quick succession With concurrent or very fast repeated searches, the UPDATE may legitimately This demonstrates that the issue is not theoretical, but can be reproduced Thanks for taking the time to look into this. |
false → SQL execution failed (real error) 0 → UPDATE executed successfully, but no data changed 0 → UPDATE executed and changed data To Reproduce This confirms that the exception is triggered in valid and expected situations, for example when: multiple users perform the same search query at nearly the same time, or the same search term is executed repeatedly within the same second.
…oncurrent searches will continue to trigger unnecessary exceptions.
|
@RZivaralam |
0c90549 to
365cf5c
Compare
|
To reproduce the issue:
So the problem is not that In my opinion, this additional exception is not necessary. If the column So the check should either be removed or changed, because affectedRows < 1 here does not necessarily mean that the column is missing. |





To Reproduce
This confirms that the exception is triggered in valid and expected situations, for example when:
multiple users perform the same search query at nearly the same time, or
the same search term is executed repeatedly within the same second.
In these cases:
the UPDATE statement does find the row (correct sequence_id)
but writes identical values (keywords and second-based tstamp)
MySQL / MariaDB correctly returns affectedRows = 0
the current logic incorrectly interprets this as “row not found”