Skip to content

Commit c059cbc

Browse files
committed
executeStatement() returns:
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.
1 parent 4e7c8be commit c059cbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Domain/Search/LastSearches/LastSearchesRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function update(array $lastSearchesRow): void
139139
->set('keywords', $lastSearchesRow['keywords'])
140140
->executeStatement();
141141

142-
if ($affectedRows < 1) {
142+
if ($affectedRows === false) {
143143
throw new InvalidArgumentException(vsprintf('By trying to update last searches row with values "%s" nothing was updated, make sure the given "sequence_id" exists in database.', [json_encode($lastSearchesRow)]), 1502717923);
144144
}
145145
}

0 commit comments

Comments
 (0)