Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Unwanted line break before on conversion error in subquery #266

Closed
PhilippSalvisberg opened this issue Dec 21, 2023 · 0 comments · Fixed by #273
Closed

Unwanted line break before on conversion error in subquery #266

PhilippSalvisberg opened this issue Dec 21, 2023 · 0 comments · Fixed by #273
Assignees
Labels
bug Something isn't working
Milestone

Comments

@PhilippSalvisberg
Copy link
Collaborator

Original statement and expected result:

select *
  from (
          select to_number(
                    sys_context('userenv', 'current_schemaid') default null on conversion error,
                    '99999990',
                    q'[nls_numeric_characters='.,']'
                 ) as model_id
            from dual
       );

Formatter result with default settings:

select *
  from (
          select to_number(
                    sys_context('userenv', 'current_schemaid') default null
              on conversion error,
                    '99999990',
                    q'[nls_numeric_characters='.,']'
                 ) as model_id
            from dual
       );

See the line break before on conversion error and the wrong indentation. Indentation is expected to be the same as the previous and next line (if a line break would be necessary).

Formatting just the subquery like this:

select to_number(
          sys_context('userenv', 'current_schemaid') default null on conversion error,
          '99999990',
          q'[nls_numeric_characters='.,']'
       ) as model_id
  from dual;

works as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant