-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] sql: pgwire support for limited result sets #33174
Conversation
694c324
to
d933ba4
Compare
d933ba4
to
21f146a
Compare
stmtRes := ex.clientComm.CreateStatementResult( | ||
tcmd.Stmt, NeedRowDesc, pos, nil, /* formatCodes */ | ||
ex.sessionData.DataConversion) | ||
stmtRes := ex.clientComm.CreateStatementResult(tcmd.Stmt, NeedRowDesc, pos, nil, ex.sessionData.DataConversion, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nil and 0 should be documented inline.
r.seenTuples = 0 | ||
|
||
return r.moreResultsNeeded() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained
pkg/sql/conn_executor_exec.go, line 934 at r1 (raw file):
} ex.sessionTracing.TraceExecRowsResult(consumeCtx, values) quitEarly, commErr = res.AddRow(consumeCtx, values)
AddRow
returns what seems to be the inverse of "quit early".
This commit adds support for portal execution with limits, which is the part of the pgwire protocol that JDBC uses if you use its native pagination with `setFetchSize`. Release note (sql change): add support for row limits in prepared portals at the pgwire layer, enabling support for client-side pagination with things like JDBC's `setFetchSize`. Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com> Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
21f146a
to
f09b351
Compare
Jordan can you give me write permissions on your repo? I can't push my changes. We still need to figure out the testing story. |
@jordanlewis @andreimatei could you brush up this PR to have a first MVP in 19.1 before the branch is cut? We can fix up with backports as needed afterwards. |
Well this was not the right way to go, in my opinion - the "command result" taking over the For this one in particular, my heart is definitely not in it. |
This commit adds support for portal execution with limits, which is the
part of the pgwire protocol that JDBC uses if you use its native
pagination with
setFetchSize
.Closes #4035.
Release note (sql change): add support for row limits in prepared
portals at the pgwire layer, enabling support for client-side pagination
with things like JDBC's
setFetchSize
.Co-authored-by: Jordan Lewis jordanthelewis@gmail.com
Co-authored-by: Andrei Matei andrei@cockroachlabs.com