Bug #46438 Query Analyzer formatter adds extra table
Submitted: 28 Jul 2009 20:06 Modified: 18 Mar 2010 8:55
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Web Severity:S3 (Non-critical)
Version:2.1.0.1080 OS:Any
Assigned to: Kay Roepke CPU Architecture:Any

[28 Jul 2009 20:06] Diego Medina
Description:
There are cases where the formatted query shows an extra table

How to repeat:
As discussed with the dev. yo ucan see it on this example:

(Note that hibtype1_ is there twice) making the sql invalid.

select 
hibinvento0_.instance_id as instance1_5_2_,
hibinvento0_.instance_name as instance2_5_2_,
hibinvento0_.type_id as type3_5_2_,
hibinvento0_.parent_id as parent4_5_2_,
hibinvento0_.insert_count as insert5_5_2_,
hibtype1_.type_id as type1_3_0_,
hibtype1_.type_name as type2_3_0_,
hibtype1_.namespace_id as namespace3_3_0_,
hibtype1_.insert_count as insert4_3_0_,
hibnamespa2_.namespace_id as namespace1_2_1_,
hibnamespa2_.namespace as namespace2_1_

from
inventory_instances
hibinvento0_ inner join
inventory_types
hibtype1_ on hibinvento0_.type_id=hibtype1_.type_id
left outer join
inventory_namespaces
hibnamespa2_ on hibtype1_.namespace_id=hibnamespa2_.namespace_id
where
hibinvento0_.instance_id=1835721

SELECT
hibinvento0_.instance_id AS instance1_5_2_,
hibinvento0_.instance_name AS instance2_5_2_,
hibinvento0_.type_id AS type3_5_2_,
hibinvento0_.parent_id AS parent4_5_2_,
hibinvento0_.insert_count AS insert5_5_2_,
hibtype1_.type_id AS type1_3_0_,
hibtype1_.type_name AS type2_3_0_,
hibtype1_.namespace_id AS namespace3_3_0_,
hibtype1_.insert_count AS insert4_3_0_,
hibnamespa2_.namespace_id AS namespace1_2_1_,
hibnamespa2_.namespace AS namespace2_1_

FROM
inventory_instances
AS hibinvento0_ INNER JOIN
inventory_types
AS hibtype1_ JOIN
inventory_types
AS hibtype1_ ON hibinvento0_.type_id = hibtype1_.type_id
LEFT OUTER JOIN
inventory_namespaces
AS hibnamespa2_ ON hibinvento0_.type_id = hibtype1_.type_id
WHERE
hibinvento0_.instance_id = 1835721
[19 Feb 2010 19:30] Enterprise Tools JIRA Robot
Josh Sled writes: 
Likely fixed as part of parser commit:

revno: 122
revision-id: kay@sun.com-20100217151411-0r640oufog3ezib7
parent: jsled@asynchronous.org-20100216221055-twvt7l9hnd5hsnhw
committer: Kay Roepke <kay@sun.com>
branch nick: parser-sled
timestamp: Wed 2010-02-17 16:14:11 +0100
message:
  fix invalid reference to rewrite stream of join_condition_both which could cause a wrong tree to be constructed in case of nested joins

incorporated into MEM trunk as:

revno: 7906
revision-id: jsled@asynchronous.org-20100217203930-9hfov7mvruip7be3
parent: jsled@asynchronous.org-20100217181411-fe10putzen9nn3sc
committer: Josh Sled <jsled@asynchronous.org>
branch nick: local
timestamp: Wed 2010-02-17 15:39:30 -0500
message:
  EM-2882: sanity check html formated sql queries
[19 Feb 2010 19:31] Enterprise Tools JIRA Robot
Josh Sled writes: 
This is AIB in server build >= 2.2.0.1628
[17 Mar 2010 20:41] Enterprise Tools JIRA Robot
Diego Medina writes: 
Verified fixed on 2.2.0.1628
[18 Mar 2010 8:55] MC Brown
An entry has been added to the 2.2.0 changelog: 

Some queries would show multiple tables in the <guilabel>Example Query</guilabel> displayed within the Query Analyzer.