fix(mysql): Work around for Issue #2206 (ColumnNotFound error when querying) #4086
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 fixes the test case in #2206 (comment).
I realize that this may not be the best fix for the issue, so consider this a conversation starter PR. The comments in the mysql
connection/executor.rssuggest that column information may be delayed until first result, but where and how exactly that is supposed to happen wasn't clear to me and the column information is not currently being updated appropriately. This patch catches such situations and compensates. A better fix would find where the update should have happend -- I just don't know where or how to do that.Does your PR solve an issue?
fixes #2206
Is this a breaking change?
This change may cause some code which previously returned
Err(ColumnNotFound)to now returnOk(value). This is a bug fix so the user code expected to receiveOk(value)but this is technically a change in behavior.