tobiasb@stripped writes:
> >Description:
> I have some strings ending with blank characters. They are
> efficiently removed. The trailing blanks are relevant.
>
> >How-To-Repeat:
> mysql> create table blabbel ( blubbel varchar(255) );
> Query OK, 0 rows affected (0.07 sec)
>
> mysql> insert into blabbel values ('blubbel ');
> Query OK, 1 row affected (0.04 sec)
>
> mysql> select * from blabbel where blubbel='blubbel ';
> +---------+
> | blubbel |
> +---------+
> | blubbel |
> +---------+
> 1 row in set (0.00 sec)
>
> mysql> select * from blabbel where blubbel='blubbel';
> +---------+
> | blubbel |
> +---------+
> | blubbel |
> +---------+
> 1 row in set (0.00 sec)
>
> mysql> select * from blabbel where blubbel='blubbel ';
> +---------+
> | blubbel |
> +---------+
> | blubbel |
> +---------+
> 1 row in set (0.00 sec)
>
>
> >Fix:
> Sorry, studying the MySQL source code is far beyond the time I have.
> Tobias Brox (alias TobiX) - sysguy - +4722925871 - http://www.funcom.com/
> If an _urgent_ email is not acted upon within 10 minutes, you might try
> a _short_ mail to sms@stripped
Hi Tobias,
Would a tinyblob type instead of varchar(255) do the thing for you?
(They are same size) Blobs are case sensitive and the trailing
spaces remain. If you need to do case insensitive search from a blob,
you can use lcase() or ucase() in the where clause to change all the
characters in the field to upper case, or lower case and do the
test accordingly.
Regards,
- Jani
--
+-------------------------------------------------------------+
| TcX ____ __ _____ _____ ___ |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Jani Tolonen |
| /*/ /*/ /*/ \*\_ |*| |*||*| jani@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Helsinki |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|_____ Finland |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+-------------------------------------------------------------+