Skip to content

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Mar 4, 2021

Description

Failing test checking ColumnType.Nullable() with query EXPLAIN SELECT * FROM mysql.user: column Extra is
indicated not nullable, but data contains NULL.

Test code: https://github.com/dolmen/mysql/blob/test-EXPLAIN-nullable/driver_test.go#L2981
Test results on Github Actions: https://github.com/dolmen/mysql/actions/runs/621816893

Apparently the test doesn't fail on MariaDB in Github Actions, so this might be a MySQL bug. But is there a way to detect the case and workaround it?

No fix is provided in this PR.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

Failing test for "EXPLAIN SELECT * FROM mysql.user": column Extra is
indicated not nullable, but data contains NULL.
@methane
Copy link
Member

methane commented Mar 7, 2021

Apparently the test doesn't fail on MariaDB in Github Actions, so this might be a MySQL bug.

I don't verified the packet capture, but I think it is a MySQL bug. The driver need to believe result header packet.

But is there a way to detect the case and workaround it?

Use sql.NullString always regardless ColumnType.Nullable(). When it is null, it is null.

Since you didn't describe your use case, that's all I can say.

@methane methane closed this May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants