phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Heather (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-2223) sqlline delete sometimes erroneously reports 1 row affected
Date Wed, 02 Sep 2015 14:19:45 GMT
James Heather created PHOENIX-2223:
--------------------------------------

             Summary: sqlline delete sometimes erroneously reports 1 row affected
                 Key: PHOENIX-2223
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2223
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.3.0
         Environment: CDH5
            Reporter: James Heather


If you create a table with no rows in, and then issue a delete statement with a {{where id=1}}
clause, sqlline reports 1 row affected, even though no rows were actually deleted. It doesn't
seem to happen without a {{where}} clause, or with something like {{where id<=2}}.

Some experiments:

{code}
0: jdbc:phoenix:172.xx.xx.xxx> create table names (id bigint(20) primary key, name varchar(20));
No rows affected (1.158 seconds)
0: jdbc:phoenix:172.xx.xx.xxx> delete from names where id=1;
1 row affected (0.204 seconds)
0: jdbc:phoenix:172.xx.xx.xxx> 
{code}

and

{code}
0: jdbc:phoenix:172.31.30.216> select * from names;
+------------------------------------------+----------------------+
|                    ID                    |         NAME         |
+------------------------------------------+----------------------+
+------------------------------------------+----------------------+
No rows selected (0.538 seconds)
0: jdbc:phoenix:172...> delete from names;
No rows affected (0.1 seconds)
0: jdbc:phoenix:172...> upsert into names (id, name) values (1, 'james');
1 row affected (0.064 seconds)
0: jdbc:phoenix:172...> upsert into names (id, name) values (2, 'helen');
1 row affected (0.05 seconds)
0: jdbc:phoenix:172...> upsert into names (id, name) values (3, 'naomi');
1 row affected (0.052 seconds)
0: jdbc:phoenix:172...> upsert into names (id, name) values (4, 'reuben');
1 row affected (0.053 seconds)
0: jdbc:phoenix:172...> delete from names where id<=2;
2 rows affected (0.116 seconds)
0: jdbc:phoenix:172...> delete from names where id<=2;
No rows affected (0.098 seconds)
0: jdbc:phoenix:172...> delete from names where id=2;
1 row affected (0.071 seconds)
0: jdbc:phoenix:172...> 
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message