Skip to content

'on' as a string literal is reformatted to '\n ON' #178

@AndrewAPAC

Description

@AndrewAPAC

Describe the bug

When inserting and selecting a string literal 'on' it is detected as a reserved word and formatted inside the quotes: select * from x where name = 'on' becomes select * from x where name = '\n ON'

To Reproduce

Format the above query

s = format_sql("select * from rooms where command = 'on'")
print(s)
sys.exit(0)

Output:

SELECT *
FROM   rooms
WHERE  command = '
        ON'

Expected behavior

SELECT *
FROM   rooms
WHERE  command = 'on'

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions