Skip to content

Username with @ in a DEFINER attribute throws parsing Error #897

@jannisbaudisch

Description

@jannisbaudisch

Describe the bug
I have a sql file with a CREATE DEFINER='root'@'localhost' TRIGGER ... Statement. When i Format the Document I get a VSCode Error message

Unable to format SQL:
Error: Parse error: Unexpected "@'localhos" at line 5 column 22

I tried this with 'root'@'localhost' as well as root@localhost.
In my case there is a long TRIGGER-statement following the CREATE DEFINER... statement. The exception was raised even without the long statement, when I used the example code on the mysql documentation page

Expected behavior
No exception

Actual behavior
Exception

Usage
Called from VScode:

Version: 1.103.2 (user setup)
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0

Tried the > Format Document as well as the > Format Selection Command.

Used on a mariadb/mysql type file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions