Skip to content

Incorrect update count (0.3.2-patch9) #947

@Veirisa

Description

@Veirisa

Hi!

In com.clickhouse.jdbc.internal.ClickHouseStatementImpl#updateResult:

...
// FIXME apparently this is not always true
if (currentUpdateCount <= 0L) {
    currentUpdateCount = 1L;
}
...

Yes, this isn’t always true :)

Examples:

Statement statement = connection.createStatement();
statement.execute(sql);
int updateCount = statement.getUpdateCount();
  1. String sql = “CREATE TABLE new_table(x INT) engine = Memory;”
    Expected updateCount: 0
    Actual updateCount: 1

  2. String sql = "INSERT INTO new_table VALUES (1), (2), (3);"
    Expected updateCount: 3
    Actual updateCount: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions