You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/09/02 17:47:46 UTC

[jira] [Updated] (PHOENIX-2223) Support DELETE that strictly returns number of rows deleted

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

James Taylor updated PHOENIX-2223:
----------------------------------
    Summary: Support DELETE that strictly returns number of rows deleted  (was: sqlline delete sometimes erroneously reports 1 row affected)

> Support DELETE that strictly returns number of rows deleted
> -----------------------------------------------------------
>
>                 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)