Suppose, we have a test table in MySql:
CREATE TABLE `test_table` (
`_id` INT(10) UNSIGNED NOT NULL,
`testfield` TEXT NULL COLLATE 'utf8_unicode_ci',
PRIMARY KEY (`_id`)
)
COLLATE='utf8_unicode_ci'
ENGINE=MyISAM;
it contains a single row:
INSERT INTO `test_table` (`testfield`) VALUES ('testValue');
Then when I do this query:
SELECT * FROM `test_table` WHERE `testField` = 'testValue';
or this:
SELECT * FROM `test_table` WHERE `testField` = 'testValue ';
or even this:
SELECT * FROM `test_table` WHERE `testField` = 'testValue ';
I always receive the same result, and it is this single row, but I want this row only in first case.
Why mysql truncate blank spaces at the end of 'testVaue '
? And the main question, what should I do to eliminate such behavior?