ID: 35536 User updated by: nevis2us at infoline dot su -Summary: mysql_field_type returns unknown for INT(11) columns Reported By: nevis2us at infoline dot su -Status: Feedback +Status: Open Bug Type: MySQL related Operating System: Linux Gentoo PHP Version: 4.4.1 New Comment:
The following patch fixes NEWDECIMAL bug in PHP 4.4.1 --- ext/mysql/libmysql/mysql_com.h 2003-07-28 11:28:55.000000000 +0400 +++ ext/mysql/libmysql/mysql_com.h 2005-12-05 14:12:08.000000000 +0300 @@ -125,6 +125,7 @@ FIELD_TYPE_DATE, FIELD_TYPE_TIME, FIELD_TYPE_DATETIME, FIELD_TYPE_YEAR, FIELD_TYPE_NEWDATE, + FIELD_TYPE_NEWDECIMAL=246, FIELD_TYPE_ENUM=247, FIELD_TYPE_SET=248, FIELD_TYPE_TINY_BLOB=249, --- ext/mysql/php_mysql.c 2005-04-08 02:23:01.000000000 +0400 +++ ext/mysql/php_mysql.c 2005-12-05 14:12:56.000000000 +0300 @@ -2088,6 +2088,7 @@ case FIELD_TYPE_FLOAT: case FIELD_TYPE_DOUBLE: case FIELD_TYPE_DECIMAL: + case FIELD_TYPE_NEWDECIMAL: return "real"; break; case FIELD_TYPE_TIMESTAMP: Previous Comments: ------------------------------------------------------------------------ [2005-12-05 10:03:22] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2005-12-05 00:53:49] nevis2us at infoline dot su MySQL 5.0 Reference Manual -> 2.10.2. Upgrading from Version 4.1 to 5.0 -> C API Changes: Incompatible change: ... This error occurs because the 4.1 client libraries do not support the new MYSQL_TYPE_NEWDECIMAL type value added in 5.0 ... I do not see you handle either MYSQL_TYPE_NEWDECIMAL or FIELD_TYPE_NEWDECIMAL anywhere in php-4.1.1 source. mysqli extension in php-5.0.5 seems to be aware of this new type. But wasn't it obvious the problem reported is about mysql extension? Did you even bother to try? ------------------------------------------------------------------------ [2005-12-04 22:42:32] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ [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] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ 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