#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: roxanne at archinoetics dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: I found this post, and it worked for me: http://marc.info/?l=php-internals&m=123825270214607&w=2 Reprinted below: Put the PHP directory first in your path, doing so will make the mysql extensions use the php's libmysql. Previous Comments: [2009-04-05 06:11:22] tbee at tbee dot org Yes. I have the same problem. Clean WindowsXP install with only the installer of MySQL, Apache and PHP: Faulting application httpd.exe, version 2.2.11.0, faulting module php_mysqli.dll, version 5.2.9.9, fault address 0x2b6b. All result class methods work fine except the "fetch_*"; I get a result object, the num_rows and field_count return correct values, I can traverse the metadata and display the fieldnames, but whenever I try to access the actual value Apache crashes. This is the crashing (test) code: echo $pResult->field_count; for ($i = 0; $i < $pResult->field_count; $i++) { echo $pResult->fetch_field_direct($i)->name; } return $pResult->fetch_assoc(); If the last line is dummified all the fieldname being displayed and there is no crash. Naturally I tried several other method calls to get to the data. [2009-03-28 14:42:17] Arvids dot Godjuks at gmail dot com I use one provided by PHP zip package. I just grabed it from php.net, unziped and that's all. [2009-03-28 14:24:11] Arvids dot Godjuks at gmail dot com Here is a trace with StraceNT: http://paste.php.lv/685ed5f46f22a328fee5ca8fd917d70a?lang=text [2009-03-28 14:22:39] paj...@php.net Do not use mysql 5.1 libmysql DLL with PHP. See the numerous other reports and explainations for more details. [2009-03-28 14:06:00] Arvids dot Godjuks at gmail dot com I'm having same issue with my aplication on my Windows home box. I have Windows XP with SP3. Apache 2.2.11: Server version: Apache/2.2.11 (Win32) Server built: Dec 10 2008 00:10:06 PHP 5.2.9-1 (built: Mar 5 2009 20:02:28) And latest MySQL GA - 5.1.33 I have latest PECL pack avaliable for windows. I'm not really familiar with debugging on windows, so you will have to tell me what to do to get debug info. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: tbee at tbee dot org Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Yes. I have the same problem. Clean WindowsXP install with only the installer of MySQL, Apache and PHP: Faulting application httpd.exe, version 2.2.11.0, faulting module php_mysqli.dll, version 5.2.9.9, fault address 0x2b6b. All result class methods work fine except the "fetch_*"; I get a result object, the num_rows and field_count return correct values, I can traverse the metadata and display the fieldnames, but whenever I try to access the actual value Apache crashes. This is the crashing (test) code: echo $pResult->field_count; for ($i = 0; $i < $pResult->field_count; $i++) { echo $pResult->fetch_field_direct($i)->name; } return $pResult->fetch_assoc(); If the last line is dummified all the fieldname being displayed and there is no crash. Naturally I tried several other method calls to get to the data. Previous Comments: [2009-03-28 14:42:17] Arvids dot Godjuks at gmail dot com I use one provided by PHP zip package. I just grabed it from php.net, unziped and that's all. [2009-03-28 14:24:11] Arvids dot Godjuks at gmail dot com Here is a trace with StraceNT: http://paste.php.lv/685ed5f46f22a328fee5ca8fd917d70a?lang=text [2009-03-28 14:22:39] paj...@php.net Do not use mysql 5.1 libmysql DLL with PHP. See the numerous other reports and explainations for more details. [2009-03-28 14:06:00] Arvids dot Godjuks at gmail dot com I'm having same issue with my aplication on my Windows home box. I have Windows XP with SP3. Apache 2.2.11: Server version: Apache/2.2.11 (Win32) Server built: Dec 10 2008 00:10:06 PHP 5.2.9-1 (built: Mar 5 2009 20:02:28) And latest MySQL GA - 5.1.33 I have latest PECL pack avaliable for windows. I'm not really familiar with debugging on windows, so you will have to tell me what to do to get debug info. [2005-11-04 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: Arvids dot Godjuks at gmail dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: I use one provided by PHP zip package. I just grabed it from php.net, unziped and that's all. Previous Comments: [2009-03-28 14:24:11] Arvids dot Godjuks at gmail dot com Here is a trace with StraceNT: http://paste.php.lv/685ed5f46f22a328fee5ca8fd917d70a?lang=text [2009-03-28 14:22:39] paj...@php.net Do not use mysql 5.1 libmysql DLL with PHP. See the numerous other reports and explainations for more details. [2009-03-28 14:06:00] Arvids dot Godjuks at gmail dot com I'm having same issue with my aplication on my Windows home box. I have Windows XP with SP3. Apache 2.2.11: Server version: Apache/2.2.11 (Win32) Server built: Dec 10 2008 00:10:06 PHP 5.2.9-1 (built: Mar 5 2009 20:02:28) And latest MySQL GA - 5.1.33 I have latest PECL pack avaliable for windows. I'm not really familiar with debugging on windows, so you will have to tell me what to do to get debug info. [2005-11-04 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-10-28 10:28:16] mark at tranchant dot plus dot com Another data point: mysql_fetch_assoc() (the mysql extension, not the mysqli one) works fine with similar code and calls to add_assoc_zval. I tried "forward-porting" some of the differences to the mysqli code but just broke it completely. Is there an easy way to add debug printing to a log file or syslog into the module code? I want to explore the output values from MYSQLI_FETCH_RESOURCE(), which is different from the ZEND_FETCH_RESOURCE used in mysql. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: Arvids dot Godjuks at gmail dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Here is a trace with StraceNT: http://paste.php.lv/685ed5f46f22a328fee5ca8fd917d70a?lang=text Previous Comments: [2009-03-28 14:22:39] paj...@php.net Do not use mysql 5.1 libmysql DLL with PHP. See the numerous other reports and explainations for more details. [2009-03-28 14:06:00] Arvids dot Godjuks at gmail dot com I'm having same issue with my aplication on my Windows home box. I have Windows XP with SP3. Apache 2.2.11: Server version: Apache/2.2.11 (Win32) Server built: Dec 10 2008 00:10:06 PHP 5.2.9-1 (built: Mar 5 2009 20:02:28) And latest MySQL GA - 5.1.33 I have latest PECL pack avaliable for windows. I'm not really familiar with debugging on windows, so you will have to tell me what to do to get debug info. [2005-11-04 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-10-28 10:28:16] mark at tranchant dot plus dot com Another data point: mysql_fetch_assoc() (the mysql extension, not the mysqli one) works fine with similar code and calls to add_assoc_zval. I tried "forward-porting" some of the differences to the mysqli code but just broke it completely. Is there an easy way to add debug printing to a log file or syslog into the module code? I want to explore the output values from MYSQLI_FETCH_RESOURCE(), which is different from the ZEND_FETCH_RESOURCE used in mysql. [2005-10-27 20:55:32] mark at tranchant dot plus dot com Upgraded from gcc-3.3.2 to gcc-3.4.4, completely recompiled PHP-5.0.5. No change: bug still there. Also tried allocating a static buffer (char tmp[64];) and strcpy'ing fields[i].name to it, then using that in the add_assoc calls. No joy there, either. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: Arvids dot Godjuks at gmail dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: I'm having same issue with my aplication on my Windows home box. I have Windows XP with SP3. Apache 2.2.11: Server version: Apache/2.2.11 (Win32) Server built: Dec 10 2008 00:10:06 PHP 5.2.9-1 (built: Mar 5 2009 20:02:28) And latest MySQL GA - 5.1.33 I have latest PECL pack avaliable for windows. I'm not really familiar with debugging on windows, so you will have to tell me what to do to get debug info. Previous Comments: [2005-11-04 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-10-28 10:28:16] mark at tranchant dot plus dot com Another data point: mysql_fetch_assoc() (the mysql extension, not the mysqli one) works fine with similar code and calls to add_assoc_zval. I tried "forward-porting" some of the differences to the mysqli code but just broke it completely. Is there an easy way to add debug printing to a log file or syslog into the module code? I want to explore the output values from MYSQLI_FETCH_RESOURCE(), which is different from the ZEND_FETCH_RESOURCE used in mysql. [2005-10-27 20:55:32] mark at tranchant dot plus dot com Upgraded from gcc-3.3.2 to gcc-3.4.4, completely recompiled PHP-5.0.5. No change: bug still there. Also tried allocating a static buffer (char tmp[64];) and strcpy'ing fields[i].name to it, then using that in the add_assoc calls. No joy there, either. [2005-10-27 16:10:31] mark at tranchant dot plus dot com Gah. I think I've got as far as my abilities allow. Basically, if either add_assoc_zval or add_assoc_null are called with anything other than a static string, crash. Even: char *tmp; ... sprintf(tmp, "hello"); add_assoc_zval(return_value, tmp, res); fails, although: add_assoc_zval(return_value, "hello", res); does not, and $array['hello'] returns the first value as expected. There is no issue with the mysql_fetch_fields() function: the failure occurs even with that commented out. I've traced the code path down to _zend_hash_add_or_update(), but I don't know enough to see any problems on the way there. *** #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) *** ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); } *** static inline int zend_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDa taSize, void **pDest) \ { HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); } *** #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) *** [2005-10-27 14:22:43] mark at tranchant dot plus dot com I've just written a quick C program using the MySQL C API and can confirm that mysql_fetch_fields() works fine. The problem does appear to be with the PHP code. I'll keep looking. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Another data point: mysql_fetch_assoc() (the mysql extension, not the mysqli one) works fine with similar code and calls to add_assoc_zval. I tried "forward-porting" some of the differences to the mysqli code but just broke it completely. Is there an easy way to add debug printing to a log file or syslog into the module code? I want to explore the output values from MYSQLI_FETCH_RESOURCE(), which is different from the ZEND_FETCH_RESOURCE used in mysql. Previous Comments: [2005-10-27 20:55:32] mark at tranchant dot plus dot com Upgraded from gcc-3.3.2 to gcc-3.4.4, completely recompiled PHP-5.0.5. No change: bug still there. Also tried allocating a static buffer (char tmp[64];) and strcpy'ing fields[i].name to it, then using that in the add_assoc calls. No joy there, either. [2005-10-27 16:10:31] mark at tranchant dot plus dot com Gah. I think I've got as far as my abilities allow. Basically, if either add_assoc_zval or add_assoc_null are called with anything other than a static string, crash. Even: char *tmp; ... sprintf(tmp, "hello"); add_assoc_zval(return_value, tmp, res); fails, although: add_assoc_zval(return_value, "hello", res); does not, and $array['hello'] returns the first value as expected. There is no issue with the mysql_fetch_fields() function: the failure occurs even with that commented out. I've traced the code path down to _zend_hash_add_or_update(), but I don't know enough to see any problems on the way there. *** #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) *** ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); } *** static inline int zend_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDa taSize, void **pDest) \ { HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); } *** #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) *** [2005-10-27 14:22:43] mark at tranchant dot plus dot com I've just written a quick C program using the MySQL C API and can confirm that mysql_fetch_fields() works fine. The problem does appear to be with the PHP code. I'll keep looking. [2005-10-27 13:09:52] mark at tranchant dot plus dot com Not easily, no. I'm not set up for external users. If it would really help, I could try. I've done some more digging: In ext/mysqli/mysqli.c, there is the following code: line 653: if (fetchtype & MYSQLI_ASSOC) { fields = mysql_fetch_fields(result); } line 677: if (fetchtype & MYSQLI_ASSOC) { if (fetchtype & MYSQLI_NUM) { ZVAL_ADDREF(res); } add_assoc_zval(return_value, fields[i].name, res); } line 687: if (fetchtype & MYSQLI_ASSOC) { add_assoc_null(return_value, fields[i].name); } If I change the fields[i].name argument to "hello", the offending functions then work. I successfully used fetch_array with MYSQLI_BOTH, and $array['hello'] referred to the last element in the fetched array. It seems as though the call to mysql_fetch_fields (part of the MySQL API) is failing, which is not being detected by the PHP code. More soon... [2005-10-27 12:34:42] [EMAIL PROTECTED] Is there any chance to get an account on this server? 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Upgraded from gcc-3.3.2 to gcc-3.4.4, completely recompiled PHP-5.0.5. No change: bug still there. Also tried allocating a static buffer (char tmp[64];) and strcpy'ing fields[i].name to it, then using that in the add_assoc calls. No joy there, either. Previous Comments: [2005-10-27 16:10:31] mark at tranchant dot plus dot com Gah. I think I've got as far as my abilities allow. Basically, if either add_assoc_zval or add_assoc_null are called with anything other than a static string, crash. Even: char *tmp; ... sprintf(tmp, "hello"); add_assoc_zval(return_value, tmp, res); fails, although: add_assoc_zval(return_value, "hello", res); does not, and $array['hello'] returns the first value as expected. There is no issue with the mysql_fetch_fields() function: the failure occurs even with that commented out. I've traced the code path down to _zend_hash_add_or_update(), but I don't know enough to see any problems on the way there. *** #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) *** ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); } *** static inline int zend_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDa taSize, void **pDest) \ { HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); } *** #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) *** [2005-10-27 14:22:43] mark at tranchant dot plus dot com I've just written a quick C program using the MySQL C API and can confirm that mysql_fetch_fields() works fine. The problem does appear to be with the PHP code. I'll keep looking. [2005-10-27 13:09:52] mark at tranchant dot plus dot com Not easily, no. I'm not set up for external users. If it would really help, I could try. I've done some more digging: In ext/mysqli/mysqli.c, there is the following code: line 653: if (fetchtype & MYSQLI_ASSOC) { fields = mysql_fetch_fields(result); } line 677: if (fetchtype & MYSQLI_ASSOC) { if (fetchtype & MYSQLI_NUM) { ZVAL_ADDREF(res); } add_assoc_zval(return_value, fields[i].name, res); } line 687: if (fetchtype & MYSQLI_ASSOC) { add_assoc_null(return_value, fields[i].name); } If I change the fields[i].name argument to "hello", the offending functions then work. I successfully used fetch_array with MYSQLI_BOTH, and $array['hello'] referred to the last element in the fetched array. It seems as though the call to mysql_fetch_fields (part of the MySQL API) is failing, which is not being detected by the PHP code. More soon... [2005-10-27 12:34:42] [EMAIL PROTECTED] Is there any chance to get an account on this server? [2005-10-27 12:29:06] mark at tranchant dot plus dot com Yeah, I was right. Latest CVS snapshot (php5-STABLE-200510270836) does not fix the issue. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Gah. I think I've got as far as my abilities allow. Basically, if either add_assoc_zval or add_assoc_null are called with anything other than a static string, crash. Even: char *tmp; ... sprintf(tmp, "hello"); add_assoc_zval(return_value, tmp, res); fails, although: add_assoc_zval(return_value, "hello", res); does not, and $array['hello'] returns the first value as expected. There is no issue with the mysql_fetch_fields() function: the failure occurs even with that commented out. I've traced the code path down to _zend_hash_add_or_update(), but I don't know enough to see any problems on the way there. *** #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) *** ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) { return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); } *** static inline int zend_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDa taSize, void **pDest) \ { HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest)); return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest); } *** #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) *** Previous Comments: [2005-10-27 14:22:43] mark at tranchant dot plus dot com I've just written a quick C program using the MySQL C API and can confirm that mysql_fetch_fields() works fine. The problem does appear to be with the PHP code. I'll keep looking. [2005-10-27 13:09:52] mark at tranchant dot plus dot com Not easily, no. I'm not set up for external users. If it would really help, I could try. I've done some more digging: In ext/mysqli/mysqli.c, there is the following code: line 653: if (fetchtype & MYSQLI_ASSOC) { fields = mysql_fetch_fields(result); } line 677: if (fetchtype & MYSQLI_ASSOC) { if (fetchtype & MYSQLI_NUM) { ZVAL_ADDREF(res); } add_assoc_zval(return_value, fields[i].name, res); } line 687: if (fetchtype & MYSQLI_ASSOC) { add_assoc_null(return_value, fields[i].name); } If I change the fields[i].name argument to "hello", the offending functions then work. I successfully used fetch_array with MYSQLI_BOTH, and $array['hello'] referred to the last element in the fetched array. It seems as though the call to mysql_fetch_fields (part of the MySQL API) is failing, which is not being detected by the PHP code. More soon... [2005-10-27 12:34:42] [EMAIL PROTECTED] Is there any chance to get an account on this server? [2005-10-27 12:29:06] mark at tranchant dot plus dot com Yeah, I was right. Latest CVS snapshot (php5-STABLE-200510270836) does not fix the issue. [2005-10-27 12:05:40] mark at tranchant dot plus dot com In fact, any function that tries to do the assoc thing fails: fetch_object fails, as does fetch_array with a resulttype of MYSQLI_ASSOC or MYSQLI_BOTH. fetch_array works when called with MYSQLI_NUM. I'm just compiling the latest CVS snapshot, although the diff 'twixt 5.05's ext/mysqli directory and the CVS one doesn't give me much hope... 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: I've just written a quick C program using the MySQL C API and can confirm that mysql_fetch_fields() works fine. The problem does appear to be with the PHP code. I'll keep looking. Previous Comments: [2005-10-27 13:09:52] mark at tranchant dot plus dot com Not easily, no. I'm not set up for external users. If it would really help, I could try. I've done some more digging: In ext/mysqli/mysqli.c, there is the following code: line 653: if (fetchtype & MYSQLI_ASSOC) { fields = mysql_fetch_fields(result); } line 677: if (fetchtype & MYSQLI_ASSOC) { if (fetchtype & MYSQLI_NUM) { ZVAL_ADDREF(res); } add_assoc_zval(return_value, fields[i].name, res); } line 687: if (fetchtype & MYSQLI_ASSOC) { add_assoc_null(return_value, fields[i].name); } If I change the fields[i].name argument to "hello", the offending functions then work. I successfully used fetch_array with MYSQLI_BOTH, and $array['hello'] referred to the last element in the fetched array. It seems as though the call to mysql_fetch_fields (part of the MySQL API) is failing, which is not being detected by the PHP code. More soon... [2005-10-27 12:34:42] [EMAIL PROTECTED] Is there any chance to get an account on this server? [2005-10-27 12:29:06] mark at tranchant dot plus dot com Yeah, I was right. Latest CVS snapshot (php5-STABLE-200510270836) does not fix the issue. [2005-10-27 12:05:40] mark at tranchant dot plus dot com In fact, any function that tries to do the assoc thing fails: fetch_object fails, as does fetch_array with a resulttype of MYSQLI_ASSOC or MYSQLI_BOTH. fetch_array works when called with MYSQLI_NUM. I'm just compiling the latest CVS snapshot, although the diff 'twixt 5.05's ext/mysqli directory and the CVS one doesn't give me much hope... [2005-10-27 11:15:40] mark at tranchant dot plus dot com I have the same problem. System is self-compiled PHP-5.05 and binary distribution of MySQL-5.0.13, running on self-compiled Apache 2.0.55 on x86 Linux. mysqli_fetch_row() works as advertised, but mysqli_fetch_assoc() fails silently, both called procedurally or in OO style. 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Not easily, no. I'm not set up for external users. If it would really help, I could try. I've done some more digging: In ext/mysqli/mysqli.c, there is the following code: line 653: if (fetchtype & MYSQLI_ASSOC) { fields = mysql_fetch_fields(result); } line 677: if (fetchtype & MYSQLI_ASSOC) { if (fetchtype & MYSQLI_NUM) { ZVAL_ADDREF(res); } add_assoc_zval(return_value, fields[i].name, res); } line 687: if (fetchtype & MYSQLI_ASSOC) { add_assoc_null(return_value, fields[i].name); } If I change the fields[i].name argument to "hello", the offending functions then work. I successfully used fetch_array with MYSQLI_BOTH, and $array['hello'] referred to the last element in the fetched array. It seems as though the call to mysql_fetch_fields (part of the MySQL API) is failing, which is not being detected by the PHP code. More soon... Previous Comments: [2005-10-27 12:34:42] [EMAIL PROTECTED] Is there any chance to get an account on this server? [2005-10-27 12:29:06] mark at tranchant dot plus dot com Yeah, I was right. Latest CVS snapshot (php5-STABLE-200510270836) does not fix the issue. [2005-10-27 12:05:40] mark at tranchant dot plus dot com In fact, any function that tries to do the assoc thing fails: fetch_object fails, as does fetch_array with a resulttype of MYSQLI_ASSOC or MYSQLI_BOTH. fetch_array works when called with MYSQLI_NUM. I'm just compiling the latest CVS snapshot, although the diff 'twixt 5.05's ext/mysqli directory and the CVS one doesn't give me much hope... [2005-10-27 11:15:40] mark at tranchant dot plus dot com I have the same problem. System is self-compiled PHP-5.05 and binary distribution of MySQL-5.0.13, running on self-compiled Apache 2.0.55 on x86 Linux. mysqli_fetch_row() works as advertised, but mysqli_fetch_assoc() fails silently, both called procedurally or in OO style. [2005-09-23 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". 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/34515 -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: Yeah, I was right. Latest CVS snapshot (php5-STABLE-200510270836) does not fix the issue. Previous Comments: [2005-10-27 12:05:40] mark at tranchant dot plus dot com In fact, any function that tries to do the assoc thing fails: fetch_object fails, as does fetch_array with a resulttype of MYSQLI_ASSOC or MYSQLI_BOTH. fetch_array works when called with MYSQLI_NUM. I'm just compiling the latest CVS snapshot, although the diff 'twixt 5.05's ext/mysqli directory and the CVS one doesn't give me much hope... [2005-10-27 11:15:40] mark at tranchant dot plus dot com I have the same problem. System is self-compiled PHP-5.05 and binary distribution of MySQL-5.0.13, running on self-compiled Apache 2.0.55 on x86 Linux. mysqli_fetch_row() works as advertised, but mysqli_fetch_assoc() fails silently, both called procedurally or in OO style. [2005-09-23 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-09-15 17:18:57] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip [2005-09-15 17:12:54] jaba at inbox dot lv Description: I am developing on Windows XP but the application production version is supposed to be on Debian. Seems like debian MySQLi is not working properly. I can use mysqli_fetch_row or $result->fetch_row, but whenever I use $result->fetch_assoc() or mysqli_fetch_assoc($result) on the same result, the application crashes and I receive no output at all. Reproduce code: --- query($query)) { while ($row = $result->fetch_assoc()) { echo ''; print_r($row); echo ''; } $result->close(); } $mysqli->close(); ?> Expected result: string representation of associated arrays of table rows Actual result: -- nothing. application dies whenever you call mysqli_fetch_assoc -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: In fact, any function that tries to do the assoc thing fails: fetch_object fails, as does fetch_array with a resulttype of MYSQLI_ASSOC or MYSQLI_BOTH. fetch_array works when called with MYSQLI_NUM. I'm just compiling the latest CVS snapshot, although the diff 'twixt 5.05's ext/mysqli directory and the CVS one doesn't give me much hope... Previous Comments: [2005-10-27 11:15:40] mark at tranchant dot plus dot com I have the same problem. System is self-compiled PHP-5.05 and binary distribution of MySQL-5.0.13, running on self-compiled Apache 2.0.55 on x86 Linux. mysqli_fetch_row() works as advertised, but mysqli_fetch_assoc() fails silently, both called procedurally or in OO style. [2005-09-23 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-09-15 17:18:57] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip [2005-09-15 17:12:54] jaba at inbox dot lv Description: I am developing on Windows XP but the application production version is supposed to be on Debian. Seems like debian MySQLi is not working properly. I can use mysqli_fetch_row or $result->fetch_row, but whenever I use $result->fetch_assoc() or mysqli_fetch_assoc($result) on the same result, the application crashes and I receive no output at all. Reproduce code: --- query($query)) { while ($row = $result->fetch_assoc()) { echo ''; print_r($row); echo ''; } $result->close(); } $mysqli->close(); ?> Expected result: string representation of associated arrays of table rows Actual result: -- nothing. application dies whenever you call mysqli_fetch_assoc -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1
#34515 [Com]: mysqli_fetch_assoc crashes application
ID: 34515 Comment by: mark at tranchant dot plus dot com Reported By: jaba at inbox dot lv Status: No Feedback Bug Type: MySQLi related Operating System: Debian GNU/Linux PHP Version: 5.0.5 New Comment: I have the same problem. System is self-compiled PHP-5.05 and binary distribution of MySQL-5.0.13, running on self-compiled Apache 2.0.55 on x86 Linux. mysqli_fetch_row() works as advertised, but mysqli_fetch_assoc() fails silently, both called procedurally or in OO style. Previous Comments: [2005-09-23 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-09-15 17:18:57] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip [2005-09-15 17:12:54] jaba at inbox dot lv Description: I am developing on Windows XP but the application production version is supposed to be on Debian. Seems like debian MySQLi is not working properly. I can use mysqli_fetch_row or $result->fetch_row, but whenever I use $result->fetch_assoc() or mysqli_fetch_assoc($result) on the same result, the application crashes and I receive no output at all. Reproduce code: --- query($query)) { while ($row = $result->fetch_assoc()) { echo ''; print_r($row); echo ''; } $result->close(); } $mysqli->close(); ?> Expected result: string representation of associated arrays of table rows Actual result: -- nothing. application dies whenever you call mysqli_fetch_assoc -- Edit this bug report at http://bugs.php.net/?id=34515&edit=1