ID: 31967 User updated by: me at derrabus dot de Reported By: me at derrabus dot de -Status: Open +Status: Bogus Bug Type: MySQL related Operating System: Linux 2.6 PHP Version: 5.0.3 New Comment:
As I figured out, it's not a php problem. I could reproduce this with MySQL's C API, too. Previous Comments: ------------------------------------------------------------------------ [2005-02-14 11:40:41] me at derrabus dot de Description: ------------ I am running php 5.0.3 and MySQL 5.0.2 on my machine. The MySQL extension is compiled against a MySQL 5.0.2 client library. The code below returns weird table names (like #sql_f85_0) although the query should not affect any tables. So far, I could reproduce the problem with "SHOW TABLES" and "SHOW TABLE STATUS". If I do the same on my other machine (php 5.0.3, MySQL server & client API 4.0.22), the returned table name is empty (as it should, imho). I don't know if this is a bug of the MySQL extension or MySQL's C API, but since I cannot debug the C API right now, I'm posting this here. Reproduce code: --------------- <pre> <?php $dbh = mysql_connect('localhost', 'user', 'password'); mysql_select_db('test'); // this should be an existing DB with at least one table. $res = mysql_query('SHOW TABLES;', $dbh); $field = mysql_fetch_field($res); print_r($field); mysql_free_result($res); mysql_close($dbh); ?> </pre> Expected result: ---------------- [table] should be empty. Actual result: -------------- stdClass Object ( [name] => Tables_in_test [table] => #sql_f85_0 [def] => [max_length] => 2 [not_null] => 1 [primary_key] => 0 [multiple_key] => 0 [unique_key] => 0 [numeric] => 0 [blob] => 0 [type] => string [unsigned] => 0 [zerofill] => 0 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31967&edit=1