Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @llali @allancascante @kburtram @aaskhan @benjind
* @llali @allancascante @kburtram @aaskhan @benjind @mhyon
21 changes: 20 additions & 1 deletion SqlScriptDom/Parser/TSql/Ast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,7 @@
<Member Name="SearchCondition" Type="BooleanExpression" Summary="The search condition."/>
<Member Name="QualifiedJoinType" Type="QualifiedJoinType" GenerateUpdatePositionInfoCall="false" Summary="The join type."/>
<Member Name="JoinHint" Type="JoinHint" GenerateUpdatePositionInfoCall="false" Summary="The join hint."/>
<Member Name="JoinHintColumnsCount" Type="IntegerLiteral" Summary="The optional columns count argument of the REDISTRIBUTE join hint."/>
</Class>
<Class Name="OdbcQualifiedJoinTableReference" Base="TableReference" Summary="Represents the odbc qualified join in a from clause.">
<Member Name="TableReference" Type="TableReference" Summary="The table reference."/>
Expand Down Expand Up @@ -4827,34 +4828,52 @@
<Class Name="AIAnalyzeSentimentFunctionCall" Base="PrimaryExpression" Summary="Represents the ai_analyze_sentiment built-in.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Input text to analyze sentiment for." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when sentiment analysis fails." />
</Class>
<Class Name="AIFixGrammarFunctionCall" Base="PrimaryExpression" Summary="Represents the ai_fix_grammar built-in.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Input text to fix grammar for." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when grammar correction fails." />
</Class>
<Class Name="AIClassifyFunctionCall" Base="PrimaryExpression" Summary="Represents AI_CLASSIFY(...) function call.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Variable or column identifier providing the text to classify." />
<Member Name="Labels" Type="ScalarExpression" Collection="true" Summary="One or more label expressions (at least two)." />
<Member Name="Labels" Type="ScalarExpression" Collection="true" Summary="One or more label expressions." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when classification fails." />
</Class>
<Class Name="AIExtractFunctionCall" Base="PrimaryExpression" Summary="Represents the ai_extract built-in.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Input text to extract from." />
<Member Name="Labels" Type="ScalarExpression" Collection="true" Summary="One or more label expressions." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when extraction fails." />
</Class>
<Class Name="AIGenerateResponseFunctionCall" Base="PrimaryExpression" Summary="Represents AI_GENERATE_RESPONSE(...) function call.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="PromptPart1" Type="ScalarExpression" Summary="First prompt part (required)." />
<Member Name="PromptPart2" Type="ScalarExpression" Summary="Second prompt part (optional)." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when response generation fails." />
</Class>
<Class Name="AISummarizeFunctionCall" Base="PrimaryExpression" Summary="Represents AI_SUMMARIZE(...) function call.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Variable or column identifier providing the text to summarize." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when summarization fails." />
</Class>
<Class Name="AITranslateFunctionCall" Base="PrimaryExpression" Summary="Represents AI_TRANSLATE(...) function call.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Text to translate; variable or column reference." />
<Member Name="Language" Type="ScalarExpression" Summary="Target language; typically string literal or identifier." />
<Member Name="OnErrorClause" Type="AIOnErrorClause" Summary="Optional behavior when translation fails." />
</Class>
<Class Name="AIOnErrorClause" Abstract="true" Summary="Represents the ON ERROR clause of an AI function call." />
<Class Name="AIErrorOnErrorClause" Base="AIOnErrorClause" Summary="Represents ERROR ON ERROR behavior for AI functions.">
<InheritedClass Name="AIOnErrorClause" />
</Class>
<Class Name="AINullOnErrorClause" Base="AIOnErrorClause" Summary="Represents NULL ON ERROR behavior for AI functions.">
<InheritedClass Name="AIOnErrorClause" />
</Class>
<Class Name="AIDefaultOnErrorClause" Base="AIOnErrorClause" Summary="Represents DEFAULT 'literal' ON ERROR behavior for AI functions.">
<InheritedClass Name="AIOnErrorClause" />
<Member Name="Value" Type="StringLiteral" Summary="The literal returned when the AI function fails." />
</Class>
<Class Name="InvokeExternalApiFunctionCall" Base="PrimaryExpression" Summary="Represents INVOKE_EXTERNAL_API(...) function call.">
<InheritedClass Name="PrimaryExpression" />
Expand Down
1 change: 1 addition & 0 deletions SqlScriptDom/Parser/TSql/CodeGenerationSupporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ internal static class CodeGenerationSupporter
internal const string RemoteServiceName = "REMOTE_SERVICE_NAME";
internal const string Remove = "REMOVE";
internal const string Reorganize = "REORGANIZE";
internal const string Redistribute = "REDISTRIBUTE";
internal const string Repeatable = "REPEATABLE";
internal const string RepeatableRead = "REPEATABLEREAD";
internal const string Replace = "REPLACE";
Expand Down
10 changes: 9 additions & 1 deletion SqlScriptDom/Parser/TSql/JoinHint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public enum JoinHint
/// <summary>
/// REMOTE was used.
/// </summary>
Remote = 4
Remote = 4,
/// <summary>
/// REPLICATE was used.
/// </summary>
Replicate = 5,
/// <summary>
/// REDISTRIBUTE was used.
/// </summary>
Redistribute = 6
}
}
4 changes: 2 additions & 2 deletions SqlScriptDom/Parser/TSql/TSql160.g
Original file line number Diff line number Diff line change
Expand Up @@ -32292,7 +32292,7 @@ regularBuiltInFunctionCall [FunctionCall vParent]
UpdateTokenInfo(vParent,tRParen);
}
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down Expand Up @@ -32323,7 +32323,7 @@ ignoreRespectNullsRegularBuiltInFunctionCall [FunctionCall vParent]
ignoreRespectNulls [vParent]
)?
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down
10 changes: 5 additions & 5 deletions SqlScriptDom/Parser/TSql/TSql170.g
Original file line number Diff line number Diff line change
Expand Up @@ -22209,14 +22209,14 @@ simpleOptimizerHint returns [OptimizerHint vResult = FragmentFactory.CreateFragm
{
Match(tForce, CodeGenerationSupporter.Force);
vResult.HintKind = OptimizerHintKind.ForceOrder;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
|
Distributed tPlan1:Plan
{
Match(tForce, CodeGenerationSupporter.Force);
vResult.HintKind = OptimizerHintKind.ForceDistributedPlan;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
|
tSingle:Identifier tNode:Identifier tPlan2:Plan
Expand All @@ -22225,7 +22225,7 @@ simpleOptimizerHint returns [OptimizerHint vResult = FragmentFactory.CreateFragm
Match(tSingle, CodeGenerationSupporter.Single);
Match(tNode, CodeGenerationSupporter.GraphNode); // NODE
vResult.HintKind = OptimizerHintKind.ForceSingleNodePlan;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
)
| tHash:Identifier Group
Expand Down Expand Up @@ -33460,7 +33460,7 @@ regularBuiltInFunctionCall [FunctionCall vParent]
UpdateTokenInfo(vParent,tRParen);
}
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down Expand Up @@ -33491,7 +33491,7 @@ ignoreRespectNullsRegularBuiltInFunctionCall [FunctionCall vParent]
ignoreRespectNulls [vParent]
)?
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down
15 changes: 10 additions & 5 deletions SqlScriptDom/Parser/TSql/TSql180.g
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,11 @@ alterDatabaseScopedGenericOption[bool forSecondary] returns [GenericConfiguratio
}
vResult.GenericOptionState = vValue;
}
|
tRollback:Rollback
{
vResult.GenericOptionState = CreateIdentifierOrScalarExpressionFromIdentifier(CreateIdentifierFromToken(tRollback));
}
|
vValue = stringOrSignedIntegerOrIdentifier
{
Expand Down Expand Up @@ -22438,14 +22443,14 @@ simpleOptimizerHint returns [OptimizerHint vResult = FragmentFactory.CreateFragm
{
Match(tForce, CodeGenerationSupporter.Force);
vResult.HintKind = OptimizerHintKind.ForceOrder;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
|
Distributed tPlan1:Plan
{
Match(tForce, CodeGenerationSupporter.Force);
vResult.HintKind = OptimizerHintKind.ForceDistributedPlan;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
|
tSingle:Identifier tNode:Identifier tPlan2:Plan
Expand All @@ -22454,7 +22459,7 @@ simpleOptimizerHint returns [OptimizerHint vResult = FragmentFactory.CreateFragm
Match(tSingle, CodeGenerationSupporter.Single);
Match(tNode, CodeGenerationSupporter.GraphNode); // NODE
vResult.HintKind = OptimizerHintKind.ForceSingleNodePlan;
UpdateTokenInfo(vResult, tForce);
UpdateTokenInfo(vResult, tForce);
}
)
| tHash:Identifier Group
Expand Down Expand Up @@ -33698,7 +33703,7 @@ regularBuiltInFunctionCall [FunctionCall vParent]
UpdateTokenInfo(vParent,tRParen);
}
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down Expand Up @@ -33729,7 +33734,7 @@ ignoreRespectNullsRegularBuiltInFunctionCall [FunctionCall vParent]
ignoreRespectNulls [vParent]
)?
(
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier)) ||
{(LA(1)==Over && (LA(2)==LeftParenthesis || LA(2)==Identifier || LA(2)==QuotedIdentifier)) ||
(NextTokenMatches(CodeGenerationSupporter.Within) && LA(2)==Group && LA(3)==LeftParenthesis) }?
withinGroupOrOverClause [vParent]
)?
Expand Down
5 changes: 4 additions & 1 deletion SqlScriptDom/Parser/TSql/TSql80ParserBaseInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2365,12 +2365,15 @@ internal static ParseError ProcessTokenStreamRecognitionException(antlr.TokenStr
antlr.NoViableAltForCharException notViableAltForCharException = exception.recog as antlr.NoViableAltForCharException;
if (notViableAltForCharException != null)
{
string foundChar = notViableAltForCharException.foundChar == antlr.CharScanner.EOF_CHAR
? "<EOF>"
: Convert.ToChar(notViableAltForCharException.foundChar).ToString();
return TSql80ParserBaseInternal.CreateParseError("SQL46010",
lastOffset,
notViableAltForCharException.getLine(),
notViableAltForCharException.getColumn(),
TSqlParserResource.SQL46010Message,
notViableAltForCharException.foundChar.ToString());
foundChar);
}

// TODO, sacaglar: This is translated into an internal error. Is there a runtime log for this?
Expand Down
Loading
Loading