You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Ashot Golovenko (JIRA)" <ji...@apache.org> on 2014/06/11 17:36:02 UTC

[jira] [Updated] (CASSANDRA-7379) updating a row with composite key with a null value removes the entire row

     [ https://issues.apache.org/jira/browse/CASSANDRA-7379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashot Golovenko updated CASSANDRA-7379:
---------------------------------------

    Description: 
create a table

CREATE TABLE relation (
    u1 bigint,
    u2 bigint,
    mf int,
    PRIMARY KEY (u1, u2));

insert value:
UPDATE relation SET mf = 1 WHERE u1 = 1 and u2 = 2;

SELECT * from relation ;

 u1 | u2 | mf
----+----+----
  1 |  2 |  1

insert null value:
UPDATE relation SET mf = null WHERE u1 = 1 and u2 = 2;

SELECT * from relation ;

(0 rows) <--- WRONG!

The INSERT statement however works:
INSERT INTO relation (u1, u2, mf) VALUES (1, 2, null); 

SELECT * from relation ;

 u1 | u2 | mf
----+----+------
  1 |  2 | null

(1 rows)
 






  was:
create a table

CREATE TABLE relation (
    u1 bigint,
    u2 bigint,
    mf int,
    PRIMARY KEY (u1, u2));

insert value:
UPDATE facebook_user_relation SET mf = 1 WHERE u1 = 1 and u2 = 2;

SELECT * from relation ;

 u1 | u2 | mf
----+----+----
  1 |  2 |  1

insert null value:
UPDATE relation SET mf = null WHERE u1 = 1 and u2 = 2;

SELECT * from relation ;

(0 rows) <--- WRONG!

The INSERT statement however works:
INSERT INTO relation (u1, u2, mf) VALUES (1, 2, null); 

SELECT * from relation ;

 u1 | u2 | mf
----+----+------
  1 |  2 | null

(1 rows)
 







> updating a row with composite key with a null value removes the entire row
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7379
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7379
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Ashot Golovenko
>            Priority: Critical
>
> create a table
> CREATE TABLE relation (
>     u1 bigint,
>     u2 bigint,
>     mf int,
>     PRIMARY KEY (u1, u2));
> insert value:
> UPDATE relation SET mf = 1 WHERE u1 = 1 and u2 = 2;
> SELECT * from relation ;
>  u1 | u2 | mf
> ----+----+----
>   1 |  2 |  1
> insert null value:
> UPDATE relation SET mf = null WHERE u1 = 1 and u2 = 2;
> SELECT * from relation ;
> (0 rows) <--- WRONG!
> The INSERT statement however works:
> INSERT INTO relation (u1, u2, mf) VALUES (1, 2, null); 
> SELECT * from relation ;
>  u1 | u2 | mf
> ----+----+------
>   1 |  2 | null
> (1 rows)
>  



--
This message was sent by Atlassian JIRA
(v6.2#6252)