Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Thu, 16 Nov 2023 08:50:47 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #2976: feat: fetch size for RefCursor In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 1395352249 X-GitHub-Comment-Type: review_comment X-GitHub-Commit: 2be046b8c76fcda813f53d5d9070e13feb009dd6 X-GitHub-Issue: 2976 X-GitHub-Line: 2263 X-GitHub-Path: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: review_comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/2976#discussion_r1395352249 Content-Type: text/plain; charset=utf-8 (on pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java:2263) I am afraid this change does not fix the issue. It uses `fetchRows` from the base `ResultSet` rather than `fetchRows` of the `ResultSet` that is associated with `refcursor` in question. In other words: Imagine we call `{? = call test_blob(?)}`. `CallableStatement.execute` would gather call results, and it would execute `getObject` at https://github.com/pgjdbc/pgjdbc/blob/ca25d1053199da96a63838f7476a14137dc9d9be/pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java#L131 Then it would delegate to `PgResultSet.getObject -> internalGetObject -> getRefCursor`, and it would effectively use `fetchSize` from a temporary resultset associated with `{? = call test_blob(?)}`. I believe we should add a test to ensure `fetch forward` is triggered at all.