More validation for update item

Bug #1418920 reported by Ajaya Agrawal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
New
Undecided
Unassigned

Bug Description

The schema looks like:
https://gist.github.com/anonymous/985b2c74f86d3544bd3b
The put request looks like:
https://gist.github.com/anonymous/ebd248f016fb1fa2bc04

We don't allow to modify primary key fields in a update item. So ideally the primary key fields should not be allowed at all in 'attribute_updates' field. Even if they are allowed there should be a check whether they are the same as the values in 'key' field. I would call it a logic bug also the reason of which is clear from the second query run by C*. Had there been a row with key as (b,1), it would be modified instead of the key queried for.

The first C* query run is:
SELECT * FROM "u_default_tenant"."u_fc38f99aad3911e4b9a49cd21e20b135" WHERE "u_Author"='a' AND "u_MessageId"='1'

The second C* query run is:

UPDATE "u_default_tenant"."u_fc38f99aad3911e4b9a49cd21e20b135" SET "u_Subject"='Vacation2',dyn_attr_dat=dyn_attr_dat{'aj':0x22626a22},dyn_attr_typ=dyn_attr_typ+{'aj':'S'},attr_exist=attr_exist+{'Author':1,'aj':1,'Subject':1,'MessageId':1} WHERE "u_Author"='b' AND "u_MessageId"='1' IF "u_Body"='Some vacation
issues' AND dyn_attr_dat['aj']=0x22626a22 AND dyn_attr_dat['name']=0x22616a22 AND "u_Subject"='Vacation2' AND "u_DateTime"=20140313164951", cons
istency=QUORUM

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.