daiqiang commented on PR #37791: URL: https://github.com/apache/shardingsphere/pull/37791#issuecomment-3815879762
1.I wrote the code based on version 5.5.1, then used a local test project of my own for integration testing. After the test succeeded, I migrated the code from 5.5.1 to 5.5.3-SNAPSHOT. However, I can’t verify the correctness of the code after migration in 5.5.3-SNAPSHOT on my own. 2.Why didn’t I directly use 5.5.3-SNAPSHOT for my local test project? Because 5.5.3-SNAPSHOT always has weird issues that prevent it from working properly. Earlier, when I integrated it into the project, it failed to work with Oracle (I can’t find the screenshot now). Today, it fails to install, as shown in the image below: <img width="2550" height="1521" alt="aed368041d898d725724ac3dec8b43dc" src="https://github.com/user-attachments/assets/6d20891f-e515-467b-949e-408e7c2210e8" /> 3.After making modifications on 5.5.1, I tested with the following test case and confirmed that the SQL can be inserted into the database normally. The code is as follows: `public String batch() { StringBuilder log = new StringBuilder(); String sql = "INSERT INTO MY_USER (ID, USER_NAME, ADDR) VALUES (?, ?, ?)"; try (Connection conn = dataSource.getConnection(); PreparedStatement ps = conn.prepareStatement(sql)) { // 批次0:setBinaryStream byte[] data1 = "数据1-setBinaryStream".getBytes("UTF-8"); ps.setString(1, "BLOB_001"); ps.setString(2, "张三"); ps.setBinaryStream(3, new ByteArrayInputStream(data1), (long) data1.length); ps.addBatch(); log.append("批次0: setBinaryStream\n"); // 批次1:setNull ps.setString(1, "BLOB_002"); ps.setString(2, "李四"); ps.setNull(3, Types.BLOB); ps.addBatch(); log.append("批次1: setNull\n"); // 批次2:setBlob byte[] data3 = "数据3-setBlob".getBytes("UTF-8"); ps.setString(1, "BLOB_003"); ps.setString(2, "王五"); ps.setBlob(3, new ByteArrayInputStream(data3), (long) data3.length); ps.addBatch(); log.append("批次2: setBlob\n"); // 执行 int[] results = ps.executeBatch(); log.append("\n执行成功!影响行数:"); for (int i = 0; i < results.length; i++) { log.append("\n 批次").append(i).append(": ").append(results[i]); } } catch (Exception e) { log.append("\n执行失败:").append(e.getMessage()); e.printStackTrace(); } return log.toString(); }` 4.Earlier, I said, 【If I have to submit a PR online every time I make a change and wait for your review, wouldn't that be very cumbersome?】 I didn’t mean that I find it troublesome—what I was worried about is that you might find it cumbersome. If you don’t mind the back-and-forth, I’ll continue fixing this bug. If you think it’s taking too long with repeated revisions and it’s delaying your review time, please let me know. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
