Skip to content

MySQL '#' syntax for inline comments isn't supported #65

Description

@mike183

Currently it seems that this package doesn't support using the # syntax for inline comments in MySQL.

Example Input

select 1;
# inline comment
select 2

Expected Output

[
  {
    start: 1,
    end: 9,
    text: 'select 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 29,
    end: 37,
    text: 'select 2\n',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  }
]

Actual Output (with strict mode disabled)

[
  {
    start: 1,
    end: 9,
    text: 'select 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 11,
    end: 36,
    text: '# inline comment\nselect 2\n',
    type: 'UNKNOWN',
    executionType: 'UNKNOWN',
    parameters: []
  }
]

Demo
Incase it's useful, I've also created a functioning demo here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions