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

Support/Development for PHP
efwrfy
New Forum User
New Forum User
Posts: 2
Joined: Wed Dec 26, 2007 5:55 pm

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

Unread post 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.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Can you write a test utility for me to verify this in the QA environment?
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

Unread post 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.
efwrfy
New Forum User
New Forum User
Posts: 2
Joined: Wed Dec 26, 2007 5:55 pm

Unread post 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.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

So can someone else come up with something for me to QA this with?
Post Reply