Skip to content

Bug report: <Insert title here> #2067

Open
@Craig-Steele

Description

@Craig-Steele

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:

  1. Go to https://cyberchef.amazon-corp.com/#recipe=SQL_Beautify('%5C%5Ct')&ieol=CRLF
  2. Click on 'Input' text are
  3. Paste Input (below)
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions