Skip to content

Reformatting does not work as expected for INNER JOIN without the optional INNER key word #221

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
kjetil-kilhavn opened this issue Dec 8, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@kjetil-kilhavn
Copy link

ABAP Cleaner version 1.12.0 with default configuration

    SELECT
      FROM c_respymgmtteamheadertp AS team_header
      JOIN c_respymgmtteamownertp AS team_owner ON team_owner~respymgmtteamid = team_header~respymgmtteamid
      FIELDS DISTINCT team_owner~respymgmtteamowneruserid
      WHERE team_header~respymgmtteamnameforsearch = @team_name_for_search
        AND team_owner~teamownerenddate   >= @at_date
        AND team_owner~teamownerstartdate <= @at_date
      INTO TABLE @result.

Gets reformatted to

    SELECT
      FROM                                                                           c_respymgmtteamheadertp AS team_header
      JOIN c_respymgmtteamownertp
           AS team_owner ON team_owner~respymgmtteamid = team_header~respymgmtteamid
      FIELDS DISTINCT team_owner~respymgmtteamowneruserid
      WHERE team_header~respymgmtteamnameforsearch = @team_name_for_search
        AND team_owner~teamownerenddate   >= @at_date
        AND team_owner~teamownerstartdate <= @at_date
      INTO TABLE @result.

Whereas if I add the optional INNER key word it works as expected

    SELECT
      FROM c_respymgmtteamheadertp AS team_header
             INNER JOIN
               c_respymgmtteamownertp AS team_owner ON team_owner~respymgmtteamid = team_header~respymgmtteamid
      FIELDS DISTINCT team_owner~respymgmtteamowneruserid
      WHERE team_header~respymgmtteamnameforsearch = @team_name_for_search
        AND team_owner~teamownerenddate   >= @at_date 
        AND team_owner~teamownerstartdate <= @at_date
      INTO TABLE @result.
@jmgrassau jmgrassau added the bug Something isn't working label Dec 8, 2023
@jmgrassau jmgrassau self-assigned this Dec 8, 2023
@jmgrassau
Copy link
Member

Hi Kjetil,

thank you very much for reporting this – I indeed overlooked that 'INNER' is optional! This will be fixed with the next release.

image

Kind regards,
Jörg-Michael

P.S.: I really like "1983 Commodore 64" in your profile – same here! :-)

@jmgrassau
Copy link
Member

Hi Kjetil,

thanks again for reporting this! This bug should now be fixed in version 1.13.0, which was just released.

Kind regards,
Jörg-Michael

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants