Page 1 of 1

PHP5 and Mysql4... i don't get it

Posted: Wed Dec 26, 2007 6:02 pm
by efwrfy
So, i just upgraded to PHP 5.2.5, and I thought I'd get the latest mysql too. Big mistake.

Now I have mysql5 and PHP5, but the php-mysql package is compiled against mysql 4 client libraries.

WAIT! You've heard this before!?

What I don't get is why does nobody have any errors with this setup? Am I the only one who gets these?

Warning: mysqli::prepare() [function.mysqli-prepare]: All data must be fetched before a new statement prepare takes place

and

Warning: mysqli_stmt::bind_result() [function.mysqli-stmt-bind-result]: Server returned unknown type 246. Probably your client library is incompatible with the server version you use!

I haven't dug deep enough to figure out the exact reason why, but I believe there is a documented mysql bug when connecting to a 5 server with 4.1 client libraries.

So, can I have php-mysql package compiled against mysql 5, or the source rpm, or mysql 4.1 server in the ART repositories? Or instructions on how to backport to mysql 4.1?


http://bugs.mysql.com/bug.php?id=9491
"Due to fact that 4.1 client library does not support MYSQL_TYPE_NEWDECIMAL added in 5.0, and there is no way to disable new DECIMAL type on server side the only possible solution to avoid reported problem will be relink application that uses PS C API with the client library from 5.0 server distribution."

Sorry if I missed a FAQ or something, but *every* hit I find is just people freaking out about the different version numbers w/o any actual errors and nobody offers a real solution other than, shut up it's okay to mix 4.1 and 5.0.

Posted: Thu Dec 27, 2007 10:44 am
by scott
Can you write a test utility for me to verify this in the QA environment?

Posted: Thu Dec 27, 2007 12:12 pm
by Highland
Another option (albeit just as much work) is to rebuild the server with CentOS 5, which comes with the MySQL 5 client installed.

Posted: Thu Feb 07, 2008 2:38 pm
by efwrfy
Sorry, I can't setup a test script. I recompiled PHP as soon as possible from source and just overwrote the mysql extension from ART's rpm with the source one. So, I no longer have a mismatched environment, but it should be pretty easy to test as long as you use the mysqli extension.

Posted: Thu Feb 07, 2008 4:24 pm
by scott
So can someone else come up with something for me to QA this with?