If I enter two Strings with only white space. I will Get this error message:
ERROR 1062: Duplicate entry ‘ ‘ for key ‘PRIMARY’
How can I Turn off “Auto-Trim” ?
I’m Using this Charset: uft8-uft8_bin and This Datatype: Varchar.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the SQL 92 documentation, when two strings are compared they are first made equal in length by padding the shortest string with spaces.
Search for
8.2 <comparison predicate>in the document.So in other words. Its not about storing the value with the amount of spaces you entered, but its the comparisment it does to check for duplicate primary key. So you cannot have two strings with a different amount of spaces act as a primary key