I hope someone could help me to clarify some doubts on this question.
I have got a table with this schema:
CREATE TABLE IF NOT EXISTS `entities` (
`id` int(6) unsigned NOT NULL,
`external_vendor_id` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
Then I insert a record in this table:
INSERT INTO `entities`
(`id`, `external_vendor_id`)
VALUES
('1', '64835_122334');
When I select a record with the following statement, then this record is selected, even though the external_vendor_id
in the WHERE
clause does not match the external_vendor_id
that was inserted via the INSERT
statement.
select id, external_vendor_id
from `entities`
where `external_vendor_id` = 64835;
This is happening on MySQL 5.7.12.
Questions
- Does anybody know if this is an expected result? (if so why?)
- Or is this a bug in this MySQL version?
Any help will be much appreciated. And a modification of the query to avoid this result will be very helpful to understand what's going on.