Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

BUG: "Format code" breaks SQL query when column contains Norwegian letters #450

Closed
asjur opened this issue Jan 5, 2023 · 2 comments
Closed
Labels
Released in BETA solved Pushed into GIT, but not yet released (after release issue will be closed)

Comments

@asjur
Copy link

asjur commented Jan 5, 2023

Describe the bug
I have a query and when I click format code the query becomes invalid.
We have a column named "født", born in English.

The selector looks like this:
date_format(født, '%d.%m.%Y') as birthdate
After clicking format code it is formatted into:
date_format(f ø dt, '%d.%m.%Y') as birthdate
which is invalid SQL.

To Reproduce
Steps to reproduce the behavior:

  1. Create query
  2. Include Norwegian characters (perhaps other special characters also cause this)
  3. Click format code.
  4. Execute query.
  5. See error.

Version Information (please complete the following information):

  • OS: Linux
  • App Version [see Help -> About]: 5.2.0
  • Install source [e.g. installer/SNAP/Docker/NPM]: Installer
  • Type - Web/Application: Application
  • Database engine: [e.g. MySQL/PostgreSQL/SQL Server]: MariaDB
@asjur
Copy link
Author

asjur commented Jan 19, 2023

This seems to be fixed in a later version of sql-formatter as their demo does not exhibit the issues I have shown here.

@janproch
Copy link
Member

@asjur Thanks for info

I will try to upgrade to current version. It seems to be big jump in version numbers, used version is 2.3.4, current version is 12.0.5

janproch added a commit that referenced this issue Jan 21, 2023
@janproch janproch reopened this Jan 21, 2023
@janproch janproch added solved Pushed into GIT, but not yet released (after release issue will be closed) Released in BETA labels Jan 21, 2023
@janproch janproch closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released in BETA solved Pushed into GIT, but not yet released (after release issue will be closed)
Projects
None yet
Development

No branches or pull requests

2 participants