Open michaelmao999 opened 2 months ago
ubuntu 20.04 apache-doris-2.1.4
执行MySQL JDBC delete 语句,记录已经被删除,但是返回影响记录数为0.
如果删除1条记录,就返回影响记录数1.
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(); } }
No response
pymysql也有同样的问题
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