phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Esserlieu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2919) PreparedStatement Returns Incorrect Number of Deleted Records
Date Thu, 19 May 2016 21:24:12 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-2919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15292171#comment-15292171
] 

Brian Esserlieu commented on PHOENIX-2919:
------------------------------------------

Running the main method results in the following:

Exception in thread "main" java.lang.AssertionError: Expect 1000 records to be deleted. expected:<1000>
but was:<2000>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at PhoenixDeletionError.main(PhoenixDeletionError.java:18)

As demonstrated, the number of reported deletions (2000) is incorrect (should be 1000).

> PreparedStatement Returns Incorrect Number of Deleted Records
> -------------------------------------------------------------
>
>                 Key: PHOENIX-2919
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2919
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Brian Esserlieu
>         Attachments: PhoenixDeletionError.java
>
>
> The java.sql.PreparedStatement.executeUpdate() return contract states the following:
> "Returns:
> either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0
for SQL statements that return nothing".
> Phoenix deletion statements that delete 1000 or more records return an incorrect value
from executeUpdate().
> REPRO:
> Execute this table create statement:
> DROP TABLE IF EXISTS TEST_TABLE;
> CREATE TABLE IF NOT EXISTS TEST_TABLE (
>     pk1 DECIMAL NOT NULL,
>     v1 VARCHAR
>     CONSTRAINT PK PRIMARY KEY 
>     (
>         pk1
>     )
> );
> Then see and execute the attached Java class to see repro.



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

Mime
View raw message