Open
Description
Describe the bug
CyberChef does not beautify a SQL 'upsert' commands correctly.
To Reproduce
Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:
- Go to https://cyberchef.amazon-corp.com/#recipe=SQL_Beautify('%5C%5Ct')&ieol=CRLF
- Click on 'Input' text are
- Paste Input (below)
- See error output (below)
Input:
INSERT INTO Table1 SELECT * FROM (SELECT :Bind1 as Field1, :Bind2 as Field2, :id as id) as new_data ON DUPLICATE KEY UPDATE Field1 = new_data.Field1, Field2 = new_data.Field2;
Erroneous output:
INSERT INTO Table1SELECT *
FROM
(SELECT :Bind1 AS Field1,
:Bind2 AS Field2,
:id AS id) AS new_data
ON DUPLICATE KEYUPDATE Field1 = new_data.Field1, Field2 = new_data.Field2;
- Error line 1: Table1SELECT <-- should have a space
- Error line 6: KEYUPDATE <-- should have a space
Expected behaviour
Valid SQL from the beautifier.
- Version: 10.19.4
- Compile time: 15/11/2024 01:34:12 UTC
- User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 - Link to reproduce
Additional context
Add any other context about the problem here.