|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-15 17:38 UTC] me at derrabus dot de
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
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 )