|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32019 Auto EXPLAIN feature of mysql.trace_mode doesn't work on MySQL 4.1
Submitted: 2005-02-18 12:40 UTC Modified: 2005-02-19 18:24 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: Wont fix Package: MySQL related
PHP Version: 5.0.3 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-02-18 12:40 UTC]
MySQL 4.1 and greater return more information in EXPLAIN than older version. Thus "automatic EXPLAIN on every SELECT" feature of mysql.trace_mode doesn't work.

MySQL 4.0 and earlier return join type in 2nd column, 4.1 and greater in 4th column.

Moreover, full index scan is represented by "index" and not "INDEX" type. See

The problem lies on line 1256 of ext/mysql/php_mysql.c, revision 1.210.

In my eyes, this feature of mysql.trace_mode is unnecessary and can be removed as the full table scan and full index scan can be perfectly valid in some cases and shouldn't produce an error. But if it will be kept, it should work on all MySQL versions.

Reproduce code:
ini_set("mysql.trace_mode", true);
mysql_query("SELECT * FROM table");

Expected result:
Your query requires a full tablescan ...

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-19 18:24 UTC]
For MySQL Versions >= 4.1.x please use the MySQLi Extension.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 10:01:27 2024 UTC