【需求背景】
批量插入且仅插入一条数据时候,驱动返回 Received resultset tuples, but no field structure for them 错误.
【需求描述】
preparestatement中设置 RETURN_GENERATED_KEYS 以后 批量插入且仅插入一条数据时 协议处理流程不正确
如下是测试代码
@Test
public void testBatchMode() throws SQLException {
String insertSql = "insert into test_batch (col1, col2) values (?,?)";
PreparedStatement preparedStatement = postgresConnection.prepareStatement(insertSql, Statement.RETURN_GENERATED_KEYS);
preparedStatement.setInt(1,1);
preparedStatement.setString(2,"a");
preparedStatement.addBatch();
preparedStatement.executeBatch();
}
以下是表结构
create table test_batch
(
id serial,
col1 integer,
col2 varchar(32)
)
【其他说明】
Hey @萨西摩尔, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
/sig connectors
Hi @萨西摩尔,
if you want to get quick review about your issue, please contact the owner in first: @Pike ,
and then any of the maintainers: @Pike
and then any of the committers: @travelliu , @aaronwell , @Loong , @Kamus , @vimiix , @汪伟
if you have any question, please contact the SIG: Connectors.
验收版本:
gsql:gaussdb (openGauss 5.0.2 build 0db5202f) compiled at 2024-04-17 15:28:50 commit 0 last mr
jdbc:compiled at 2024-04-17-15:42:00 build fd771c9
验收结论:验收通过
插入单行
插入多行
验收版本:
gsql:openGauss 5.0.2 build 0db5202f) compiled at 2024-04-17 15:39:29 commit 0 last mr
psycopg2:2.9 (dt dec pq3 ext)
验收结论:验收通过
验收过程:
插入单行:
插入多行:
验收版本:
gsql:(openGauss 5.0.2 build db63ed87) compiled at 2024-04-23 21:36:27 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
odbc:5.0.2
验收结论:验收通过
登录 后才可以发表评论