apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.37k stars 3.22k forks source link

[Bug] 通过mysql JDBC 删除记录,删除成功了,但是返回影响记录数为0 #37770

Open michaelmao999 opened 2 months ago

michaelmao999 commented 2 months ago

Search before asking

Version

ubuntu 20.04
apache-doris-2.1.4

What's Wrong?

执行MySQL JDBC delete 语句,记录已经被删除,但是返回影响记录数为0.

What You Expected?

如果删除1条记录,就返回影响记录数1.

How to Reproduce?

CREATE TABLE tableinfo ( tableName varchar(100) NOT NULL , createTime datetime(3) DEFAULT NULL, updateTime datetime(3) DEFAULT NULL ) UNIQUE KEY (tableName) DISTRIBUTED BY HASH (tableName) BUCKETS 1 PROPERTIES ( 'replication_num' = '1', "enable_unique_key_merge_on_write" = "true" );

public int delete(String tableName) throws SQLException { try (Connection conn = dataSource.getConnection(); PreparedStatement ps = conn.prepareStatement("DELETE FROM tableinfo WHERE tableName=?")) { ps.setString(1, tableName); int result = ps.executeUpdate(); return ps.executeUpdate(); } }

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

lutinglt commented 1 month ago

pymysql也有同样的问题