How can we help you today? How can we help you today?

FULL OUTER JOIN not wrapping correctly

When I use a FULL OUTER JOIN in my code, it appears not to correctly associated the "FULL" keyword with the rest of the JOIN. The problem doesn't seem to apply to any of the other JOIN types.

Starting code:
;WITH a AS (SELECT 1 AS x)
SELECT *
FROM a 
	FULL OUTER JOIN a a2 ON a.x = a2.x
	LEFT OUTER JOIN a a3 ON a.x = a3.x
	RIGHT OUTER JOIN a a4 ON a.x = a4.x

After formatting:
;WITH a AS
(
	SELECT 1 AS x
)
SELECT
	a.x
   ,a2.x
   ,a3.x
   ,a4.x
FROM a FULL
	OUTER JOIN a a2
		   ON a.x = a2.x
	LEFT OUTER JOIN a a3
		ON a.x = a3.x
	RIGHT OUTER JOIN a a4
		ON a.x = a4.x

Notice that the LEFT and RIGHT keywords are on the same line as the OUTER JOIN syntax, but the FULL keyword is left hanging out on the line above, and the ON is weirdly indented.


Expected result after formatting:
;WITH a AS
(
	SELECT 1 AS x
)
SELECT
	a.x
   ,a2.x
   ,a3.x
   ,a4.x
FROM a 
	FULL OUTER JOIN a a2
		ON a.x = a2.x
	LEFT OUTER JOIN a a3
		ON a.x = a3.x
	RIGHT OUTER JOIN a a4
		ON a.x = a4.x

This would make the formatting of FULL OUTER JOIN consistent with the rest.
a.higgins
0

Comments

4 comments

  • David Priddle
    Hi a.higgins,

    We have fixed this privately and will have it out in the next release.

    Thanks for sending through these reports!

    Best regards,

    David
    David Priddle
    0
  • a.higgins
    That's a remarkable response time! I look forward to the next release then.
    a.higgins
    0
  • Aaron L
    Hi a.higgins,

    The new beta build has been released and should have a fix for this if you'd like to give it a try.

    Thanks again for reporting these issues!
    Aaron L
    0
  • a.higgins
    The latest release fixes this problem as well. Nice work!
    a.higgins
    0

Add comment

Please sign in to leave a comment.