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

Formatter breaks procedure/function code #1261

Open
theking2 opened this issue Dec 18, 2023 · 1 comment
Open

Formatter breaks procedure/function code #1261

theking2 opened this issue Dec 18, 2023 · 1 comment

Comments

@theking2
Copy link

theking2 commented Dec 18, 2023

Describe the bug
Formatter breaks correct code for procedure/function definition

To Reproduce
Steps to reproduce the behavior:

  1. original code
DROP Procedure IF EXISTS `add`;
DELIMITER $$
CREATE DEFINER=`minidwh`@`localhost` PROCEDURE `add`(IN `a` INT, IN `b` INT, OUT `result` INT)
BEGIN
set result = a + b;
END
$$
DELIMITER ;
  1. formatted code
DROP Procedure IF EXISTS `add`;
DELIMITER $$ CREATE DEFINER = `minidwh` @`localhost` PROCEDURE `add`(IN `a` INT, IN `b` INT, OUT `result` INT) BEGIN
set result = a + b;
END $$ DELIMITER;

Expected behavior
This would be acceptable:

DROP Procedure IF EXISTS `add`;
DELIMITER $$
CREATE DEFINER = `minidwh` @`localhost` PROCEDURE `add`(
  IN `a` INT,
  IN `b` INT,
  OUT `result` INT)
BEGIN
  set result = a + b;
END $$
DELIMITER;

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • SQLTools Version v0.28.1
  • VS Code Version: 1.85.1
  • OS: Windows XP
  • Driver: n/a
  • Database version: MariaDB 11.1.2

Additional context
This might have something to do with the DELIMITER problem

@gjsjohnmurray
Copy link
Collaborator

Workaround is to disable formatting by setting "sqltools.formatLanguages": [],

Please make sure you restart VS Code after you do this.

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

No branches or pull requests

2 participants