Comments (3)
Thanks for reporting. Looks like another bug in parsing MySQL.
I'm not really sure how to best handle these special characters in user management related statements. I think these characters don't have any other meaning in different contexts. Possibly could treat @ as an operator.
from sql-formatter.
I tried running this code in MySQL 8.0 and got an error:
ER_PARSE_ERROR: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near '% identified by 'passwd'' at line 1
Looking at the MySQL manual for access control language I only see %
being quoted as '%'
. It only shows up as unquoted in query results. From the manual:
However, quotation marks are necessary to specify a user_name string containing special characters (such as
-
), or a host_name string containing special characters or wildcard characters such as%
(for example,'test-user'@'%.com'
).
from sql-formatter.
Oops! My bad. And thank you!
from sql-formatter.
Related Issues (20)
- [FORMATTING] Problem with parenthesis... HOT 3
- [FORMATTING] sql-formatter crash on `grant` with `*` HOT 1
- [FORMATTING] Unusual formatting of RETURNING clause HOT 2
- Feature Request: SQL in SQL prettification HOT 5
- Inserting white space at start of query HOT 1
- [FORMATTING] Inconsistent formatting for queries with `$$` HOT 5
- Incorrect indentation in PostgreSQL `DELETE FROM ... USING` HOT 1
- Feature Request: Remove unnecessary parentheses HOT 2
- [FORMATTING] PostgreSQL `TYPE` keyword used as identifier causes indentation errors HOT 1
- Unable to format SQL: Error: Parse error: Unexpected "$$ DECLARE" HOT 1
- [FORMATTING] Parenthesized query starting directly after CTE HOT 2
- [FORMATTING] `"indentStyle": "tabularLeft"` behavior changed in v15.0.0 HOT 4
- [FORMATTING] `IDENTIFIED` recognized as identifier
- PHP code inside SQL HOT 5
- Have compiled js file download? HOT 1
- Feature Request: support for BETWEEN AND clause HOT 3
- Feature Request: Comma Position HOT 2
- [FORMATTING] Missing indent level of comment after CASE HOT 1
- [FORMATTING] % modulo formatting causes parse error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql-formatter.