Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL 'DELIMITER' keyword is not supported #66

Open
mike183 opened this issue Nov 16, 2022 · 0 comments
Open

MySQL 'DELIMITER' keyword is not supported #66

mike183 opened this issue Nov 16, 2022 · 0 comments

Comments

@mike183
Copy link

mike183 commented Nov 16, 2022

Currently it seems that this package doesn't support using MySQL's DELIMITER keyword which is commonly used with stored procedures which contain multiple statements.

I've created a very basic example below to highlight the issue in its simplest form:

Example Input

SELECT 1;

DELIMITER $

SELECT 2$

SELECT 3$

Expected Output (Suggestion)
Not sure if this is the best solution, but just what I would have expected to see initially.

[
  {
    start: 1,
    end: 9,
    text: 'SELECT 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 12,
    end: 23,
    text: 'DELIMITER $',
    type: 'DELIMITER',
    executionType: 'MODIFICATION',
    parameters: []
  },
  {
    start: 26,
    end: 34,
    text: 'SELECT 2$',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 37,
    end: 45,
    text: 'SELECT 3$',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  }
]

Actual Output (with strict mode disabled)

[
  {
    start: 1,
    end: 9,
    text: 'SELECT 1;',
    type: 'SELECT',
    executionType: 'LISTING',
    parameters: []
  },
  {
    start: 12,
    end: 45,
    text: 'DELIMITER $\n\nSELECT 2$\n\nSELECT 3$\n',
    type: 'UNKNOWN',
    executionType: 'UNKNOWN',
    parameters: []
  }
]

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant