php.net |  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
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: vrana@php.net Assigned:
Status: Wont fix Package: MySQL related
PHP Version: 5.0.3 OS: All
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vrana@php.net
New email:
PHP Version: OS:

 

 [2005-02-18 12:40 UTC] vrana@php.net
Description:
------------
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 http://dev.mysql.com/doc/mysql/en/explain.html

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:
---------------
<?php
ini_set("mysql.trace_mode", true);
mysql_query("SELECT * FROM table");
?>


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

Actual result:
--------------
Nothing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-19 18:24 UTC] georg@php.net
For MySQL Versions >= 4.1.x please use the MySQLi Extension.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC