Use this table for testing
Create Table 'test '. 'word' (<br/> 'id' integer unsigned not null auto_increment, <br/> 'word' varchar (45) not null, <br/> Primary Key ('id'), <br/> unique index 'index _ 2' ('word') <br/>) <br/> engine = InnoDB;
Check that the word has made unique restrictions. Execute the following statement:
Insert ignore into words (Word) values ('test ');
Insert ignore into words (Word) values ('test');/* Add a space on the right */
Insert ignore into words (Word) values ('test');/* Add a space on the left */
Look at the results, select * From words;
2 | [test]
1 | [test]
[] To better understand Spaces
The insert result is the second one that is not inserted into the table.
Then test select,
Select * From words where WORD = 'test ';
Select * From words where WORD = 'test';/* Add a space on the right */
The results of these two statements are the same.
Conclusion
MySQL will handle the space on the right.