grammars-v4
grammars-v4 copied to clipboard
ADD and DROP SPARSE for T-SQL
Add lexer definitions for implicit tokens for T-SQL:
ANTLR4 is spitting a bunch of warnings about implicit tokens, e.g. PARSEONLY, SHOWPLAN_ALL, etc., so I explicitly defined these in the lexer file.
I also noticed a parser node NOEXEol which I assume should be NOEXEC. I found no reference to the former in the Microsoft documentation.
Define IPV4_ADDR and IPV6_ADDR components in T-SQL lexer:
IPV4_ADDR and IPV6_ADDR are now defined in terms of IPV4_OCTET and IPV6_QUARTET. There may be a more elegant way to achieve this - I did try using the regex {1-3} syntax, however the C# code generation was invalid.
Add ADD SPARSE and DROP SPARSE column modifiers to T-SQL parser
Update T-SQL examples to show ADD SPARSE and DROP SPARSE
See: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-ver15
To convert the C4 non-sparse column to a sparse column, execute the following statement.
ALTER TABLE T1
ALTER COLUMN C4 ADD SPARSE ;
GO
To convert the C4 sparse column to a nonsparse column, execute the following statement.
ALTER TABLE T1
ALTER COLUMN C4 DROP SPARSE ;
GO
What's going on with these failed CI tests? Same story with every other PR. Is there something broken in the pipeline?
Sorry, never mind. There was in fact a bug in 1928265 commit
I went ahead and added the remaining column modifiers from https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-ver15
| { ADD | DROP } { ROWGUIDCOL | PERSISTED | NOT FOR REPLICATION | SPARSE | HIDDEN }
| { ADD | DROP } MASKED [ WITH ( FUNCTION = ' mask_function ') ]
@KvanTTT good to pull?
Some issues should be fixed before merging.
HIDDEN_
FYI, we already have 'HIDDEN' literal, it is called HIDDEN_KEYWORD.
Could you please fix merge conflicts?
Thank you for the contribution and welcome to ANTLR grammars repository!