alex-hhh / emacs-sql-indent

Syntax based indentation for SQL files inside GNU Emacs
GNU General Public License v3.0
121 stars 18 forks source link

mysql elseif keyword not recognized #81

Closed matteo-l closed 5 years ago

matteo-l commented 5 years ago

The indentation of the keyword, elseif, used by mysql, is different from the one of the keyword elsif used by other sql dialects, as you can see from the following example

IF (SELECT ID
      FROM SomeTable
     WHERE SomeField > 0) IS NULL
THEN
  SET SomeVar = TRUE;
ELSIF
  SET SomeVar = FALSE;
END IF;

IF (SELECT ID
      FROM SomeTable
     WHERE SomeField > 0) IS NULL
THEN
  SET SomeVar = TRUE;
  ELSEIF
    SET SomeVar = FALSE;
  END IF;
alex-hhh commented 5 years ago

Thanks for reporting this, I pushed fix to the master branch, can you please verify it.

matteo-l commented 5 years ago

The fix works for me. Thank you