Skip to content

Conversation

@bpintea
Copy link
Collaborator

@bpintea bpintea commented Sep 2, 2019

With this PR SQLRowCount() will always return the size of current
row set, also in the case a cursor is present.

The previous implementation returned 0 when a cursor was present, since
the function can't evaluate the total result set size (without actually
fetching it all) and applications shouldn't rely on this result.

The driver - that internally also uses the function for SYS queries -
assumed that ES/SQL will never return a cursor for SYS commands. This
seems however not to be a valid assumption.

With this commit SQLRowCount() will always return the size of current
row set, also in the case a cursor is present.

The previous implementation returned 0 when a cursor was present, since
the function can't evaluate the total result set size (without actually
fetching it all) and applications shouldn't rely on this result.

The driver - that internally also uses the function for SYS queries -
assumed that ES/SQL will never return a cursor for SYS commands. This
seems however not to be a valid assumption.
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 1058242 into elastic:master Sep 5, 2019
@bpintea bpintea deleted the fix/sqlrowcount_count_despite_cursor branch September 5, 2019 07:17
bpintea added a commit that referenced this pull request Sep 5, 2019
With this commit SQLRowCount() will always return the size of current
row set, also in the case a cursor is present.

The previous implementation returned 0 when a cursor was present, since
the function can't evaluate the total result set size (without actually
fetching it all) and applications shouldn't rely on this result.

The driver - that internally also uses the function for SYS queries -
assumed that ES/SQL will never return a cursor for SYS commands. This
seems however not to be a valid assumption.

(cherry picked from commit 1058242)
bpintea added a commit that referenced this pull request Sep 10, 2019
With this commit SQLRowCount() will always return the size of current
row set, also in the case a cursor is present.

The previous implementation returned 0 when a cursor was present, since
the function can't evaluate the total result set size (without actually
fetching it all) and applications shouldn't rely on this result.

The driver - that internally also uses the function for SYS queries -
assumed that ES/SQL will never return a cursor for SYS commands. This
seems however not to be a valid assumption.

(cherry picked from commit 1058242)
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.

2 participants