[ https://issues.apache.org/jira/browse/CASSANDRA-15189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeff Jirsa updated CASSANDRA-15189: ----------------------------------- Resolution: Not A Problem Status: Resolved (was: Triage Needed) This is normal and expected Insert and update are effectively the same thing in cassandra. Since two hosts may be fully disconnected and not know what already exists in the database, there’s not even at attempt to see if the row already exists unless you use {{IF NOT EXISTS}} on the query, which makes it use the lightweight transaction code path, using paxos internally to only conditionally accept the write. > Cassandra3.11.3, an "insert same primary keys" doesn't report a error but > work as update. > ------------------------------------------------------------------------------------------ > > Key: CASSANDRA-15189 > URL: https://issues.apache.org/jira/browse/CASSANDRA-15189 > Project: Cassandra > Issue Type: Bug > Reporter: gloCalHelp.com > Priority: Normal > > Cassandra3.11.3, an "insert same primary keys" doesn't report a error but > work as update. > At the below, the 1st "-e", insert a row. > the 2nd "-e" also insert a row with only the last column's value being > changed to 375, > The 2nd sql successfully executed as a update, checked by the 3rd "-e" > bash-4.1$ bin/cqlsh hadoop6 -u dba -p *** --debug -e "INSERT INTO > HYGL_JCSJ.hyjg_ods_yy_gps_novar3 > (clcph,dwsj,bc,blbs,cjbzh,ckryid,clid,clmc,ddfx,ddrq,fwj,gd,gdjd,gdwd,jsdlc,jszjl,jxzjl,sjid,sjsfzh,sjxm,sssd,xlmc) > VALUES ('黑A00888D','2019-06-25 > 09:57:19',0,-20,'',-20,-20,'379-7038',1434,'2019-06-25',275,0,126723690,45726990 > ,796.0,2205,746,'null','null','null',0,'379');" > > Using CQL driver: <module 'cassandra' from > '/home/cassandra/cas3.11.3/bin/../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/__init__.py'> > > Using connect timeout: 5 seconds > > Using 'utf-8' encoding > > Using ssl: False > > bash-4.1$ bin/cqlsh hadoop6 -u dba -p *** --debug -e "INSERT INTO > HYGL_JCSJ.hyjg_ods_yy_gps_novar3 > (clcph,dwsj,bc,blbs,cjbzh,ckryid,clid,clmc,ddfx,ddrq,fwj,gd,gdjd,gdwd,jsdlc,jszjl,jxzjl,sjid,sjsfzh,sjxm,sssd,xlmc) > VALUES ('黑A00888D','2019-06-25 > 09:57:19',0,-20,'',-20,-20,'379-7038',1434,'2019-06-25',275,0,126723690,45726990 > ,796.0,2205,746,'null','null','null',0,'375');" > > Using CQL driver: <module 'cassandra' from > '/home/cassandra/cas3.11.3/bin/../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/__init__.py'> > > Using connect timeout: 5 seconds > > Using 'utf-8' encoding > > Using ssl: False > > bash-4.1$ bin/cqlsh hadoop4 -u dba -p *** --debug -e "select * from > HYGL_JCSJ.hyjg_ods_yy_gps_novar3 where clcph='黑A00888D' and dwsj='2019-06-25 > 09:57:19';"Using CQL driver: <module 'cassandra' from > '/home/cassandra/cas3.11.3/bin/../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/__init__.py'> > > Using connect timeout: 5 seconds > Using 'utf-8' encoding > Using ssl: False > clcph | dwsj | bc | blbs | cjbzh | ckryid | > clid | clmc | ddfx | ddrq | ddsj | dlzbs | > dwrq | dwsk | fcsxh | fwj | gd | gdjd | gdwd | jd | jsdlc | jszjl > | jxzjl | kxbs | sfaxlxs | sfcs | sjgxsj | sjid | sjlx | sjlyxt | sjsfzh | > sjwtid | sjxm | sjzlfj | sssd | szzdid | szzdmc | szzdxh | wd | xlbm | xlid > | xlmc | xslc | xxfssj | xxjssj | xxrksj | xzzdid | xzzdmc | xzzdxh | yxfx | > yygpsxxjlid | yyzt > -----------+---------------------------------+----+------+-------+--------+------+----------+------+---------------------------------+------+-------+------+------+-------+-----+----+-----------+----------+------+-------+-------+-------+------+---------+------+--------+------+------+--------+--------+--------+------+--------+------+--------+--------+--------+------+------+------+------+------+--------+--------+--------+--------+--------+--------+------+-------------+------ > 黑A00888D | 2019-06-25 01:57:19.000000+0000 | 0 | -20 | | -20 | > -20 | 379-7038 | 1434 | 2019-06-24 16:00:00.000000+0000 | null | null | null > | null | null | 275 | 0 | 126723690 | 45726990 | null | 796.0 | 2205 | > 746 | null | null | null | null | null | null | null | null | null > | null | null | 0 | null | null | null | null | null | null | 375 > | null | null | null | null | null | null | null | null | > null | null > (1 rows) > bash-4.1$ > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org