-
Notifications
You must be signed in to change notification settings - Fork 32
Fixes: correct check on truncation failure. Reinit IRD on statement closing. Logging format descriptors #170
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
Merged
bpintea
merged 3 commits into
elastic:master
from
bpintea:fix/correct_diag_on_truncation
Aug 16, 2019
Merged
Fixes: correct check on truncation failure. Reinit IRD on statement closing. Logging format descriptors #170
bpintea
merged 3 commits into
elastic:master
from
bpintea:fix/correct_diag_on_truncation
Aug 16, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The timestamp/time to string truncation needs to fail only if current status code (for current column) indicates that truncation occured; so status code has been added to the branching evaluation. Previously, only the current diagnostic code was used in the decision (and checked if it indicated truncation), which was incorrect since this could have been set by the conversion of a previous column in same row.
On statment closing the IRD descriptor's headers should be reinitialized. The fix is for good house keeping, the defect didn't have a practical impact, since the IRD is cleared also before adding a new result set; furthermore, a new result set added to an already-used IRD would only occur if a statement handle is re-prepared, which happens very rarely (generally a client app would allocate a new handle for a new query). The commit also switches a few catalog functions to using SQLExecDirect(), instead of dupplicating its code.
Correct some format specifiers for logging, mostly s/zd/zu for size_t types.
edsavage
approved these changes
Aug 16, 2019
Collaborator
edsavage
left a comment
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.
LGTM
bpintea
added a commit
that referenced
this pull request
Aug 16, 2019
…losing. Logging format descriptors (#170) * fix: only fail time*/str conversion on truncation The timestamp/time to string truncation needs to fail only if current status code (for current column) indicates that truncation occured; so status code has been added to the branching evaluation. Previously, only the current diagnostic code was used in the decision (and checked if it indicated truncation), which was incorrect since this could have been set by the conversion of a previous column in same row. * fix: re-init IRD headers on statement close On statment closing the IRD descriptor's headers should be reinitialized. The fix is for good house keeping, the defect didn't have a practical impact, since the IRD is cleared also before adding a new result set; furthermore, a new result set added to an already-used IRD would only occur if a statement handle is re-prepared, which happens very rarely (generally a client app would allocate a new handle for a new query). The commit also switches a few catalog functions to using SQLExecDirect(), instead of dupplicating its code. * fix: correct logging format specifiers Correct some format specifiers for logging, mostly s/zd/zu for size_t types. (resolved conflict around '/* ESODBC_CURL_CLOSE */' chunk) (cherry picked from commit c7aa95b)
bpintea
added a commit
that referenced
this pull request
Aug 28, 2019
…losing. Logging format descriptors (#170) * fix: only fail time*/str conversion on truncation The timestamp/time to string truncation needs to fail only if current status code (for current column) indicates that truncation occured; so status code has been added to the branching evaluation. Previously, only the current diagnostic code was used in the decision (and checked if it indicated truncation), which was incorrect since this could have been set by the conversion of a previous column in same row. * fix: re-init IRD headers on statement close On statment closing the IRD descriptor's headers should be reinitialized. The fix is for good house keeping, the defect didn't have a practical impact, since the IRD is cleared also before adding a new result set; furthermore, a new result set added to an already-used IRD would only occur if a statement handle is re-prepared, which happens very rarely (generally a client app would allocate a new handle for a new query). The commit also switches a few catalog functions to using SQLExecDirect(), instead of dupplicating its code. * fix: correct logging format specifiers Correct some format specifiers for logging, mostly s/zd/zu for size_t types. (cherry picked from commit c7aa95b)
bpintea
added a commit
that referenced
this pull request
Dec 4, 2019
…losing. Logging format descriptors (#170) * fix: only fail time*/str conversion on truncation The timestamp/time to string truncation needs to fail only if current status code (for current column) indicates that truncation occured; so status code has been added to the branching evaluation. Previously, only the current diagnostic code was used in the decision (and checked if it indicated truncation), which was incorrect since this could have been set by the conversion of a previous column in same row. * fix: re-init IRD headers on statement close On statment closing the IRD descriptor's headers should be reinitialized. The fix is for good house keeping, the defect didn't have a practical impact, since the IRD is cleared also before adding a new result set; furthermore, a new result set added to an already-used IRD would only occur if a statement handle is re-prepared, which happens very rarely (generally a client app would allocate a new handle for a new query). The commit also switches a few catalog functions to using SQLExecDirect(), instead of dupplicating its code. * fix: correct logging format specifiers Correct some format specifiers for logging, mostly s/zd/zu for size_t types. Cherry-pick merging: - truncation failure check not applicable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR bundles a few minor fixes:
A check on conversion failure was incorrectly taking into account the result of a previous column conversion on the same row. The defect was without practical implications, since a second, impossible condition would have had to match to lead to an incorrect failure. However the incorrect first check lead to a failing assertion.
The IRD descriptor was not re-init'd on statement handle closing. This defect is fixed just for good house-keeping, since the descriptor would be re-init'd on attaching a new result set to it (which happens regularly when the result for a query is being paged / using a cursor). Along with this, some code duplication has been removed.
A few logging statements had the wrong format specifiers, mostly expecting signed, instead of the correct unsigned types of the integer variants.