ExecuteFetchAsDBA(): handle 'allowZeroInDate' and batched queries #14953
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.
Description
This is a backport-compliant fix for #14952. In this PR:
ExecuteFetchAsDBA()
correctly identifies the existence of/*vt+ allowZeroInDate=true */
in either a single or a multi statement SQL. However, this is a hacky solution in that it is enough that a single query has this directive, that we apply it to all queries.ExecuteFetchAsDBA()
drains the results of a multi-statement SQL, and as effectReloadSchema
loads all tables effected in a multi-statement SQL.This is backport compliant solution, and so it intentionally does not error when a multi-statement SQL is provided. Technically, it's not the correct mechanism for running multiple queries, because it only returns a single result set.
A followup PR, that will build on top of this one for backwards compatibility reasons, will make
proto
changes to better formalize multi-statement SQLs as well as the request for aallowZeroInDate
friendly connection.Backport
This should be backported to
release-18.0
because--batch-size
is included inrelease-18.0
.Related Issue(s)
ApplySchema --batch-size
fails to apply zero-date and causes prematureReloadSchema
#14952ExecuteFetch
misbehavior when running multiple queies #14948Checklist
Deployment Notes