Closed joao-conde closed 2 days ago
@abonander hope it has enough info, hopefully something to solve trivial when getting the column names data from the query result.
I actually just remembered that this is likely due to a bug in MariaDB: https://github.com/launchbadge/sqlx/issues/1530
Thanks for linking. Seems original issue is big dated, but the JIRA ticket for MariaDB had no updates yet. So I think I'll just have to live with it.
Bug Description
The following code works for an Sqlite connection:
This same code should work for a MariaDB database:
However, it doesn't and fails with the error:
ColumnNotFound("id")
The same happens if one manually specifies the column names like so:
A quick debug print reveals something interesting:
There seems to be all the column data there, but the field
column_names
is empty. That would raise the error we are observing here: https://github.com/launchbadge/sqlx/blob/main/sqlx-mysql/src/row.rs#L46So I suspect its simply not parsing the column names field properly when using RETURNING with mariadb.
Minimal Reproduction
See snippets above.
Info
mariadb:11.4
rustc --version
: rustc 1.79.0 (129f3b996 2024-06-10)