phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Shen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-4876) Delete returns incorrect number of rows affected in some case
Date Tue, 28 Aug 2018 20:10:00 GMT
William Shen created PHOENIX-4876:
-------------------------------------

             Summary: Delete returns incorrect number of rows affected in some case
                 Key: PHOENIX-4876
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4876
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.13.0
            Reporter: William Shen


Running Phoenix 4.13 and encountering deletion of a non-existing row returning "1 row affected"
instead of "No rows affected".

Here is a simplified reproducible case:
{code:java}
> CREATE TABLE IF NOT EXISTS TEST (A BIGINT PRIMARY KEY, B BIGINT);

No rows affected (2.524 seconds)

> DELETE FROM TEST WHERE A = 0;

1 row affected (0.107 seconds)

> DELETE FROM TEST WHERE B = 0;

No rows affected (0.007 seconds)

> DELETE FROM TEST WHERE A = 0 AND B = 0;

No rows affected (0.007 seconds)

> DELETE FROM TEST WHERE A = 0;

1 row affected (0.007 seconds)

> SELECT * FROM TEST;

+----+----+

| A | B |

+----+----+

+----+----+

No rows selected (0.023 seconds)

> SELECT COUNT(*) FROM TEST;

+-----------+

| COUNT(1) |

+-----------+

| 0         |

+-----------+

1 row selected (0.014 seconds){code}
Expected: 
{code:java}
> DELETE FROM TEST WHERE A = 0;
No rows affected{code}
Actual:
{code:java}
> DELETE FROM TEST WHERE A = 0;
1 row affected{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message