Skip to content
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

Drop static buffer usage for cursor in requests #88

Merged
merged 1 commit into from Jan 17, 2019

Conversation

bpintea
Copy link
Collaborator

@bpintea bpintea commented Jan 16, 2019

The cursor received from ES/SQL is being sent back to it when fetching
the next result set "page". When building the request, it's value was
converted from SQLWCHAR to mb-string in a static buffer, to find out
first the space required for it in the request.

Since the cursor value is a Base64 encoding string, the conversion can
simply be done by ASCII conversion, and thus the buffer is no longer
needed.

This fixes the case where the cursor value received from ES/SQL goes
over the buffer size (4KB), thus generating a failed query.

Close #86

The cursor received from ES/SQL is being sent back to it when fetching
the next result set "page". When building the request, it's value was
converted from SQLWCHAR to mb-string in a static buffer, to find out
first the space required for it in the request.

Since the cursor value is a Base64 encoding string, the conversion can
simply be done by ASCII conversion, and thus the buffer is no longer
needed.

This fixes the case where the cursor value received from ES/SQL goes
over the buffer size (4KB), thus generating a failed query.
Copy link
Collaborator

@edsavage edsavage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpintea bpintea merged commit 6f5d33d into elastic:master Jan 17, 2019
@bpintea bpintea deleted the fix/remove_cursor_buffer branch January 17, 2019 10:25
bpintea added a commit that referenced this pull request Jan 17, 2019
The cursor received from ES/SQL is being sent back to it when fetching
the next result set "page". When building the request, it's value was
converted from SQLWCHAR to mb-string in a static buffer, to find out
first the space required for it in the request.

Since the cursor value is a Base64 encoding string, the conversion can
simply be done by ASCII conversion, and thus the buffer is no longer
needed.

This fixes the case where the cursor value received from ES/SQL goes
over the buffer size (4KB), thus generating a failed query.

(cherry picked from commit 6f5d33d)
bpintea added a commit that referenced this pull request Jan 17, 2019
The cursor received from ES/SQL is being sent back to it when fetching
the next result set "page". When building the request, it's value was
converted from SQLWCHAR to mb-string in a static buffer, to find out
first the space required for it in the request.

Since the cursor value is a Base64 encoding string, the conversion can
simply be done by ASCII conversion, and thus the buffer is no longer
needed.

This fixes the case where the cursor value received from ES/SQL goes
over the buffer size (4KB), thus generating a failed query.

(cherry picked from commit 6f5d33d)
@bpintea bpintea added >bug and removed fix labels May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: remove usage of static buffer in cursor conversion for requests
2 participants