Bug #106900 Filtering BINARY column with .NET byte[] does not work
Submitted: 4 Apr 2022 9:10 Modified: 9 Jul 2022 11:57
Reporter: Robert Schmidt Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:8.0.28 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[4 Apr 2022 9:10] Robert Schmidt
Description:
This is still an issue on EF Core 6.0 with MySQL.Data 8.0.28.  Given the BINARY(32) column Operations.Hash and

IEnumerable<byte[]> hashes;

then both

source.Where(o => hashes.Any(h => o.Hash == h))

and

source.Where(o => hashes.Contains(o.Hash))

are both injecting the literal string "System.Byte[]" into the generated SQL:

SELECT `o`.`Hash`, `o`.`Id`
FROM `Operations` AS `o`
WHERE `o`.`Hash` = System.Byte[]

causing

MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[]' at line 3

Also reported in #93398 which was closed due to inactivity.

How to repeat:
Use BINARY column, and try filtering it with a sequence of byte[] arrays.

(Single byte[] array filtering works!)
[9 Jun 2022 11:57] MySQL Verification Team
Hello Robert Schmidt,

Thank you for the bug report.
Could you please provide repeatable test case(please make it as private if you prefer) to reproduce this issue at our end? Thank you.

Regards,
Ashwini Patil
[10 Jul 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".