Closed GlennS closed 6 years ago
This is indeed a bug, however, the bug is that the statement begin transaction;
is considered a block start by mistake. CREATE TABLE
or any other statement should not be indented after begin transaction;
, because the indentation is based on syntactic constructs not on the logical structure of the code and begin transaction;
is a statement, just like create table
or select...
.
I will fix this, but I won't be able to do it in the next 2 weeks, unfortunately. I also cannot think of a workaround for this.
No worries, it's still far better than the default sql-mode indentation, even with this little bug.
fixed in commit ce2002ca8fe039ed1fc58b6d26246b09ca90b89f
Thanks :)
Hi,
Firstly, thanks very much for creating sql-indent. It works very well, and the customization rules are simple and clear.
I think I've noticed a bug with your block detection, where a CREATE TABLE statement forces everything to outdent all the way to the left:
It still happens if I have some other statements first:
Here's what happens if I have multiple blocks:
For now I shall work around this by disabling transaction block indentation.