#35536 [Bgs]: mysql_field_type returns unknown for INT(11) columns

From: Date: Sun, 04 Dec 2005 21:42:33 +0000
Subject: #35536 [Bgs]: mysql_field_type returns unknown for INT(11) columns
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89731@lists.php.net to get a copy of this message
 ID:               35536
 Updated by:       tony2001@php.net
 Reported By:      nevis2us at infoline dot su
 Status:           Bogus
 Bug Type:         MySQL related
 Operating System: Linux Gentoo
 PHP Version:      4.4.1
 New Comment:

I can't think of a way that makes the same code work for me and makes
it fail for you, and I'm sure your PHP receives wrong data from the
client library, so it's definitely NOT PHP issue.


Previous Comments:
------------------------------------------------------------------------

[2005-12-04 22:36:41] nevis2us at infoline dot su

I've read the upgrading guide. Thanks.
The problem is I've tried it on fresh install of 5.0.16
after rebuilding related PHP modules.
So this is not client incompatibility issue. Unfortunately.
I'm using an apache 2 module. Does it make any difference?

------------------------------------------------------------------------

[2005-12-04 22:14:32] tony2001@php.net

Still can't reproduce it and your SQL code doesn't add any value. 
There is a known incompatibility between MySQL 4.1 client and 5.0
server, so please report that to MySQL AB.

------------------------------------------------------------------------

[2005-12-04 22:03:56] nevis2us at infoline dot su

Actually the first thing I did.
The Client API version is 5.0.16 (mysql_get_client_info)
The server is 5.0.16-log (mysql_get_server_info)

------------------------------------------------------------------------

[2005-12-04 21:39:27] tony2001@php.net

Round 2:
please check the version number of mysqlclient used with PHP.

------------------------------------------------------------------------

[2005-12-04 19:02:36] nevis2us at infoline dot su

Sorry for the first hasty report. It was misleading at best.
Here comes a simple test which hopefully may help to troubleshoot the
actual problem I'm having with
PHP 4.4.1(gentoo dev-lang/php-4.4.1-r2 ebuild) and
MySQL 5.0.16(gentoo dev-db/mysql-5.0.16-r3 ebuild)

CREATE TABLE test.tmp (x INT, y DECIMAL, z REAL);
INSERT INTO test.tmp VALUES (1, 1, 1);

SELECT x, y, z FROM test.tmp;
-- column types as returned by mysql_field_type
-- for relevant columns in the resource set
--	int		unknown         real
--	1		1		1

SELECT SUM(x), SUM(y), SUM(z) FROM test.tmp;
--	unknown	        unknown	        real
--	1		1		1

SELECT ROUND(x), ROUND(y), ROUND(z) FROM test.tmp;
--	int		unknown	        real
--	1		1		1

SELECT AVG(x), AVG(y), AVG(z) FROM test.tmp;
--	unknown	unknown	real
--	1.0000	1.0000	1

SELECT MIN(x), MIN(y), MIN(z) FROM test.tmp;
--	int		unknown	        real
--	1		1		1

SELECT x/2, y/2, z/2 FROM test.tmp;
--	unknown	unknown	real
--	0.5000	0.5000	0.5

DROP TABLE test.tmp;

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35536

-- 
Edit this bug report at http://bugs.php.net/?id=35536&edit=1


Thread (14 messages)

« previous php.bugs (#89731) next »