Hello,
I have upgraded MySQL from 4.0.7 to 4.1.9 (OS Win XP SP2) and now I have a problem with
empty string comparison.
Test case:
CREATE TABLE tb_test (
t1 char(5) NOT NULL default '',
t2 char(5) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=cp1250 COLLATE=cp1250_czech_cs;
INSERT INTO tb_test (t1, t2) VALUES('a', '');
INSERT INTO tb_test (t1, t2) VALUES('b', ' ');
SELECT t1, t2, length(t1), length(t2), t2 = '', t2 = ' ', t2 = ' ' FROM tb_test;
output:
t1 t2 length(t1) length(t2) t2 = '' t2 = ' ' t2 = ' '
a 1 0 0 1 1
b 1 0 0 1 1
I don't know why fields with zero length are not equal to empty string. If I change both
fields t1 and t2 to VARCHAR(5) situation is same.
Could someone help me to solve this out? Maybe I just missed some variable setting or
something like this.
Thanks in advance
Dusan Pavlica