Skip to content

Issue with comma with multi FROM #76

@ReynaldBarbeaut

Description

@ReynaldBarbeaut

Hello,

We have this example:

SELECT COUNT(B.*) FROM (SELECT tags.id FROM tags,
            (SELECT t.* FROM tags t WHERE t.id IN (0,1,2)) as childTag
            WHERE tags.lft < childTag.lft AND tags.rgt > childTag.rgt AND tags.depth = 2) as B

So we see that we are using 2 tables in the FROM and after MagicQuery it's removing the comma.
Response from MQ:

SELECT 
  COUNT(  `B`.*)
FROM   (SELECT 
    `tags`.`id`
FROM     `tags`     (SELECT 
      `t`.*
FROM       `tags` `t`
WHERE             `t`.`id` IN       (      0,      1,      2)) `childTag`
WHERE     (        `tags`.`lft` <     `childTag`.`lft`)
    AND (        `tags`.`rgt` >     `childTag`.`rgt`)
    AND (        `tags`.`depth` =     2)) `B`

Do you have any solution ?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions