Tuesday, November 5, 2013

mysql weird trailing space in where query

I was surprised to see that mysql can be this dumb

The varchar field preserves trailing spaces but you can do any query like below and all three will match '/Shared/test'

select  * from folders where path ='/Shared/test'
select  * from folders where path ='/Shared/test '
select  * from folders where path ='/Shared/test      '

as per http://bugs.mysql.com/bug.php?id=64772  its a feature not a bug. WTF

No comments:

Post a Comment