Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.6.2, Cheshire-Cat
-
Untriaged
-
1
-
Unknown
Description
This code is there from 4.0.0 nothing new. It might be decision made at that time. We may need to revist.
https://github.com/couchbase/query/blob/master/datastore/couchbase/couchbase.go#L1949
performOp() function returns error at the end when len == 0
Then caller sets based on the error.
What happens if we updating 10 entries and 8 succeed and 2 failed. We log error but never return error to caller.
This code needs to be revisted.
Repro during insert case:
delete from default; |
insert into default values("k001",1), values("k001",1); |
|
-- success even there is primary key violation but logged in query.log
|
_time=2021-06-08T13:58:57.717-07:00 _level=ERROR _msg=Failed to perform INSERT on key <ud>k001</ud> for Keyspace default:default._default._default. Error - <ud>Duplicate Key k001</ud> |
|
insert into default values("k001",1); -- 12009 error |
insert into default values("k001",{"a":1}), values("k003",{"a":1}) ; -- success (even though primary key violation one key) |
|
Same thing can happen for cas mismatch of UPDATE
Attachments
Issue Links
- is duplicated by
-
MB-18904 N1ql: DML Error should be thrown for all duplicate entries being inserted
- Closed
For Gerrit Dashboard: MB-46802 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
159908,4 | MB-46802. Improve mutation errors | master | n1fty | Status: MERGED | +2 | +1 |
159909,5 | MB-46802. Improve mutation errors | master | query-ee | Status: MERGED | +2 | +1 |
159910,8 | MB-46802. Improve mutation errors | master | query | Status: MERGED | +2 | +1 |
163415,6 | MB-46802 Abort non-transaction requests when the number of errors raised reaches a limit. | master | query | Status: MERGED | +2 | +1 |
163480,3 | MB-46802. transaction stop on first error | master | query | Status: MERGED | +2 | +1 |
163751,2 | MB-46802 Add error_limit request-level parameter | master | query | Status: MERGED | +2 | +1 |
163853,3 | MB-46802. Not start array with comma (not valid JSON) | master | query | Status: MERGED | +2 | +1 |
163969,2 | MB-46802 Include cause in reported delete failures | master | query | Status: MERGED | +2 | +1 |
164003,3 | MB-46802 Try to detect KEY_ENOENT / KEY_EEXISTS when wrapped in another error | master | query | Status: MERGED | +2 | +1 |