-
Notifications
You must be signed in to change notification settings - Fork 0
Add semicolon skipping in trigger/try-catch statement bodies #52
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements support for parsing CREATE DATABASE with ON clause including: - FileGroupDefinition with FILEGROUP, PRIMARY, CONTAINS FILESTREAM/MEMORY_OPTIMIZED_DATA - FileDeclaration with NAME, FILENAME, SIZE, MAXSIZE, FILEGROWTH options - LOG ON clause for log file declarations - COLLATE clause - FOR ATTACH mode Enables 2 previously failing tests: - AlterCreateDatabaseStatementTests120 - Baselines120_AlterCreateDatabaseStatementTests120
Fixes parsing of SQL with multiple semicolons before statements in: - CREATE TRIGGER statement body (after AS) - TRY block statements - CATCH block statements Also enables continuous parsing of all statements in trigger body until GO/EOF instead of stopping after first statement. Enables 3 previously failing tests: - SemicolonsBeforeStatementTests2 - CreateTriggerStatementTests - BaselinesCommon_CreateTriggerStatementTests
Implements support for: - SET ROWCOUNT <number|@variable> - SET OFFSETS <options> ON/OFF with proper option sorting - Multiple comma-separated options in PredicateSetStatement - Multiple comma-separated options in SetStatisticsStatement Also updates PredicateSetStatement and SetStatisticsStatement to use string for Options field to support comma-separated values. Enables 1 previously failing test: - BaselinesCommon_SetOffsetsAndOnOffSetTests
Add support for: - CONTAINMENT = NONE/PARTIAL option - TRANSFORM_NOISE_WORDS = ON/OFF option - DB_CHAINING ON/OFF option (without = sign) - NESTED_TRIGGERS = ON/OFF option Enabled tests: - Baselines140_CreateDatabaseTests140 - CreateDatabaseTests140
Add support for: - CREATE SERVICE with AUTHORIZATION, ON QUEUE, and contract list - ALTER SERVICE with ON QUEUE and ADD/DROP CONTRACT operations - ServiceContract type with Name and Action fields Enabled tests: - AlterCreateServiceStatementTests - Baselines90_AlterCreateServiceStatementTests
Add support for: - CREATE SYMMETRIC KEY with FROM PROVIDER clause - WITH options: PROVIDER_KEY_NAME, ALGORITHM, CREATION_DISPOSITION - ENCRYPTION BY clause with CryptoMechanism (CERTIFICATE, SYMMETRIC KEY, etc.) - DROP SYMMETRIC KEY with REMOVE PROVIDER KEY option Enabled tests: - Baselines100_SymmetricKeyStatementTests100 - SymmetricKeyStatementTests100
Add support for WITH clause containing: - CHANGE_TRACKING_CONTEXT expression - CTEs with name, optional columns, and query expression Add WithCtesAndXmlNamespaces field to: - InsertStatement - UpdateStatement - DeleteStatement Enabled tests: - Baselines100_CTEStatementTests100 - CTEStatementTests100
Update parseTableHints to recognize when table hints are separated by spaces instead of commas. This allows hints like: WITH (ROWLOCK SERIALIZABLE SNAPSHOT) in addition to comma-separated: WITH (ROWLOCK, SERIALIZABLE, SNAPSHOT) Note: Some edge cases with complex hint sequences may still need work.
- Add isTableHintToken() to check if current token is a table hint keyword - Add peekIsTableHint() to check if next token is a table hint keyword - Update parseNamedTableReference to handle space-separated hints (e.g., ROWLOCK SERIALIZABLE) - Support old-style hint syntax without WITH keyword (e.g., t2 (nowait)) Enables: FromClauseTests120
…ayloadOptions - Add EndpointAffinity, LiteralEndpointProtocolOption, SoapMethod AST types - Parse STATE (Started, Disabled, Stopped), AFFINITY (None, Admin, Integer) - Parse AS TCP/HTTP with protocol options (LISTENER_PORT, etc.) - Parse FOR SOAP with ADD/ALTER/DROP WEBMETHOD payload options - Add parseStringLiteralValue helper for proper quote stripping - Set default values only when endpoint options are actually parsed Enables: AlterEndpointStatementTests, Baselines90_AlterEndpointStatementTests
- Add PasswordAlterPrincipalOption type for ALTER USER WITH PASSWORD/OLD_PASSWORD - Update AlterUserStatement to use UserOptions field - Fix convertUserOptionKind mapping for DEFAULT_SCHEMA and DEFAULT_LANGUAGE - Implement parseAlterUserStatement WITH options parsing - Add JSON marshalling for PasswordAlterPrincipalOption Enables tests: - Baselines110_CreateAlterUserStatementTests110 - CreateAlterUserStatementTests110
- Update OpenSymmetricKeyStatement to use CryptoMechanism for DecryptionMechanism - Parse DECRYPTION BY with CERTIFICATE, ASYMMETRIC KEY, SYMMETRIC KEY, PASSWORD - Handle optional WITH PASSWORD clause for CERTIFICATE and ASYMMETRIC KEY - Support both regular strings and national strings (N'...') for passwords Enables: Baselines90_OpenSymmetricKeyStatementTests
- Add WithinGroupClause type with OrderByClause and HasGraphPath fields - Add WithinGroupClause field to FunctionCall - Parse WITHIN GROUP (ORDER BY ...) after function calls - Add JSON marshalling for WithinGroupClause - Fix string literal column aliases (AS 'alias') to use ValueExpression Enables: Baselines160_WithinGroupTests160
- Add ExecuteOptionType interface and ExecuteOption/ResultSetsExecuteOption types - Add ResultSetDefinitionType interface with Result Set/InlineResultSet/SchemaObjectResultSet types - Add ResultColumnDefinition for inline result set column definitions - Implement parseResultSetDefinitions for RESULT SETS (NONE|UNDEFINED|definitions) - Support AS OBJECT, AS FOR XML, AS TYPE, and inline column definitions - Fix ExecutableStringList parsing to include variables in Strings array - Add JSON marshalling for all new types Enables: - ExecuteStatementTests110 - Baselines110_ExecuteStatementTests110
- Add UseHintList type to ast/optimizer_hint.go for USE HINT('...')
- Add parseUseHintList function to parse hint string literals
- Add NO_PERFORMANCE_SPOOL case to optimizer hint parser
- Add UseHintList marshalling to marshal.go
- Enable Baselines140_OptimizerHintsTests140 and OptimizerHintsTests140
…tions - Add Service and Options fields to CreateRemoteServiceBindingStatement - Parse TO SERVICE clause for target service string - Parse WITH options (USER=, ANONYMOUS=ON/OFF) - Add marshalling for Service and Options fields - Enable Baselines90_CreateRemoteServiceBindingStatementTests and CreateRemoteServiceBindingStatementTests
- Add FileDeclarations, FileGroup, IsLog, UseCurrent fields to AlterDatabaseAddFileStatement - Parse file declarations for ADD FILE and ADD LOG FILE - Parse TO FILEGROUP clause for file group destination - Handle NAME option with string literal (IdentifierOrValueExpression) - Only marshal complete file declarations to avoid outputting incomplete parses - Enable AlterCreateDatabaseFilePath150 and Baselines150_AlterCreateDatabaseFilePath150
- Add statisticsOptionOrder map with IO, Profile, Time, Xml ordering - Sort SET STATISTICS options before joining them - Enables SetOffsetsAndOnOffSetTests
…ML type - Change RECEIVE statement Where field from BooleanExpression to ScalarExpression - Parse simplified WHERE clause extracting just the RHS value - Handle CONVERSATION_GROUP_ID and CONVERSATION_HANDLE keywords - Return XmlDataTypeReference for plain XML type (not just XML with schema) - Enables Baselines90_ReceiveStatementTests, ReceiveStatementTests, and BaselinesCommon_ScalarDataTypeTests
- Parse NULL and NOT NULL constraints after parameter data type - Set NullableConstraintDefinition with Nullable true/false - Enables CreateAggregateStatementTests120 and Baselines120 variant
- Parse WHERE clause as FilterPredicate for CREATE STATISTICS - Add STATS_STREAM option with binary literal support - Fix InPredicate $type marshaling (was BooleanInExpression)
- Add AST types: CreateColumnMasterKeyStatement, DropColumnMasterKeyStatement - Add parameter types for KeyStoreProviderName, KeyPath, EnclaveComputations - Implement parser for CREATE COLUMN MASTER KEY with all parameters - Add marshaling support for new types
- Add FILESTREAM_ON and enhanced TEXTIMAGE_ON parsing with string literals - Add DATA_COMPRESSION table option with partition ranges - Add TableDataCompressionOption AST type - Handle string literal quote stripping for file group names
- Add Owner and RouteOptions fields to CreateRouteStatement - Add RouteOptions field to AlterRouteStatement - Add RouteOption AST type for route options - Parse WITH clause options: BROKER_INSTANCE, SERVICE_NAME, LIFETIME, ADDRESS, MIRROR_ADDRESS - Parse AUTHORIZATION clause for route ownership
- Add Options field to CreateProcedureStatement for EXECUTE AS, RECOMPILE, ENCRYPTION - Add MethodSpecifier field for AS EXTERNAL NAME (CLR procedures) - Add ProcedureOption, ExecuteAsProcedureOption types - Parse WITH EXECUTE AS CALLER/SELF/OWNER/'string' - Parse AS EXTERNAL NAME assembly.class.method - Update ExecuteAsClause to use Literal field instead of Principal
- Add Options field to DropIndexClause for index drop options - Rename Indexes to DropIndexClauses for consistency with expected JSON - Add OnlineIndexOption, MoveToDropIndexOption, FileStreamOnDropIndexOption - Reuse DataCompressionOption from create_spatial_index_statement - Parse WITH (ONLINE, MOVE TO, FILESTREAM_ON, DATA_COMPRESSION)
- Add COLLATE handling in parseColumnDefinition - Add Collation field output in columnDefinitionToJSON
- Handle (SELECT ...) = value comparisons in boolean expressions - Add isComparisonOperator and parseComparisonAfterLeft helpers - Scalar subqueries in IF conditions now parse correctly
- Add childObjectNameToJSON for DROP STATISTICS and other statements - Use BackwardsCompatibleDropIndexClause type for legacy DROP INDEX syntax - Add Count and Identifiers to LegacyIndex for proper serialization Enables: BaselinesCommon_DropStatementsTests, Baselines100_DropIndexStatementTests100, BaselinesCommon_TSqlParserTestScript1
- Add IsEnforced field to UniqueConstraintDefinition and ForeignKeyConstraintDefinition - Parse NOT ENFORCED clause for PRIMARY KEY, UNIQUE, and FOREIGN KEY constraints - Add constraint parsing for ALTER TABLE ADD CONSTRAINT with column lists - Output IsEnforced in constraint JSON when explicitly set - Fix TriggerScope default value for DROP TRIGGER statements Enables: Baselines160_NotEnforcedConstraintTests160, NotEnforcedConstraintTests160
- Add CreateOrAlterFunctionStatement AST type - Add handling for CREATE OR ALTER FUNCTION/PROCEDURE/VIEW/TRIGGER statements - Add InlineFunctionOption parsing for WITH INLINE=ON|OFF clause - Add JSON marshaling for CreateOrAlterFunctionStatement - Enable ScalarUDFInlineTests150 (auto-enabled via check-todo)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.