How does MySQL compare INTs with CHARs? I was asked this very question over the weekend and wanted to share that information plus some of the changes in MySQL 8.0.21 in this area. And yes those changes are pretty big.
Casting
Computers are good at making comparisons of two values but only if everything else the same. Comparing an integer with another integer is simple. Same data with same data type comparisons are a good thing. But what about when you need to compare a numeric 7 with a "7" where the number is in a string? In such cases one or both numbers need to be changed into the same basic data type. Imagine your favorite Harry Potter character waving their magic wand and shouting 'accio data' to change two different magical pieces of data into one common data type. No, Hogwarts was the the reason this conversion is called casting but this 'magic' needs …
[Read more]