ss - oscar

My SQL Dump

MySQL musings by a self professed MySQL Geek

Previous Entry Share Next Entry
CentOS 5 users beware - The shipped mysql client is broken
ss - oscar
swanhart
CentOS 5 ships with version 5.0.22 of MySQL, which has a number of issues, but I discovered a major one that I wasn't aware of until yesterday. There is a problem in the 5.0.22 client that causes empty strings, or strings consisting only of spaces to be displayed as NULL:
http://bugs.mysql.com/bug.php?id=19564

CREATE TABLE test.x1 (c char(10)) ENGINE=MYISAM;
INSERT INTO test.x1 values (' ');
INSERT INTO test.x1 values ('');


-- on a 5.0.22 client (/usr/local/mysql):
mysql> select * from test.x1;
+------+
| c    |
+------+
| NULL |
| NULL |
+------+
2 rows in set (0.00 sec)

-- on a 5.0.37 client (~/bin/mysql):
mysql> select * from test.x1;
+------+
| c    |
+------+
|      |
|      |
+------+
2 rows in set (0.00 sec)

  • 1

php-mysql also broken then?

(Anonymous)
We noticed that our version of php-mysql coming from Centos 5 was using v. 5.0.22, and we were seeing other issues in that as well.

My first reaction to your post was "Well, I use the RPMs provided by MySQL anyway", but then I thought about the php-mysql thing, and how unfortunate it is that the php folks have decided not to provide linux packages because "most distros come with php these days" see: http://www.php.net/downloads.php sidebar.

Re: php-mysql also broken then?

It appears to be only a projection problem in the actual 'mysql' binary (aka the MySQL Monitor) and not in the client libary, so PHP should be safe. I inserted two values into the table, an empty string and NULL.

-- system binary compiled against 5.0.22
[justin@tpchreg1:~]$ /usr/bin/php t.php
'', len:0, null:false
'', len:0, null:true

-- customer binary compiled with 5.1.24-rc
[justin@tpchreg1:~]$ ~/bin/php t.php
'', len:0, null:false
'', len:0, null:true

What version has the fix?

(Anonymous)
Updating to Centos 5.2 brings mysql-5.0.45-7.el5, what version of mysql has this problem been fixed in?

Re: What version has the fix?

It is fixed in 5.0.23. Any release after 5.0.22 should not have the problem.


QA?

(Anonymous)
How does something like this happen in production software? Is there no regression tests? Unbelievable.

  • 1
?

Log in

No account? Create an account