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