Skip to content

Conversation

@duelafn
Copy link

@duelafn duelafn commented Nov 3, 2025

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.rs suggest 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 return Ok(value). This is a bug fix so the user code expected to receive Ok(value) but this is technically a change in behavior.

@duelafn duelafn force-pushed the bug-2206 branch 2 times, most recently from 9cfcac3 to 794a3e0 Compare November 4, 2025 15:20
Possibly not the best fix, but for some reason MySqlRow.column_names is not being populated. If a string index is requested and column_names is empty, fall back to iterating over columns to try to find the column index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant