atom / language-sql

SQL package for Atom
Other
38 stars 50 forks source link

CHANGE keyword not highlighted #82

Closed mcandre closed 4 years ago

mcandre commented 5 years ago

Prerequisites

Description

The legacy MySQL 5.7- CHANGE keyword in ALTER TABLE... statements is not being highlighted.

Steps to Reproduce

  1. Write a MySQL 5.7 compatible query to rename a column with ALTER TABLE... CHANGE...

Expected behavior:

CHANGE is highlighted as a keyword.

Actual behavior:

CHANGE is treated as a user field.

Reproduces how often:

Always

Versions

$ apm --version
apm  2.2.4
npm  6.2.0
node 8.9.3 x64
atom 1.39.0
python 2.7.15
git 2.18.0
rsese commented 5 years ago

Thanks for the report - do you have a full minimal example that we can copy/paste?

Also, is this keyword MySQL specific or is it supported by other SQL variants?

Arcanemagus commented 4 years ago

CHANGE is a MySQL extension to standard SQL.

According to the latest MySQL documentation this is a non-standard extension to the standard.

An example usage seems to be statements like this:

ALTER TABLE t1 CHANGE a b BIGINT NOT NULL;

Looking over the equivalent PostgreSQL documentation it seems that most of the functionality under ALTER TABLE is non-standard in many implementations, as the standard doesn't specify enough for anything beyond basic functionality. I don't have direct access to the standard though so I'm just guessing here.

nickolay commented 4 years ago

I don't have direct access to the standard

You might find these resources useful in the future: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#_11_10_alter_table_statement and https://crate.io/docs/sql-99/en/latest/chapters/18.html#alter-table-statement (they confirm that CHANGE is non-standard).

no-response[bot] commented 4 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.