mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Move managed parser into its own project (test code coverage) (#774)
* Created New ManagedBatchParser project in .NetStandard * Addressing PR Comments * Resolve 'No Repository' warning. * Move batch parser tests to integrations test project * Fix SLN file
This commit is contained in:
@@ -61,6 +61,9 @@ EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.Contracts", "src\Microsoft.SqlTools.Hosting.Contracts\Microsoft.SqlTools.Hosting.Contracts.csproj", "{BE04C532-C9AE-4C32-9283-F6629112228B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.ServiceLayer", "src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj", "{835EDEB4-289B-4D6D-A9A0-609E43A87D6E}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C} = {3F82F298-700A-48DF-8A69-D048DFBA782C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.UnitTests", "test\Microsoft.SqlTools.Hosting.UnitTests\Microsoft.SqlTools.Hosting.UnitTests.csproj", "{BA3C9622-ABFF-45A2-91AA-CC5189083256}"
|
||||
EndProject
|
||||
@@ -90,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TVFSample", "test\TVFSample\TVFSample.csproj", "{1FC10261-EC0D-416A-9B66-C55F0A34968C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.ManagedBatchParser", "src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj", "{3F82F298-700A-48DF-8A69-D048DFBA782C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -217,6 +222,12 @@ Global
|
||||
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Integration|Any CPU.Build.0 = Release|Any CPU
|
||||
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Integration|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Integration|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -244,6 +255,7 @@ Global
|
||||
{8EE5B06A-2EB2-4A47-812D-1D5B98D0F49A} = {AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}
|
||||
{EF02F89F-417E-4A40-B7E6-B102EE2DF24D} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
|
||||
{1FC10261-EC0D-416A-9B66-C55F0A34968C} = {AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}
|
||||
{3F82F298-700A-48DF-8A69-D048DFBA782C} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B31CDF4B-2851-45E5-8C5F-BE97125D9DD8}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal enum BatchParserAction
|
||||
public enum BatchParserAction
|
||||
{
|
||||
Continue = 0,
|
||||
Abort = 1
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal sealed class BatchParserException : Exception
|
||||
public sealed class BatchParserException : Exception
|
||||
{
|
||||
const string ErrorCodeName = "ErrorCode";
|
||||
const string BeginName = "Begin";
|
||||
@@ -10,6 +10,7 @@ using System.IO;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal enum ErrorCode
|
||||
public enum ErrorCode
|
||||
{
|
||||
ErrorCodeBase = 0,
|
||||
|
||||
@@ -11,13 +11,14 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Single batch of SQL command
|
||||
/// </summary>
|
||||
internal class Batch
|
||||
public class Batch
|
||||
{
|
||||
#region Private methods
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Error totalAffectedRows for a Batch
|
||||
/// </summary>
|
||||
internal class BatchErrorEventArgs : EventArgs
|
||||
public class BatchErrorEventArgs : EventArgs
|
||||
{
|
||||
#region Private Fields
|
||||
private string message = string.Empty;
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Event args for notification about non-error message
|
||||
/// </summary>
|
||||
internal class BatchMessageEventArgs : EventArgs
|
||||
public class BatchMessageEventArgs : EventArgs
|
||||
{
|
||||
private readonly string message = string.Empty;
|
||||
private readonly string detailedMessage = string.Empty;
|
||||
@@ -10,7 +10,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Class that parses queries into batches
|
||||
/// </summary>
|
||||
internal class BatchParser :
|
||||
public class BatchParser :
|
||||
ICommandHandler,
|
||||
IVariableResolver
|
||||
{
|
||||
@@ -153,7 +153,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
throw new NotImplementedException("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
internal void DisableVariableSubstitution()
|
||||
public void DisableVariableSubstitution()
|
||||
{
|
||||
variableSubstitutionDisabled = true;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Class associated with batch parser execution errors
|
||||
/// </summary>
|
||||
internal class BatchParserExecutionErrorEventArgs : BatchErrorEventArgs
|
||||
public class BatchParserExecutionErrorEventArgs : BatchErrorEventArgs
|
||||
{
|
||||
private readonly ScriptMessageType messageType;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Class associated with batch parser execution finished event
|
||||
/// </summary>
|
||||
internal class BatchParserExecutionFinishedEventArgs : EventArgs
|
||||
public class BatchParserExecutionFinishedEventArgs : EventArgs
|
||||
{
|
||||
|
||||
private readonly Batch batch = null;
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Class associated with batch parser execution start event
|
||||
/// </summary>
|
||||
internal class BatchParserExecutionStartEventArgs : EventArgs
|
||||
public class BatchParserExecutionStartEventArgs : EventArgs
|
||||
{
|
||||
|
||||
private readonly Batch batch = null;
|
||||
@@ -8,13 +8,14 @@ using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for handling SQL CMD by Batch Parser
|
||||
/// </summary>
|
||||
internal class BatchParserSqlCmd : BatchParser
|
||||
public class BatchParserSqlCmd : BatchParser
|
||||
{
|
||||
/// <summary>
|
||||
/// The internal variables that can be used in SqlCommand substitution.
|
||||
@@ -36,14 +37,14 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
||||
internal ConnectionChangedDelegate ConnectionChanged
|
||||
|
||||
public ConnectionChangedDelegate ConnectionChanged
|
||||
{
|
||||
get { return connectionChangedDelegate; }
|
||||
set { connectionChangedDelegate = value; }
|
||||
}
|
||||
|
||||
internal ErrorActionChangedDelegate ErrorActionChanged
|
||||
public ErrorActionChangedDelegate ErrorActionChanged
|
||||
{
|
||||
get { return errorActionChangedDelegate; }
|
||||
set { errorActionChangedDelegate = value; }
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Class associated with setting batch results
|
||||
/// </summary>
|
||||
internal class BatchResultSetEventArgs : EventArgs
|
||||
public class BatchResultSetEventArgs : EventArgs
|
||||
{
|
||||
|
||||
private readonly IDataReader dataReader = null;
|
||||
@@ -12,6 +12,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
@@ -20,7 +21,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// <summary>
|
||||
/// Execution engine class which executed the parsed batches
|
||||
/// </summary>
|
||||
internal class ExecutionEngine : IDisposable
|
||||
public class ExecutionEngine : IDisposable
|
||||
{
|
||||
|
||||
#region Private fields
|
||||
@@ -8,7 +8,7 @@ using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal class ExecutionEngineConditions
|
||||
public class ExecutionEngineConditions
|
||||
{
|
||||
|
||||
#region Private fields
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal interface IBatchEventsHandler
|
||||
public interface IBatchEventsHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// fired when there is an error message from the server
|
||||
@@ -10,7 +10,7 @@ using System.Data.SqlClient;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal class ScriptExecutionArgs : EventArgs
|
||||
public class ScriptExecutionArgs : EventArgs
|
||||
{
|
||||
private IDbConnection connection;
|
||||
private IBatchEventsHandler batchEventHandlers;
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal class ScriptExecutionFinishedEventArgs : EventArgs
|
||||
public class ScriptExecutionFinishedEventArgs : EventArgs
|
||||
{
|
||||
internal ScriptExecutionFinishedEventArgs(ScriptExecutionResult result)
|
||||
{
|
||||
@@ -8,7 +8,7 @@ using System;
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
[Flags]
|
||||
internal enum ScriptExecutionResult
|
||||
public enum ScriptExecutionResult
|
||||
{
|
||||
Success = 0x1,
|
||||
Failure = 0x2,
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal enum ScriptMessageType
|
||||
public enum ScriptMessageType
|
||||
{
|
||||
FatalError,
|
||||
Error,
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
[System.Flags]
|
||||
internal enum ShowPlanType
|
||||
public enum ShowPlanType
|
||||
{
|
||||
None = 0x0,
|
||||
ActualExecutionShowPlan = 0x1,
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
{
|
||||
internal struct TextSpan
|
||||
public struct TextSpan
|
||||
{
|
||||
public int iEndIndex;
|
||||
public int iEndLine;
|
||||
@@ -7,7 +7,7 @@ using System.IO;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal interface ICommandHandler
|
||||
public interface ICommandHandler
|
||||
{
|
||||
BatchParserAction Go(TextBlock batch, int repeatCount);
|
||||
BatchParserAction OnError(Token token, OnErrorAction action);
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal interface IVariableResolver
|
||||
public interface IVariableResolver
|
||||
{
|
||||
string GetVariable(PositionStruct pos, string name);
|
||||
void SetVariable(PositionStruct pos, string name, string value);
|
||||
@@ -8,13 +8,14 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Lexer class for the SMO Batch Parser
|
||||
/// </summary>
|
||||
internal sealed class Lexer : IDisposable
|
||||
public sealed class Lexer : IDisposable
|
||||
{
|
||||
private LexerInput currentInput;
|
||||
private bool popInputAtNextConsume;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal enum LexerTokenType
|
||||
public enum LexerTokenType
|
||||
{
|
||||
None,
|
||||
Text,
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
/// This class gives information about lines being parsed by
|
||||
/// the Batch Parser
|
||||
/// </summary>
|
||||
class LineInfo
|
||||
public class LineInfo
|
||||
{
|
||||
private IEnumerable<Token> tokens;
|
||||
private IEnumerable<VariableReference> variableRefs;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal enum OnErrorAction
|
||||
public enum OnErrorAction
|
||||
{
|
||||
Ignore = 0,
|
||||
Exit = 1,
|
||||
@@ -10,13 +10,14 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ManagedBatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
/// <summary>
|
||||
/// The Parser class on which the Batch Parser is based on
|
||||
/// </summary>
|
||||
internal sealed class Parser : IDisposable
|
||||
public sealed class Parser : IDisposable
|
||||
{
|
||||
private readonly ICommandHandler commandHandler;
|
||||
private Lexer lexer;
|
||||
@@ -224,7 +225,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void Parse()
|
||||
public void Parse()
|
||||
{
|
||||
Accept();
|
||||
ParseLines();
|
||||
@@ -8,7 +8,7 @@ using System;
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
[Serializable]
|
||||
internal struct PositionStruct
|
||||
public struct PositionStruct
|
||||
{
|
||||
private readonly int line;
|
||||
private readonly int column;
|
||||
@@ -3,25 +3,25 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal class TextBlock
|
||||
public class TextBlock
|
||||
{
|
||||
private readonly Parser parser;
|
||||
private readonly IEnumerable<Token> tokens;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the TextBlock class
|
||||
/// Constructor for the TextBlock class
|
||||
/// </summary>
|
||||
public TextBlock(Parser parser, Token token) : this(parser, new[] { token })
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the TextBlock class
|
||||
/// Constructor for the TextBlock class
|
||||
/// </summary>
|
||||
public TextBlock(Parser parser, IEnumerable<Token> tokens)
|
||||
{
|
||||
@@ -63,6 +63,5 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
lineInfo = new LineInfo(tokens, variableRefs);
|
||||
text = sb.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
{
|
||||
internal sealed class Token
|
||||
public sealed class Token
|
||||
{
|
||||
/// <summary>
|
||||
/// Token class used by the lexer in Batch Parser
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
/// <summary>
|
||||
/// Class for reference of variables used by the lexer
|
||||
/// </summary>
|
||||
internal sealed class VariableReference
|
||||
public sealed class VariableReference
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor method for VariableReference class
|
||||
381
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.cs
Normal file
381
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.cs
Normal file
@@ -0,0 +1,381 @@
|
||||
// WARNING:
|
||||
// This file was generated by the Microsoft DataWarehouse String Resource Tool 1.37.0.0
|
||||
// from information in sr.strings
|
||||
// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
|
||||
//
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser
|
||||
{
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Globalization;
|
||||
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class SR
|
||||
{
|
||||
protected SR()
|
||||
{ }
|
||||
|
||||
public static CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.Culture;
|
||||
}
|
||||
set
|
||||
{
|
||||
Keys.Culture = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string EE_BatchSqlMessageNoProcedureInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchSqlMessageNoProcedureInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchSqlMessageWithProcedureInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchSqlMessageWithProcedureInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchSqlMessageNoLineInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchSqlMessageNoLineInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchError_Exception
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchError_Exception);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchExecutionInfo_RowsAffected
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchExecutionInfo_RowsAffected);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionNotYetCompleteError
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionNotYetCompleteError);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ScriptError_Error
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ScriptError_Error);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ScriptError_ParsingSyntax
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ScriptError_ParsingSyntax);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ScriptError_FatalError
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ScriptError_FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionInfo_FinalizingLoop
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionInfo_FinalizingLoop);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionInfo_QueryCancelledbyUser
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionInfo_QueryCancelledbyUser);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchExecutionError_Halting
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchExecutionError_Halting);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_BatchExecutionError_Ignoring
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_BatchExecutionError_Ignoring);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionInfo_InitializingLoop
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionInfo_InitializingLoop);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionError_CommandNotSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionError_CommandNotSupported);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ExecutionError_VariableNotFound
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ExecutionError_VariableNotFound);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionEngineError
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineError);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionError
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionError);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionEngineBatchMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionEngineBatchResultSetProcessing
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchResultSetProcessing);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionEngineBatchResultSetFinished
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchResultSetFinished);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParserWrapperExecutionEngineBatchCancelling
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchCancelling);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EE_ScriptError_Warning
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EE_ScriptError_Warning);
|
||||
}
|
||||
}
|
||||
|
||||
public static string TroubleshootingAssistanceMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.TroubleshootingAssistanceMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParser_CircularReference
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParser_CircularReference);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParser_CommentNotTerminated
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParser_CommentNotTerminated);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParser_StringNotTerminated
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParser_StringNotTerminated);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParser_IncorrectSyntax
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParser_IncorrectSyntax);
|
||||
}
|
||||
}
|
||||
|
||||
public static string BatchParser_VariableNotDefined
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.BatchParser_VariableNotDefined);
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Keys
|
||||
{
|
||||
static ResourceManager resourceManager = new ResourceManager("Microsoft.SqlTools.ManagedBatchParser.Localization.SR", typeof(SR).GetTypeInfo().Assembly);
|
||||
|
||||
static CultureInfo _culture = null;
|
||||
|
||||
|
||||
public const string EE_BatchSqlMessageNoProcedureInfo = "EE_BatchSqlMessageNoProcedureInfo";
|
||||
|
||||
|
||||
public const string EE_BatchSqlMessageWithProcedureInfo = "EE_BatchSqlMessageWithProcedureInfo";
|
||||
|
||||
|
||||
public const string EE_BatchSqlMessageNoLineInfo = "EE_BatchSqlMessageNoLineInfo";
|
||||
|
||||
|
||||
public const string EE_BatchError_Exception = "EE_BatchError_Exception";
|
||||
|
||||
|
||||
public const string EE_BatchExecutionInfo_RowsAffected = "EE_BatchExecutionInfo_RowsAffected";
|
||||
|
||||
|
||||
public const string EE_ExecutionNotYetCompleteError = "EE_ExecutionNotYetCompleteError";
|
||||
|
||||
|
||||
public const string EE_ScriptError_Error = "EE_ScriptError_Error";
|
||||
|
||||
|
||||
public const string EE_ScriptError_ParsingSyntax = "EE_ScriptError_ParsingSyntax";
|
||||
|
||||
|
||||
public const string EE_ScriptError_FatalError = "EE_ScriptError_FatalError";
|
||||
|
||||
|
||||
public const string EE_ExecutionInfo_FinalizingLoop = "EE_ExecutionInfo_FinalizingLoop";
|
||||
|
||||
|
||||
public const string EE_ExecutionInfo_QueryCancelledbyUser = "EE_ExecutionInfo_QueryCancelledbyUser";
|
||||
|
||||
|
||||
public const string EE_BatchExecutionError_Halting = "EE_BatchExecutionError_Halting";
|
||||
|
||||
|
||||
public const string EE_BatchExecutionError_Ignoring = "EE_BatchExecutionError_Ignoring";
|
||||
|
||||
|
||||
public const string EE_ExecutionInfo_InitializingLoop = "EE_ExecutionInfo_InitializingLoop";
|
||||
|
||||
|
||||
public const string EE_ExecutionError_CommandNotSupported = "EE_ExecutionError_CommandNotSupported";
|
||||
|
||||
|
||||
public const string EE_ExecutionError_VariableNotFound = "EE_ExecutionError_VariableNotFound";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionEngineError = "BatchParserWrapperExecutionEngineError";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionError = "BatchParserWrapperExecutionError";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionEngineBatchMessage = "BatchParserWrapperExecutionEngineBatchMessage";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionEngineBatchResultSetProcessing = "BatchParserWrapperExecutionEngineBatchResultSetProcessing";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionEngineBatchResultSetFinished = "BatchParserWrapperExecutionEngineBatchResultSetFinished";
|
||||
|
||||
|
||||
public const string BatchParserWrapperExecutionEngineBatchCancelling = "BatchParserWrapperExecutionEngineBatchCancelling";
|
||||
|
||||
|
||||
public const string EE_ScriptError_Warning = "EE_ScriptError_Warning";
|
||||
|
||||
|
||||
public const string TroubleshootingAssistanceMessage = "TroubleshootingAssistanceMessage";
|
||||
|
||||
|
||||
public const string BatchParser_CircularReference = "BatchParser_CircularReference";
|
||||
|
||||
|
||||
public const string BatchParser_CommentNotTerminated = "BatchParser_CommentNotTerminated";
|
||||
|
||||
|
||||
public const string BatchParser_StringNotTerminated = "BatchParser_StringNotTerminated";
|
||||
|
||||
|
||||
public const string BatchParser_IncorrectSyntax = "BatchParser_IncorrectSyntax";
|
||||
|
||||
|
||||
public const string BatchParser_VariableNotDefined = "BatchParser_VariableNotDefined";
|
||||
|
||||
|
||||
private Keys()
|
||||
{ }
|
||||
|
||||
public static CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return _culture;
|
||||
}
|
||||
set
|
||||
{
|
||||
_culture = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetString(string key)
|
||||
{
|
||||
return resourceManager.GetString(key, _culture);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
236
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.resx
Normal file
236
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.resx
Normal file
@@ -0,0 +1,236 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype=">text/microsoft-resx</resheader>
|
||||
<resheader name="version=">2.0</resheader>
|
||||
<resheader name="reader=">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer=">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1="><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing=">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64=">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64=">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata=">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true=">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded=">
|
||||
<xsd:element name="metadata=">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly=">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data=">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader=">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="EE_BatchSqlMessageNoProcedureInfo" xml:space="preserve">
|
||||
<value>Msg {0}, Level {1}, State {2}, Line {3}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchSqlMessageWithProcedureInfo" xml:space="preserve">
|
||||
<value>Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchSqlMessageNoLineInfo" xml:space="preserve">
|
||||
<value>Msg {0}, Level {1}, State {2}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchError_Exception" xml:space="preserve">
|
||||
<value>An error occurred while the batch was being processed. The error message is: {0}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchExecutionInfo_RowsAffected" xml:space="preserve">
|
||||
<value>({0} row(s) affected)</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionNotYetCompleteError" xml:space="preserve">
|
||||
<value>The previous execution is not yet complete.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ScriptError_Error" xml:space="preserve">
|
||||
<value>A scripting error occurred.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ScriptError_ParsingSyntax" xml:space="preserve">
|
||||
<value>Incorrect syntax was encountered while {0} was being parsed.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ScriptError_FatalError" xml:space="preserve">
|
||||
<value>A fatal error occurred.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionInfo_FinalizingLoop" xml:space="preserve">
|
||||
<value>Batch execution completed {0} times...</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionInfo_QueryCancelledbyUser" xml:space="preserve">
|
||||
<value>You cancelled the query.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchExecutionError_Halting" xml:space="preserve">
|
||||
<value>An error occurred while the batch was being executed.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_BatchExecutionError_Ignoring" xml:space="preserve">
|
||||
<value>An error occurred while the batch was being executed, but the error has been ignored.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionInfo_InitializingLoop" xml:space="preserve">
|
||||
<value>Beginning execution loop</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionError_CommandNotSupported" xml:space="preserve">
|
||||
<value>Command {0} is not supported.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ExecutionError_VariableNotFound" xml:space="preserve">
|
||||
<value>The variable {0} could not be found.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionEngineError" xml:space="preserve">
|
||||
<value>SQL Execution error: {0}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionError" xml:space="preserve">
|
||||
<value>Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionEngineBatchMessage" xml:space="preserve">
|
||||
<value>Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionEngineBatchResultSetProcessing" xml:space="preserve">
|
||||
<value>Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionEngineBatchResultSetFinished" xml:space="preserve">
|
||||
<value>Batch parser wrapper execution engine batch ResultSet finished.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParserWrapperExecutionEngineBatchCancelling" xml:space="preserve">
|
||||
<value>Canceling batch parser wrapper batch execution.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EE_ScriptError_Warning" xml:space="preserve">
|
||||
<value>Scripting warning.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="TroubleshootingAssistanceMessage" xml:space="preserve">
|
||||
<value>For more information about this error, see the troubleshooting topics in the product documentation.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParser_CircularReference" xml:space="preserve">
|
||||
<value>File '{0}' recursively included.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParser_CommentNotTerminated" xml:space="preserve">
|
||||
<value>Missing end comment mark '*/'.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParser_StringNotTerminated" xml:space="preserve">
|
||||
<value>Unclosed quotation mark after the character string.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParser_IncorrectSyntax" xml:space="preserve">
|
||||
<value>Incorrect syntax was encountered while parsing '{0}'.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="BatchParser_VariableNotDefined" xml:space="preserve">
|
||||
<value>Variable {0} is not defined.</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,84 @@
|
||||
# String resource file
|
||||
#
|
||||
# When processed by the String Resource Tool, this file generates
|
||||
# both a .CS and a .RESX file with the same name as the file.
|
||||
# The .CS file contains a class which can be used to access these
|
||||
# string resources, including the ability to format in
|
||||
# parameters, which are identified with the .NET {x} format
|
||||
# (see String.Format help).
|
||||
#
|
||||
# Comments below assume the file name is SR.strings.
|
||||
#
|
||||
# Lines starting with a semicolon ";" are also treated as comments, but
|
||||
# in a future version they will be extracted and made available in LocStudio
|
||||
# Put your comments to localizers _before_ the string they apply to.
|
||||
#
|
||||
# SMO build specific comment
|
||||
# after generating the .resx file, run srgen on it and get the .resx file
|
||||
# please remember to also check that .resx in, along with the
|
||||
# .strings and .cs files
|
||||
|
||||
[strings]
|
||||
|
||||
|
||||
############################################################################
|
||||
# DacFx Resources
|
||||
|
||||
EE_BatchSqlMessageNoProcedureInfo = Msg {0}, Level {1}, State {2}, Line {3}
|
||||
|
||||
EE_BatchSqlMessageWithProcedureInfo = Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}
|
||||
|
||||
EE_BatchSqlMessageNoLineInfo = Msg {0}, Level {1}, State {2}
|
||||
|
||||
EE_BatchError_Exception = An error occurred while the batch was being processed. The error message is: {0}
|
||||
|
||||
EE_BatchExecutionInfo_RowsAffected = ({0} row(s) affected)
|
||||
|
||||
EE_ExecutionNotYetCompleteError = The previous execution is not yet complete.
|
||||
|
||||
EE_ScriptError_Error = A scripting error occurred.
|
||||
|
||||
EE_ScriptError_ParsingSyntax = Incorrect syntax was encountered while {0} was being parsed.
|
||||
|
||||
EE_ScriptError_FatalError = A fatal error occurred.
|
||||
|
||||
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
|
||||
|
||||
EE_ExecutionInfo_QueryCancelledbyUser = You cancelled the query.
|
||||
|
||||
EE_BatchExecutionError_Halting = An error occurred while the batch was being executed.
|
||||
|
||||
EE_BatchExecutionError_Ignoring = An error occurred while the batch was being executed, but the error has been ignored.
|
||||
|
||||
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
|
||||
|
||||
EE_ExecutionError_CommandNotSupported = Command {0} is not supported.
|
||||
|
||||
EE_ExecutionError_VariableNotFound = The variable {0} could not be found.
|
||||
|
||||
BatchParserWrapperExecutionEngineError = SQL Execution error: {0}
|
||||
|
||||
BatchParserWrapperExecutionError = Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchMessage = Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchResultSetProcessing = Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchResultSetFinished = Batch parser wrapper execution engine batch ResultSet finished.
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchCancelling = Canceling batch parser wrapper batch execution.
|
||||
|
||||
EE_ScriptError_Warning = Scripting warning.
|
||||
|
||||
TroubleshootingAssistanceMessage = For more information about this error, see the troubleshooting topics in the product documentation.
|
||||
|
||||
BatchParser_CircularReference = File '{0}' recursively included.
|
||||
|
||||
BatchParser_CommentNotTerminated = Missing end comment mark '*/'.
|
||||
|
||||
BatchParser_StringNotTerminated = Unclosed quotation mark after the character string.
|
||||
|
||||
BatchParser_IncorrectSyntax = Incorrect syntax was encountered while parsing '{0}'.
|
||||
|
||||
BatchParser_VariableNotDefined = Variable {0} is not defined.
|
||||
|
||||
152
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.xlf
Normal file
152
src/Microsoft.SqlTools.ManagedBatchParser/Localization/sr.xlf
Normal file
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" original="sr.resx" source-language="en">
|
||||
<body>
|
||||
<trans-unit id="EE_BatchSqlMessageNoProcedureInfo">
|
||||
<source>Msg {0}, Level {1}, State {2}, Line {3}</source>
|
||||
<target state="new">Msg {0}, Level {1}, State {2}, Line {3}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchSqlMessageWithProcedureInfo">
|
||||
<source>Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</source>
|
||||
<target state="new">Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchSqlMessageNoLineInfo">
|
||||
<source>Msg {0}, Level {1}, State {2}</source>
|
||||
<target state="new">Msg {0}, Level {1}, State {2}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchError_Exception">
|
||||
<source>An error occurred while the batch was being processed. The error message is: {0}</source>
|
||||
<target state="new">An error occurred while the batch was being processed. The error message is: {0}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchExecutionInfo_RowsAffected">
|
||||
<source>({0} row(s) affected)</source>
|
||||
<target state="new">({0} row(s) affected)</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionNotYetCompleteError">
|
||||
<source>The previous execution is not yet complete.</source>
|
||||
<target state="new">The previous execution is not yet complete.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ScriptError_Error">
|
||||
<source>A scripting error occurred.</source>
|
||||
<target state="new">A scripting error occurred.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ScriptError_ParsingSyntax">
|
||||
<source>Incorrect syntax was encountered while {0} was being parsed.</source>
|
||||
<target state="new">Incorrect syntax was encountered while {0} was being parsed.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ScriptError_FatalError">
|
||||
<source>A fatal error occurred.</source>
|
||||
<target state="new">A fatal error occurred.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionInfo_FinalizingLoop">
|
||||
<source>Batch execution completed {0} times...</source>
|
||||
<target state="new">Batch execution completed {0} times...</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionInfo_QueryCancelledbyUser">
|
||||
<source>You cancelled the query.</source>
|
||||
<target state="new">You cancelled the query.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchExecutionError_Halting">
|
||||
<source>An error occurred while the batch was being executed.</source>
|
||||
<target state="new">An error occurred while the batch was being executed.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_BatchExecutionError_Ignoring">
|
||||
<source>An error occurred while the batch was being executed, but the error has been ignored.</source>
|
||||
<target state="new">An error occurred while the batch was being executed, but the error has been ignored.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionInfo_InitializingLoop">
|
||||
<source>Beginning execution loop</source>
|
||||
<target state="new">Beginning execution loop</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionError_CommandNotSupported">
|
||||
<source>Command {0} is not supported.</source>
|
||||
<target state="new">Command {0} is not supported.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ExecutionError_VariableNotFound">
|
||||
<source>The variable {0} could not be found.</source>
|
||||
<target state="new">The variable {0} could not be found.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionEngineError">
|
||||
<source>SQL Execution error: {0}</source>
|
||||
<target state="new">SQL Execution error: {0}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionError">
|
||||
<source>Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</source>
|
||||
<target state="new">Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionEngineBatchMessage">
|
||||
<source>Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</source>
|
||||
<target state="new">Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionEngineBatchResultSetProcessing">
|
||||
<source>Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</source>
|
||||
<target state="new">Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionEngineBatchResultSetFinished">
|
||||
<source>Batch parser wrapper execution engine batch ResultSet finished.</source>
|
||||
<target state="new">Batch parser wrapper execution engine batch ResultSet finished.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParserWrapperExecutionEngineBatchCancelling">
|
||||
<source>Canceling batch parser wrapper batch execution.</source>
|
||||
<target state="new">Canceling batch parser wrapper batch execution.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EE_ScriptError_Warning">
|
||||
<source>Scripting warning.</source>
|
||||
<target state="new">Scripting warning.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="TroubleshootingAssistanceMessage">
|
||||
<source>For more information about this error, see the troubleshooting topics in the product documentation.</source>
|
||||
<target state="new">For more information about this error, see the troubleshooting topics in the product documentation.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParser_CircularReference">
|
||||
<source>File '{0}' recursively included.</source>
|
||||
<target state="new">File '{0}' recursively included.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParser_CommentNotTerminated">
|
||||
<source>Missing end comment mark '*/'.</source>
|
||||
<target state="new">Missing end comment mark '*/'.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParser_StringNotTerminated">
|
||||
<source>Unclosed quotation mark after the character string.</source>
|
||||
<target state="new">Unclosed quotation mark after the character string.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParser_IncorrectSyntax">
|
||||
<source>Incorrect syntax was encountered while parsing '{0}'.</source>
|
||||
<target state="new">Incorrect syntax was encountered while parsing '{0}'.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="BatchParser_VariableNotDefined">
|
||||
<source>Variable {0} is not defined.</source>
|
||||
<target state="new">Variable {0} is not defined.</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Localization\transXliff\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="150.18040.0-preview" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\sr.resx" />
|
||||
<None Include="Localization\sr.strings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Microsoft.SqlTools.ManagedBatchParser")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Microsoft.SqlTools.ManagedBatchParser")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("82dd9738-2ad3-4eb3-9f80-18b594e03621")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")]
|
||||
[assembly: InternalsVisibleTo("MicrosoftSqlToolsServiceLayer")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.UnitTests")]
|
||||
@@ -16,11 +16,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// cannot rely on the registry to supply override values therefore setting overrides must be made
|
||||
/// by the top-of-the-stack
|
||||
/// </summary>
|
||||
internal sealed class AmbientSettings
|
||||
public sealed class AmbientSettings
|
||||
{
|
||||
private const string LogicalContextName = "__LocalContextConfigurationName";
|
||||
|
||||
internal enum StreamBackingStore
|
||||
public enum StreamBackingStore
|
||||
{
|
||||
// MemoryStream
|
||||
Memory = 0,
|
||||
@@ -49,7 +49,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
internal const string DoNotSerializeQueryStoreSettingsIndex = "DoNotSerializeQueryStoreSettings";
|
||||
internal const string AlwaysEncryptedWizardMigrationIndex = "AlwaysEncryptedWizardMigration";
|
||||
|
||||
internal static AmbientData _defaultSettings;
|
||||
public static AmbientData _defaultSettings;
|
||||
|
||||
static AmbientSettings()
|
||||
{
|
||||
@@ -291,25 +291,25 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
set { _configuration[ImportModelDatabaseIndex].Value = value; }
|
||||
}
|
||||
|
||||
internal bool SupportAlwaysEncrypted
|
||||
public bool SupportAlwaysEncrypted
|
||||
{
|
||||
get { return (bool)_configuration[SupportAlwaysEncryptedIndex].Value; }
|
||||
set { _configuration[SupportAlwaysEncryptedIndex].Value = value; }
|
||||
}
|
||||
|
||||
internal bool AlwaysEncryptedWizardMigration
|
||||
public bool AlwaysEncryptedWizardMigration
|
||||
{
|
||||
get { return (bool)_configuration[AlwaysEncryptedWizardMigrationIndex].Value; }
|
||||
set { _configuration[AlwaysEncryptedWizardMigrationIndex].Value = value; }
|
||||
}
|
||||
|
||||
internal bool SkipObjectTypeBlocking
|
||||
public bool SkipObjectTypeBlocking
|
||||
{
|
||||
get { return (bool)_configuration[SkipObjectTypeBlockingIndex].Value; }
|
||||
set { _configuration[SkipObjectTypeBlockingIndex].Value = value; }
|
||||
}
|
||||
|
||||
internal bool DoNotSerializeQueryStoreSettings
|
||||
public bool DoNotSerializeQueryStoreSettings
|
||||
{
|
||||
get { return (bool)_configuration[DoNotSerializeQueryStoreSettingsIndex].Value; }
|
||||
set { _configuration[DoNotSerializeQueryStoreSettingsIndex].Value = value; }
|
||||
@@ -17,7 +17,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <summary>
|
||||
/// This class caches server information for subsequent use
|
||||
/// </summary>
|
||||
internal class CachedServerInfo
|
||||
public class CachedServerInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Singleton service instance
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Internal constructor for testing purposes. For all code use, please use the <see cref="CachedServerInfo.Instance"/>
|
||||
/// default instance.
|
||||
/// </summary>
|
||||
internal CachedServerInfo()
|
||||
public CachedServerInfo()
|
||||
{
|
||||
_cache = new ConcurrentDictionary<CacheKey, CachedInfo>();
|
||||
_cacheLock = new object();
|
||||
@@ -175,7 +175,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
AddOrUpdateCache(builder, newState, cacheVar);
|
||||
}
|
||||
|
||||
internal void AddOrUpdateCache(SqlConnectionStringBuilder builder, bool newState, CacheVariable cacheVar)
|
||||
public void AddOrUpdateCache(SqlConnectionStringBuilder builder, bool newState, CacheVariable cacheVar)
|
||||
{
|
||||
Validate.IsNotNull(nameof(builder), builder);
|
||||
Validate.IsNotNullOrWhitespaceString(nameof(builder) + ".DataSource", builder.DataSource);
|
||||
@@ -15,7 +15,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// the objects are just data-transfer-objects initialized during construction.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
internal class DataSchemaError
|
||||
public class DataSchemaError
|
||||
{
|
||||
internal const string DefaultPrefix = "SQL";
|
||||
private const int MaxErrorCode = 99999;
|
||||
@@ -182,7 +182,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
get { return FormatErrorCode(Prefix, ErrorCode); }
|
||||
}
|
||||
|
||||
internal Boolean IsBuildErrorCodeDefined
|
||||
public Boolean IsBuildErrorCodeDefined
|
||||
{
|
||||
get { return (ErrorCode != UndefinedErrorCode); }
|
||||
}
|
||||
@@ -190,9 +190,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <summary>
|
||||
/// true if this error is being displayed in ErrorList. More of an Accounting Mechanism to be used internally.
|
||||
/// </summary>
|
||||
internal bool IsOnDisplay { get; set; }
|
||||
public bool IsOnDisplay { get; set; }
|
||||
|
||||
internal static string FormatErrorCode(string prefix, int code)
|
||||
public static string FormatErrorCode(string prefix, int code)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
@@ -15,7 +15,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Wraps <see cref="IDbCommand"/> objects that could be a <see cref="SqlCommand"/> or
|
||||
/// a <see cref="ReliableSqlConnection.ReliableSqlCommand"/>, providing common methods across both.
|
||||
/// </summary>
|
||||
internal sealed class DbCommandWrapper
|
||||
public sealed class DbCommandWrapper
|
||||
{
|
||||
private readonly IDbCommand _command;
|
||||
private readonly bool _isReliableCommand;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal enum ErrorSeverity
|
||||
public enum ErrorSeverity
|
||||
{
|
||||
Unknown = 0,
|
||||
Error,
|
||||
@@ -12,7 +12,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// top-of-stack API. Changes made to this context's AmbientData instance will
|
||||
/// flow to lower in the stack while this object is not disposed.
|
||||
/// </summary>
|
||||
internal interface IStackSettingsContext : IDisposable
|
||||
public interface IStackSettingsContext : IDisposable
|
||||
{
|
||||
AmbientSettings.AmbientData Settings { get; }
|
||||
}
|
||||
@@ -16,7 +16,7 @@ using Microsoft.SqlServer.Management.Common;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal static class ReliableConnectionHelper
|
||||
public static class ReliableConnectionHelper
|
||||
{
|
||||
private const int PCU1BuildNumber = 2816;
|
||||
public readonly static SqlConnectionStringBuilder BuilderWithDefaultApplicationName = new SqlConnectionStringBuilder("server=(local);");
|
||||
@@ -705,6 +705,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
public Dictionary<string, object> Options { get; set; }
|
||||
}
|
||||
|
||||
public class ClusterEndpoint
|
||||
{
|
||||
public string ServiceName;
|
||||
public string IpAddress;
|
||||
public int Port;
|
||||
}
|
||||
|
||||
public static bool TryGetServerVersion(string connectionString, out ServerInfo serverInfo, string azureAccountToken)
|
||||
{
|
||||
serverInfo = null;
|
||||
@@ -902,7 +909,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
public string DatabaseName;
|
||||
}
|
||||
|
||||
internal static bool TryGetConnectionStringBuilder(string connectionString, out SqlConnectionStringBuilder builder)
|
||||
public static bool TryGetConnectionStringBuilder(string connectionString, out SqlConnectionStringBuilder builder)
|
||||
{
|
||||
builder = null;
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Provides a reliable way of opening connections to and executing commands
|
||||
/// taking into account potential network unreliability and a requirement for connection retry.
|
||||
/// </summary>
|
||||
internal sealed partial class ReliableSqlConnection
|
||||
public sealed partial class ReliableSqlConnection
|
||||
{
|
||||
internal class ReliableSqlCommand : DbCommand
|
||||
public class ReliableSqlCommand : DbCommand
|
||||
{
|
||||
private const int Dummy = 0;
|
||||
private readonly SqlCommand _command;
|
||||
@@ -230,12 +230,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
_command.Prepare();
|
||||
}
|
||||
|
||||
internal SqlCommand GetUnderlyingCommand()
|
||||
public SqlCommand GetUnderlyingCommand()
|
||||
{
|
||||
return _command;
|
||||
}
|
||||
|
||||
internal void ValidateConnectionIsSet()
|
||||
public void ValidateConnectionIsSet()
|
||||
{
|
||||
if (_connection == null)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Provides a reliable way of opening connections to and executing commands
|
||||
/// taking into account potential network unreliability and a requirement for connection retry.
|
||||
/// </summary>
|
||||
internal sealed partial class ReliableSqlConnection : DbConnection, IDisposable
|
||||
public sealed partial class ReliableSqlConnection : DbConnection, IDisposable
|
||||
{
|
||||
private const string QueryAzureSessionId = "SELECT CONVERT(NVARCHAR(36), CONTEXT_INFO())";
|
||||
|
||||
@@ -493,7 +493,7 @@ SET NUMERIC_ROUNDABORT OFF;";
|
||||
}
|
||||
|
||||
// Because retry loses session settings, cache session settings or reply if the settings are already cached.
|
||||
internal Tuple<string, bool>[] CacheOrReplaySessionSettings(IDbCommand originalCommand, Tuple<string, bool>[] sessionSettings)
|
||||
public Tuple<string, bool>[] CacheOrReplaySessionSettings(IDbCommand originalCommand, Tuple<string, bool>[] sessionSettings)
|
||||
{
|
||||
if (sessionSettings == null)
|
||||
{
|
||||
@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <summary>
|
||||
/// Contains string resources used throughout ReliableConnection code.
|
||||
/// </summary>
|
||||
internal static class Resources
|
||||
public static class Resources
|
||||
{
|
||||
internal static string AmbientSettingFormat
|
||||
{
|
||||
@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ConnectionPassedToIsCloudShouldBeOpen
|
||||
public static string ConnectionPassedToIsCloudShouldBeOpen
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ConnectionPropertyNotSet
|
||||
public static string ConnectionPropertyNotSet
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -34,7 +34,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ExceptionCannotBeRetried
|
||||
public static string ExceptionCannotBeRetried
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ErrorParsingConnectionString
|
||||
public static string ErrorParsingConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -50,7 +50,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FailedToCacheIsCloud
|
||||
public static string FailedToCacheIsCloud
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FailedToParseConnectionString
|
||||
public static string FailedToParseConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string IgnoreOnException
|
||||
public static string IgnoreOnException
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -74,7 +74,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string InvalidCommandType
|
||||
public static string InvalidCommandType
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -82,7 +82,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string InvalidConnectionType
|
||||
public static string InvalidConnectionType
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -106,7 +106,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string OnlyReliableConnectionSupported
|
||||
public static string OnlyReliableConnectionSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -114,7 +114,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string RetryOnException
|
||||
public static string RetryOnException
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -130,7 +130,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnableToAssignValue
|
||||
public static string UnableToAssignValue
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -138,7 +138,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static string UnableToRetrieveAzureSessionId
|
||||
public static string UnableToRetrieveAzureSessionId
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -32,13 +32,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// exception to notify the retry policy that no further retry attempts are required.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
internal sealed class RetryLimitExceededException : Exception
|
||||
public sealed class RetryLimitExceededException : Exception
|
||||
{
|
||||
internal RetryLimitExceededException() : base()
|
||||
public RetryLimitExceededException() : base()
|
||||
{
|
||||
}
|
||||
|
||||
internal RetryLimitExceededException(string m, Exception e) : base(m, e)
|
||||
public RetryLimitExceededException(string m, Exception e) : base(m, e)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,12 @@ using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the error detection logic for temporary faults that are commonly found during data transfer.
|
||||
/// </summary>
|
||||
internal class DataTransferErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
public class DataTransferErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
{
|
||||
private static readonly DataTransferErrorDetectionStrategy instance = new DataTransferErrorDetectionStrategy();
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Data.SqlClient;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
public interface IErrorDetectionStrategy
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Base class with common retry logic. The core behavior for retrying non SqlExceptions is the same
|
||||
/// across retry policies
|
||||
/// </summary>
|
||||
internal abstract class ErrorDetectionStrategyBase : IErrorDetectionStrategy
|
||||
public abstract class ErrorDetectionStrategyBase : IErrorDetectionStrategy
|
||||
{
|
||||
public bool CanRetry(Exception ex)
|
||||
{
|
||||
@@ -7,13 +7,13 @@ using System.Data.SqlClient;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.
|
||||
/// The same errors CAN occur on premise also, but they are not seen as often.
|
||||
/// </summary>
|
||||
internal sealed class NetworkConnectivityErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
public sealed class NetworkConnectivityErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
{
|
||||
private static NetworkConnectivityErrorDetectionStrategy instance = new NetworkConnectivityErrorDetectionStrategy();
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Data.SqlClient;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.
|
||||
@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// want to consider this as passing since the first execution that has timed out (or failed for some other temporary error)
|
||||
/// might have managed to create the object.
|
||||
/// </summary>
|
||||
internal class SqlAzureTemporaryAndIgnorableErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
public class SqlAzureTemporaryAndIgnorableErrorDetectionStrategy : ErrorDetectionStrategyBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Azure error that can be ignored
|
||||
@@ -7,7 +7,7 @@ using System.Data.SqlClient;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.
|
||||
@@ -13,7 +13,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements an object holding the decoded reason code returned from SQL Azure when encountering throttling conditions.
|
||||
@@ -36,19 +36,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <summary>
|
||||
/// Implements a policy defining and implementing the retry mechanism for unreliable actions.
|
||||
/// </summary>
|
||||
internal abstract partial class RetryPolicy
|
||||
public abstract partial class RetryPolicy
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a callback delegate which will be invoked whenever a retry condition is encountered.
|
||||
/// </summary>
|
||||
/// <param name="retryState">The state of current retry attempt.</param>
|
||||
internal delegate void RetryCallbackDelegate(RetryState retryState);
|
||||
public delegate void RetryCallbackDelegate(RetryState retryState);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a callback delegate which will be invoked whenever an error is ignored on retry.
|
||||
/// </summary>
|
||||
/// <param name="retryState">The state of current retry attempt.</param>
|
||||
internal delegate void IgnoreErrorCallbackDelegate(RetryState retryState);
|
||||
public delegate void IgnoreErrorCallbackDelegate(RetryState retryState);
|
||||
|
||||
private readonly IErrorDetectionStrategy _errorDetectionStrategy;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <remarks>
|
||||
/// This flag is currently being used for TESTING PURPOSES ONLY.
|
||||
/// </remarks>
|
||||
internal bool ShouldIgnoreOnFirstTry
|
||||
public bool ShouldIgnoreOnFirstTry
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@@ -292,7 +292,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
*/
|
||||
|
||||
internal static int? GetErrorNumber(Exception ex)
|
||||
public static int? GetErrorNumber(Exception ex)
|
||||
{
|
||||
SqlException sqlEx = ex as SqlException;
|
||||
if (sqlEx == null)
|
||||
@@ -331,7 +331,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal class FixedDelayPolicy : RetryPolicy
|
||||
public class FixedDelayPolicy : RetryPolicy
|
||||
{
|
||||
private readonly int _maxRetryCount;
|
||||
private readonly TimeSpan _intervalBetweenRetries;
|
||||
@@ -367,7 +367,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal class ProgressiveRetryPolicy : RetryPolicy
|
||||
public class ProgressiveRetryPolicy : RetryPolicy
|
||||
{
|
||||
private readonly int _maxRetryCount;
|
||||
private readonly TimeSpan _initialInterval;
|
||||
@@ -453,7 +453,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal class TimeBasedRetryPolicy : RetryPolicy
|
||||
public class TimeBasedRetryPolicy : RetryPolicy
|
||||
{
|
||||
private readonly TimeSpan _minTotalRetryTimeLimit;
|
||||
private readonly TimeSpan _maxTotalRetryTimeLimit;
|
||||
@@ -533,7 +533,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
return new RetryStateEx { TotalRetryTime = TimeSpan.Zero };
|
||||
}
|
||||
|
||||
internal sealed class RetryStateEx : RetryState
|
||||
public sealed class RetryStateEx : RetryState
|
||||
{
|
||||
public TimeSpan TotalRetryTime { get; set; }
|
||||
}
|
||||
@@ -57,11 +57,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// </summary>
|
||||
public static readonly TimeSpan DefaultProgressiveRetryIncrement = TimeSpan.FromMilliseconds(500);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Implements a collection of the RetryPolicyInfo elements holding retry policy settings.
|
||||
/// </summary>
|
||||
internal sealed class RetryPolicyFactory
|
||||
public sealed class RetryPolicyFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a default policy that does no retries, it just invokes action exactly once.
|
||||
@@ -77,7 +77,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Implements a strategy that ignores any transient errors.
|
||||
/// Internal for testing purposes only
|
||||
/// </summary>
|
||||
internal sealed class TransientErrorIgnoreStrategy : RetryPolicy.IErrorDetectionStrategy
|
||||
public sealed class TransientErrorIgnoreStrategy : RetryPolicy.IErrorDetectionStrategy
|
||||
{
|
||||
private static readonly TransientErrorIgnoreStrategy _instance = new TransientErrorIgnoreStrategy();
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Creates and returns a default Retry Policy for Schema based operations.
|
||||
/// </summary>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreateDefaultSchemaCommandRetryPolicy(bool useRetry, int retriesPerPhase = RetryPolicyDefaults.DefaulSchemaRetryCount)
|
||||
public static RetryPolicy CreateDefaultSchemaCommandRetryPolicy(bool useRetry, int retriesPerPhase = RetryPolicyDefaults.DefaulSchemaRetryCount)
|
||||
{
|
||||
RetryPolicy policy;
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// </summary>
|
||||
/// <remarks>The RetryOccured event is wired to raise an RaiseAmbientRetryMessage message for a connection retry. </remarks>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreateSchemaConnectionRetryPolicy(int retriesPerPhase)
|
||||
public static RetryPolicy CreateSchemaConnectionRetryPolicy(int retriesPerPhase)
|
||||
{
|
||||
RetryPolicy policy = new RetryPolicy.ExponentialDelayRetryPolicy(
|
||||
RetryPolicy.SqlAzureTemporaryErrorDetectionStrategy.Instance,
|
||||
@@ -145,7 +145,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// </summary>
|
||||
/// <remarks>The RetryOccured event is wired to raise an RaiseAmbientRetryMessage message for a command retry. </remarks>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreateSchemaCommandRetryPolicy(int retriesPerPhase)
|
||||
public static RetryPolicy CreateSchemaCommandRetryPolicy(int retriesPerPhase)
|
||||
{
|
||||
RetryPolicy policy = new RetryPolicy.ExponentialDelayRetryPolicy(
|
||||
RetryPolicy.SqlAzureTemporaryErrorDetectionStrategy.Instance,
|
||||
@@ -167,7 +167,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
|
||||
/// </remarks>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreateDatabaseCommandRetryPolicy(params int[] ignorableErrorNumbers)
|
||||
public static RetryPolicy CreateDatabaseCommandRetryPolicy(params int[] ignorableErrorNumbers)
|
||||
{
|
||||
RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy errorDetectionStrategy =
|
||||
new RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy(ignorableErrorNumbers);
|
||||
@@ -196,7 +196,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
|
||||
/// </remarks>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreateElementCommandRetryPolicy(params int[] ignorableErrorNumbers)
|
||||
public static RetryPolicy CreateElementCommandRetryPolicy(params int[] ignorableErrorNumbers)
|
||||
{
|
||||
Debug.Assert(ignorableErrorNumbers != null);
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
|
||||
/// </remarks>
|
||||
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
|
||||
internal static RetryPolicy CreatePrimaryKeyCommandRetryPolicy()
|
||||
public static RetryPolicy CreatePrimaryKeyCommandRetryPolicy()
|
||||
{
|
||||
RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy errorDetectionStrategy =
|
||||
new RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy(SqlErrorNumbers.PrimaryKeyViolationErrorNumber);
|
||||
@@ -390,7 +390,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
return retryPolicy;
|
||||
}
|
||||
|
||||
internal static void DataConnectionFailureRetry(RetryState retryState)
|
||||
public static void DataConnectionFailureRetry(RetryState retryState)
|
||||
{
|
||||
Logger.Write(TraceEventType.Information, string.Format(CultureInfo.InvariantCulture,
|
||||
"Connection retry number {0}. Delaying {1} ms before retry. Exception: {2}",
|
||||
@@ -401,7 +401,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.ConnectionRetry);
|
||||
}
|
||||
|
||||
internal static void CommandFailureRetry(RetryState retryState, string commandKeyword)
|
||||
public static void CommandFailureRetry(RetryState retryState, string commandKeyword)
|
||||
{
|
||||
Logger.Write(TraceEventType.Information, string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
@@ -414,7 +414,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.CommandRetry);
|
||||
}
|
||||
|
||||
internal static void CommandFailureIgnore(RetryState retryState, string commandKeyword)
|
||||
public static void CommandFailureIgnore(RetryState retryState, string commandKeyword)
|
||||
{
|
||||
Logger.Write(TraceEventType.Information, string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
@@ -426,32 +426,32 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
RetryPolicyUtils.RaiseAmbientIgnoreMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.CommandRetry);
|
||||
}
|
||||
|
||||
internal static void CommandFailureRetry(RetryState retryState)
|
||||
public static void CommandFailureRetry(RetryState retryState)
|
||||
{
|
||||
CommandFailureRetry(retryState, "Command");
|
||||
}
|
||||
|
||||
internal static void CommandFailureIgnore(RetryState retryState)
|
||||
public static void CommandFailureIgnore(RetryState retryState)
|
||||
{
|
||||
CommandFailureIgnore(retryState, "Command");
|
||||
}
|
||||
|
||||
internal static void CreateDatabaseCommandFailureRetry(RetryState retryState)
|
||||
public static void CreateDatabaseCommandFailureRetry(RetryState retryState)
|
||||
{
|
||||
CommandFailureRetry(retryState, "Database Command");
|
||||
}
|
||||
|
||||
internal static void CreateDatabaseCommandFailureIgnore(RetryState retryState)
|
||||
public static void CreateDatabaseCommandFailureIgnore(RetryState retryState)
|
||||
{
|
||||
CommandFailureIgnore(retryState, "Database Command");
|
||||
}
|
||||
|
||||
internal static void ElementCommandFailureRetry(RetryState retryState)
|
||||
public static void ElementCommandFailureRetry(RetryState retryState)
|
||||
{
|
||||
CommandFailureRetry(retryState, "Element Command");
|
||||
}
|
||||
|
||||
internal static void ElementCommandFailureIgnore(RetryState retryState)
|
||||
public static void ElementCommandFailureIgnore(RetryState retryState)
|
||||
{
|
||||
CommandFailureIgnore(retryState, "Element Command");
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal static class RetryPolicyUtils
|
||||
public static class RetryPolicyUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Approved list of transient errors that should be retryable during Network connection stages
|
||||
@@ -257,7 +257,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// </summary>
|
||||
/// <param name="currentRetryCount">Total number of retries including the current retry</param>
|
||||
/// <returns>TimeSpan defining the length of time to delay</returns>
|
||||
internal static TimeSpan CalcExponentialRetryDelayWithSchemaDefaults(int currentRetryCount)
|
||||
public static TimeSpan CalcExponentialRetryDelayWithSchemaDefaults(int currentRetryCount)
|
||||
{
|
||||
return CalcExponentialRetryDelay(currentRetryCount,
|
||||
RetryPolicyDefaults.DefaultBackoffIntervalFactor,
|
||||
@@ -277,7 +277,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <param name="minInterval">Minimum interval between retries. The basis for all backoff calculations</param>
|
||||
/// <param name="maxInterval">Maximum interval between retries. Backoff will not take longer than this period.</param>
|
||||
/// <returns>TimeSpan defining the length of time to delay</returns>
|
||||
internal static TimeSpan CalcExponentialRetryDelay(int currentRetryCount, double intervalFactor, TimeSpan minInterval, TimeSpan maxInterval)
|
||||
public static TimeSpan CalcExponentialRetryDelay(int currentRetryCount, double intervalFactor, TimeSpan minInterval, TimeSpan maxInterval)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -298,7 +298,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RaiseAmbientRetryMessage(RetryState retryState, int errorCode)
|
||||
public static void RaiseAmbientRetryMessage(RetryState retryState, int errorCode)
|
||||
{
|
||||
Action<SqlServerRetryError> retryMsgHandler = AmbientSettings.ConnectionRetryMessageHandler;
|
||||
if (retryMsgHandler != null)
|
||||
@@ -317,7 +317,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RaiseAmbientIgnoreMessage(RetryState retryState, int errorCode)
|
||||
public static void RaiseAmbientIgnoreMessage(RetryState retryState, int errorCode)
|
||||
{
|
||||
Action<SqlServerRetryError> retryMsgHandler = AmbientSettings.ConnectionRetryMessageHandler;
|
||||
if (retryMsgHandler != null)
|
||||
@@ -341,7 +341,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <param name="retryState"></param>
|
||||
/// <param name="errorCode"></param>
|
||||
/// <param name="azureSessionId"></param>
|
||||
internal static void RaiseSchemaAmbientRetryMessage(RetryState retryState, int errorCode, Guid azureSessionId)
|
||||
public static void RaiseSchemaAmbientRetryMessage(RetryState retryState, int errorCode, Guid azureSessionId)
|
||||
{
|
||||
if (azureSessionId != Guid.Empty)
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal class RetryState
|
||||
public class RetryState
|
||||
{
|
||||
private int _retryCount = 0;
|
||||
private TimeSpan _delay = TimeSpan.Zero;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
{
|
||||
internal static class SqlSchemaModelErrorCodes
|
||||
public static class SqlSchemaModelErrorCodes
|
||||
{
|
||||
private const int ParserErrorCodeStartIndex = 46000;
|
||||
private const int ParserErrorCodeEndIndex = 46499;
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// Represents an error produced by SQL Server database schema provider
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
internal class SqlServerError : DataSchemaError
|
||||
public class SqlServerError : DataSchemaError
|
||||
{
|
||||
private const string SqlServerPrefix = "SQL";
|
||||
private const string DefaultHelpKeyword = "vs.teamsystem.datatools.DefaultErrorMessageHelp";
|
||||
@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||
/// <summary>
|
||||
/// Captures extended information about a specific error and a retry
|
||||
/// </summary>
|
||||
internal class SqlServerRetryError : SqlServerError
|
||||
public class SqlServerRetryError : SqlServerError
|
||||
{
|
||||
private int _retryCount;
|
||||
private int _errorCode;
|
||||
@@ -3,7 +3,6 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
|
||||
@@ -73,11 +72,4 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
|
||||
/// </summary>
|
||||
public Dictionary<string, object> Options { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class ClusterEndpoint
|
||||
{
|
||||
public string ServiceName;
|
||||
public string IpAddress;
|
||||
public int Port;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -249,64 +249,14 @@ EditDataIncorrectTable(string tableName) = EditData queries must query the origi
|
||||
############################################################################
|
||||
# DacFx Resources
|
||||
|
||||
EE_BatchSqlMessageNoProcedureInfo = Msg {0}, Level {1}, State {2}, Line {3}
|
||||
|
||||
EE_BatchSqlMessageWithProcedureInfo = Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}
|
||||
|
||||
EE_BatchSqlMessageNoLineInfo = Msg {0}, Level {1}, State {2}
|
||||
|
||||
EE_BatchError_Exception = An error occurred while the batch was being processed. The error message is: {0}
|
||||
|
||||
EE_BatchExecutionInfo_RowsAffected = ({0} row(s) affected)
|
||||
|
||||
EE_ExecutionNotYetCompleteError = The previous execution is not yet complete.
|
||||
|
||||
EE_ScriptError_Error = A scripting error occurred.
|
||||
|
||||
EE_ScriptError_ParsingSyntax = Incorrect syntax was encountered while {0} was being parsed.
|
||||
|
||||
EE_ScriptError_FatalError = A fatal error occurred.
|
||||
|
||||
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
|
||||
|
||||
EE_ExecutionInfo_QueryCancelledbyUser = You cancelled the query.
|
||||
|
||||
EE_BatchExecutionError_Halting = An error occurred while the batch was being executed.
|
||||
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
|
||||
|
||||
EE_BatchExecutionError_Ignoring = An error occurred while the batch was being executed, but the error has been ignored.
|
||||
|
||||
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
|
||||
|
||||
EE_ExecutionError_CommandNotSupported = Command {0} is not supported.
|
||||
|
||||
EE_ExecutionError_VariableNotFound = The variable {0} could not be found.
|
||||
|
||||
BatchParserWrapperExecutionEngineError = SQL Execution error: {0}
|
||||
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
|
||||
|
||||
BatchParserWrapperExecutionError = Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchMessage = Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchResultSetProcessing = Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchResultSetFinished = Batch parser wrapper execution engine batch ResultSet finished.
|
||||
|
||||
BatchParserWrapperExecutionEngineBatchCancelling = Canceling batch parser wrapper batch execution.
|
||||
|
||||
EE_ScriptError_Warning = Scripting warning.
|
||||
|
||||
TroubleshootingAssistanceMessage = For more information about this error, see the troubleshooting topics in the product documentation.
|
||||
|
||||
BatchParser_CircularReference = File '{0}' recursively included.
|
||||
|
||||
BatchParser_CommentNotTerminated = Missing end comment mark '*/'.
|
||||
|
||||
BatchParser_StringNotTerminated = Unclosed quotation mark after the character string.
|
||||
|
||||
BatchParser_IncorrectSyntax = Incorrect syntax was encountered while parsing '{0}'.
|
||||
|
||||
BatchParser_VariableNotDefined = Variable {0} is not defined.
|
||||
|
||||
############################################################################
|
||||
# Workspace Service
|
||||
|
||||
@@ -716,125 +666,6 @@ StoredProcedureScriptParameterComment = -- TODO: Set parameter values here.
|
||||
ScriptingGeneralError = An error occurred while scripting the objects.
|
||||
ScriptingExecuteNotSupportedError = Scripting as Execute is only supported for Stored Procedures
|
||||
|
||||
############################################################################
|
||||
# Admin Service
|
||||
|
||||
unavailable = Unavailable
|
||||
filegroup_dialog_defaultFilegroup = Current default filegroup: {0}
|
||||
filegroup_dialog_title = New Filegroup for {0}
|
||||
filegroups_default = Default
|
||||
filegroups_files = Files
|
||||
filegroups_name = Name
|
||||
filegroups_readonly = Read-Only
|
||||
general_autogrowth = Autogrowth / Maxsize
|
||||
general_builderText = ...
|
||||
general_default = <default>
|
||||
general_fileGroup = Filegroup
|
||||
general_fileName = Logical Name
|
||||
general_fileType = File Type
|
||||
general_initialSize = Initial Size (MB)
|
||||
general_newFilegroup = <new filegroup>
|
||||
general_path = Path
|
||||
general_physicalFileName = File Name
|
||||
general_rawDevice = <raw device>
|
||||
general_recoveryModel_bulkLogged = Bulk-logged
|
||||
general_recoveryModel_full = Full
|
||||
general_recoveryModel_simple = Simple
|
||||
general_titleSearchOwner = Select Database Owner
|
||||
|
||||
prototype_autogrowth_disabled = None
|
||||
prototype_autogrowth_restrictedGrowthByMB = By {0} MB, Limited to {1} MB
|
||||
prototype_autogrowth_restrictedGrowthByPercent = By {0} percent, Limited to {1} MB
|
||||
prototype_autogrowth_unrestrictedGrowthByMB = By {0} MB, Unlimited
|
||||
prototype_autogrowth_unrestrictedGrowthByPercent = By {0} percent, Unlimited
|
||||
prototype_autogrowth_unlimitedfilestream = Unlimited
|
||||
prototype_autogrowth_limitedfilestream = Limited to {0} MB
|
||||
prototype_db_category_automatic = Automatic
|
||||
prototype_db_category_servicebroker = Service Broker
|
||||
prototype_db_category_collation = Collation
|
||||
prototype_db_category_cursor = Cursor
|
||||
prototype_db_category_misc = Miscellaneous
|
||||
prototype_db_category_recovery = Recovery
|
||||
prototype_db_category_state = State
|
||||
prototype_db_prop_ansiNullDefault = ANSI NULL Default
|
||||
prototype_db_prop_ansiNulls = ANSI NULLS Enabled
|
||||
prototype_db_prop_ansiPadding = ANSI Padding Enabled
|
||||
prototype_db_prop_ansiWarnings = ANSI Warnings Enabled
|
||||
prototype_db_prop_arithabort = Arithmetic Abort Enabled
|
||||
prototype_db_prop_autoClose = Auto Close
|
||||
prototype_db_prop_autoCreateStatistics = Auto Create Statistics
|
||||
prototype_db_prop_autoShrink = Auto Shrink
|
||||
prototype_db_prop_autoUpdateStatistics = Auto Update Statistics
|
||||
prototype_db_prop_autoUpdateStatisticsAsync = Auto Update Statistics Asynchronously
|
||||
prototype_db_prop_caseSensitive = Case Sensitive
|
||||
prototype_db_prop_closeCursorOnCommit = Close Cursor on Commit Enabled
|
||||
prototype_db_prop_collation = Collation
|
||||
prototype_db_prop_concatNullYieldsNull = Concatenate Null Yields Null
|
||||
prototype_db_prop_databaseCompatibilityLevel = Database Compatibility Level
|
||||
prototype_db_prop_databaseState = Database State
|
||||
prototype_db_prop_defaultCursor = Default Cursor
|
||||
prototype_db_prop_fullTextIndexing = Full-Text Indexing Enabled
|
||||
prototype_db_prop_numericRoundAbort = Numeric Round-Abort
|
||||
prototype_db_prop_pageVerify = Page Verify
|
||||
prototype_db_prop_quotedIdentifier = Quoted Identifiers Enabled
|
||||
prototype_db_prop_readOnly = Database Read-Only
|
||||
prototype_db_prop_recursiveTriggers = Recursive Triggers Enabled
|
||||
prototype_db_prop_restrictAccess = Restrict Access
|
||||
prototype_db_prop_selectIntoBulkCopy = Select Into/Bulk Copy
|
||||
prototype_db_prop_honorBrokerPriority = Honor Broker Priority
|
||||
prototype_db_prop_serviceBrokerGuid = Service Broker Identifier
|
||||
prototype_db_prop_brokerEnabled = Broker Enabled
|
||||
prototype_db_prop_truncateLogOnCheckpoint = Truncate Log on Checkpoint
|
||||
prototype_db_prop_dbChaining = Cross-database Ownership Chaining Enabled
|
||||
prototype_db_prop_trustworthy = Trustworthy
|
||||
prototype_db_prop_dateCorrelationOptimization = Date Correlation Optimization Enabled
|
||||
prototype_db_prop_parameterization = Parameterization
|
||||
prototype_db_prop_parameterization_value_forced = Forced
|
||||
prototype_db_prop_parameterization_value_simple = Simple
|
||||
prototype_file_dataFile = ROWS Data
|
||||
prototype_file_logFile = LOG
|
||||
prototype_file_filestreamFile = FILESTREAM Data
|
||||
prototype_file_noFileGroup = Not Applicable
|
||||
prototype_file_defaultpathstring = <default path>
|
||||
title_openConnectionsMustBeClosed = Open Connections
|
||||
warning_openConnectionsMustBeClosed=To change the database properties, SQL Server must close all other connections to the database_ Are you sure you want to change the properties and close all other connections?
|
||||
prototype_db_prop_databaseState_value_autoClosed = AUTO_CLOSED
|
||||
prototype_db_prop_databaseState_value_emergency = EMERGENCY
|
||||
prototype_db_prop_databaseState_value_inaccessible = INACCESSIBLE
|
||||
prototype_db_prop_databaseState_value_normal = NORMAL
|
||||
prototype_db_prop_databaseState_value_offline = OFFLINE
|
||||
prototype_db_prop_databaseState_value_recovering = RECOVERING
|
||||
prototype_db_prop_databaseState_value_recoveryPending = RECOVERY PENDING
|
||||
prototype_db_prop_databaseState_value_restoring = RESTORING
|
||||
prototype_db_prop_databaseState_value_shutdown=SHUTDOWN
|
||||
prototype_db_prop_databaseState_value_standby = STANDBY
|
||||
prototype_db_prop_databaseState_value_suspect = SUSPECT
|
||||
prototype_db_prop_defaultCursor_value_global = GLOBAL
|
||||
prototype_db_prop_defaultCursor_value_local = LOCAL
|
||||
prototype_db_prop_restrictAccess_value_multiple = MULTI_USER
|
||||
prototype_db_prop_restrictAccess_value_restricted = RESTRICTED_USER
|
||||
prototype_db_prop_restrictAccess_value_single = SINGLE_USER
|
||||
prototype_db_prop_pageVerify_value_checksum = CHECKSUM
|
||||
prototype_db_prop_pageVerify_value_none = NONE
|
||||
prototype_db_prop_pageVerify_value_tornPageDetection = TORN_PAGE_DETECTION
|
||||
prototype_db_prop_varDecimalEnabled = VarDecimal Storage Format Enabled
|
||||
compatibilityLevel_katmai = SQL Server 2008 (100)
|
||||
prototype_db_prop_encryptionEnabled = Encryption Enabled
|
||||
prototype_db_prop_databasescopedconfig_value_off = OFF
|
||||
prototype_db_prop_databasescopedconfig_value_on = ON
|
||||
prototype_db_prop_databasescopedconfig_value_primary = PRIMARY
|
||||
error_db_prop_invalidleadingColumns = For the distribution policy HASH, the number of leading hash columns is optional but should be from 1 to 16 columns
|
||||
compatibilityLevel_denali = SQL Server 2012 (110)
|
||||
compatibilityLevel_sql14 = SQL Server 2014 (120)
|
||||
compatibilityLevel_sql15 = SQL Server 2016 (130)
|
||||
compatibilityLevel_sqlvNext = SQL Server vNext (140)
|
||||
general_containmentType_None = None
|
||||
general_containmentType_Partial = Partial
|
||||
filegroups_filestreamFiles = FILESTREAM Files
|
||||
prototype_file_noApplicableFileGroup = No Applicable Filegroup
|
||||
NeverBackedUp = Never
|
||||
Error_InvalidDirectoryName = Path {0} is not a valid directory
|
||||
Error_ExistingDirectoryName = For directory {0} a file with name {1} already exists
|
||||
|
||||
############################################################################
|
||||
# Backup Service
|
||||
@@ -895,146 +726,6 @@ StopSessionFailed(String error) = Failed to stop session: {0}
|
||||
SessionNotFound = Cannot find requested XEvent session
|
||||
SessionAlreadyExists(String sessionName) = An XEvent session named {0} already exists
|
||||
|
||||
#############################################################################
|
||||
# SQL Agent
|
||||
EnableAlertsTitle(String serverName) = Enable Alerts - {0}
|
||||
EnableAlertDescription(String alertName) = Enable Alert '{0}'
|
||||
EnablingAlert(String alertName) = Enabling Alert '{0}'
|
||||
EnabledAlert(String alertName) = Enabled Alert '{0}'
|
||||
|
||||
DisableAlertsTitle(String serverName) = Disable Alerts - {0}
|
||||
DisableAlertDescription(String alertName) = Disable Alert '{0}'
|
||||
DisablingAlert(String alertName) = Disabling Alert '{0}'
|
||||
DisabledAlert(String alertName) = Disabled Alert '{0}'
|
||||
|
||||
EnableJobsTitle(String serverName) = Enable Jobs - {0}
|
||||
EnableJobDescription(String jobName) = Enable Job '{0}'
|
||||
EnablingJob(String jobName) = Enabling Job '{0}'
|
||||
EnabledJob(String jobName) = Enabled Job '{0}'
|
||||
|
||||
DisableJobsTitle(String serverName) = Disable Jobs - {0}
|
||||
DisableJobDescription(String jobName) = Disable Job '{0}'
|
||||
DisablingJob(String jobName) = Disabling Job '{0}'
|
||||
DisabledJob(String jobName) = Disabled Job '{0}'
|
||||
|
||||
StartJobsTitle(String serverName) = Start Jobs - {0}
|
||||
StartJobDescription(String jobName) = Start Job '{0}'
|
||||
GettingStartStep(String jobName) = Job '{0}' has more than one step. Getting step to start
|
||||
UserCancelledSelectStep = User canceled select step. Job will not be started
|
||||
StartingJob(String jobName) = Starting Job '{0}'
|
||||
StartJobWithStep(String jobName, String stepName) = Start Job '{0}' with step '{1}'
|
||||
RequestPostedToTargetServers = Posted remote job execution request
|
||||
|
||||
ExecuteJob(string jobName) = Execute job '{0}'
|
||||
JobFailed(string jobName) = Execution of job '{0}' failed. See the history log for details.
|
||||
Executing = Executing
|
||||
BetweenRetries = Between retries
|
||||
Suspended = Suspended
|
||||
PerformingCompletionAction = Performing completion action
|
||||
WaitingForStepToFinish = Waiting for step to finish
|
||||
WaitingForWorkerThread = Waiting for worker thread
|
||||
|
||||
StopJobsTitle(String serverName) = Stop Jobs - {0}
|
||||
StopJobDescription(String jobName) = Stop Job '{0}'
|
||||
StoppingJob(String jobName) = Stopping Job '{0}'
|
||||
StoppedJob(String jobName) = Stopped Job '{0}'
|
||||
|
||||
; First item in database name drop down list
|
||||
AllDatabases = <all databases>
|
||||
; Exception thrown when agent alert has unknown severity level
|
||||
UnknownSeverity(int severity) = Unknown severity: {0}
|
||||
|
||||
#severity types
|
||||
Severity001 = 001 - Miscellaneous System Information
|
||||
Severity002 = 002 - Reserved
|
||||
Severity003 = 003 - Reserved
|
||||
Severity004 = 004 - Reserved
|
||||
Severity005 = 005 - Reserved
|
||||
Severity006 = 006 - Reserved
|
||||
Severity007 = 007 - Notification: Status Information
|
||||
Severity008 = 008 - Notification: User Intervention Required
|
||||
Severity009 = 009 - User Defined
|
||||
Severity010 = 010 - Information
|
||||
Severity011 = 011 - Specified Database Object Not Found
|
||||
Severity012 = 012 - Unused
|
||||
Severity013 = 013 - User Transaction Syntax Error
|
||||
Severity014 = 014 - Insufficient Permission
|
||||
Severity015 = 015 - Syntax Error in SQL Statements
|
||||
Severity016 = 016 - Miscellaneous User Error
|
||||
Severity017 = 017 - Insufficient Resources
|
||||
Severity018 = 018 - Nonfatal Internal Error
|
||||
Severity019 = 019 - Fatal Error in Resource
|
||||
Severity020 = 020 - Fatal Error in Current Process
|
||||
Severity021 = 021 - Fatal Error in Database Processes
|
||||
Severity022 = 022 - Fatal Error: Table Integrity Suspect
|
||||
Severity023 = 023 - Fatal Error: Database Integrity Suspect
|
||||
Severity024 = 024 - Fatal Error: Hardware Error
|
||||
Severity025 = 025 - Fatal Error
|
||||
|
||||
; Message box that displayed if start time is more than end time on Mon-Fri
|
||||
PagerScheduleMonFri = Pager schedule end time is earlier than start time on Mon-Fri. Do you want to continue?
|
||||
; Message box that displayed if start time is more than end time on Sat-Sun
|
||||
PagerScheduleSatSun = Pager schedule end time is earlier than start time on Sat-Sun. Do you want to continue?
|
||||
; Message box caption
|
||||
PagerScheduleWarning = Pager schedule warning
|
||||
|
||||
; Tree node name
|
||||
General = General
|
||||
; Tree node name
|
||||
Notifications = Notifications
|
||||
; Tree node name
|
||||
History = History
|
||||
; Pager schedule grid column name
|
||||
Day = Day
|
||||
; Pager schedule grid column name
|
||||
StartTime = Start Time
|
||||
; Pager schedule grid column name
|
||||
EndTime = End Time
|
||||
; Exception thrown when column index is invalid
|
||||
ColumnIndexIsInvalid = Column index is invalid.
|
||||
; Exception thrown when row index is invalid
|
||||
RowIndexIsInvalid = Row index is invalid.
|
||||
; Name of the operator dialog in create new operator mode
|
||||
NewOperatorProperties = New Operator
|
||||
; Name of the operator dialog in modify operator mode
|
||||
OperatorProperties(string operatorName) = {0} Properties
|
||||
; Exception thrown when dialog cannot be created/intialized.
|
||||
FailedToCreateInitializeAgentOperatorDialog = Unable to create/initialize Agent Operator dialog.
|
||||
; Exception thrown when job server is not available
|
||||
JobServerIsNotAvailable = Job server is not available.
|
||||
; Exception thrown when we cannot create/initialize agent operators general page
|
||||
CannotCreateInitializeGeneralPage = Cannot create/initialize General page.
|
||||
; Exception thrown when we cannot create/initialize agent operators notifications page
|
||||
CannotCreateInitializeNotificationsPage = Cannot create/initialize Notifications page.
|
||||
; Exception thrown when we cannot create/initialize agent operators history page
|
||||
CannotCreateInitializeHistoryPage = Cannot create/initialize History page.
|
||||
; Exception throw when dialog cannot refresh operator
|
||||
CannotResetOperator = Cannot reset operator.
|
||||
|
||||
; Name of label on notifications page
|
||||
AlertList = Alert list:
|
||||
; Name of label on notifications page
|
||||
JobList = Job list:
|
||||
; Name of column on notifications page
|
||||
Email = E-mail
|
||||
; Name of column on notifications page
|
||||
Pager = Pager
|
||||
; Name of column on notifications page
|
||||
AlertName = Alert name
|
||||
; Name of column on notifications page
|
||||
JobName = Job name
|
||||
; Completion Action
|
||||
Always = Always
|
||||
; Completion Action
|
||||
Never = Never
|
||||
; Completion Action
|
||||
OnFailure = On failure
|
||||
; Completion Action
|
||||
OnSuccess = On success
|
||||
; Exception thrown when we cannot modify alerts
|
||||
CannotModifyAlerts = Cannot modify alerts.
|
||||
; Exception thrown when we cannot create script that modify alerts
|
||||
CannotCreateScriptForModifyAlerts = Cannot create script for modify alerts.
|
||||
|
||||
;job categories
|
||||
CategoryLocal = [Uncategorized (Local)]
|
||||
@@ -1081,4 +772,14 @@ StartDateGreaterThanEndDate = The job schedule starting date cannot be greater t
|
||||
StartTimeGreaterThanEndTime = The job schedule starting time cannot be after the ending time.
|
||||
EndTimeEqualToStartTime = The job schedule ending time must be after the starting time.
|
||||
InvalidStartDate = Start date must be on or after January 1, 1990.
|
||||
ScheduleNameAlreadyExists(string scheduleName)=There is already a schedule named '{0}' for this job. You must specify a different name.
|
||||
ScheduleNameAlreadyExists(string scheduleName)=There is already a schedule named '{0}' for this job. You must specify a different name.
|
||||
|
||||
; Exception thrown when job server is not available
|
||||
JobServerIsNotAvailable = Job server is not available
|
||||
|
||||
############################################################################
|
||||
# Admin Service
|
||||
|
||||
NeverBackedUp = Never
|
||||
Error_InvalidDirectoryName = Path {0} is not a valid directory
|
||||
Error_ExistingDirectoryName = For directory {0} a file with name {1} already exist
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
|
||||
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="150.4240.1-preview" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
@@ -32,18 +32,11 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
|
||||
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
|
||||
<ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="ObjectExplorer\SmoModel\TreeNodeDefinition.xml" />
|
||||
<EmbeddedResource Include="Localization\sr.resx" />
|
||||
<None Include="Localization\sr.strings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Connection\ReliableConnection\ReliableSqlCommand.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Connection\ReliableConnection\ReliableSqlConnection.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -43,6 +43,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")]
|
||||
|
||||
// Allowing internals visible access to Moq library to help testing
|
||||
|
||||
@@ -85,4 +85,4 @@ DEL %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.Core\Microsoft.SqlTools.R
|
||||
COPY /Y %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj.BAK %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj
|
||||
DEL %REPOROOT%\src\Microsoft.SqlTools.ResourceProvider.DefaultImpl\Microsoft.SqlTools.ResourceProvider.DefaultImpl.csproj.BAK
|
||||
|
||||
EXIT
|
||||
EXIT
|
||||
1479
test/CodeCoverage/package-lock.json
generated
1479
test/CodeCoverage/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,10 @@
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/sqltoolsservice.git"
|
||||
},
|
||||
"author": "Microsoft",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
internal class BatchParserMockEventHandler : IBatchEventsHandler
|
||||
{
|
||||
|
||||
@@ -1,118 +1,118 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
{
|
||||
public class BatchParserSqlCmdTests : IDisposable
|
||||
{
|
||||
private BatchParserSqlCmd bpcmd;
|
||||
private PositionStruct testPOS;
|
||||
public BatchParserSqlCmdTests()
|
||||
{
|
||||
bpcmd = new BatchParserSqlCmd();
|
||||
testPOS = new PositionStruct();
|
||||
bpcmd.SetVariable(testPOS, "variable1", "test1");
|
||||
bpcmd.SetVariable(testPOS, "variable2", "test2");
|
||||
bpcmd.SetVariable(testPOS, "variable3", "test3");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (bpcmd != null)
|
||||
{
|
||||
bpcmd = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSetVariable()
|
||||
{
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
bpcmd.SetVariable(testPOS, "variable4", "test4");
|
||||
bpcmd.SetVariable(testPOS, "variable5", "test5");
|
||||
bpcmd.SetVariable(testPOS, "variable6", "test6");
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 6);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSetNullValueVariable()
|
||||
{
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
bpcmd.SetVariable(testPOS, "variable4", "test4");
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 4);
|
||||
bpcmd.SetVariable(testPOS, "variable4", null);
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckGetVariable()
|
||||
{
|
||||
string value = bpcmd.GetVariable(testPOS, "variable1");
|
||||
Assert.Equal("test1", value);
|
||||
value = bpcmd.GetVariable(testPOS, "variable2");
|
||||
Assert.Equal("test2", value);
|
||||
value = bpcmd.GetVariable(testPOS, "variable3");
|
||||
Assert.Equal("test3", value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckGetNullVariable()
|
||||
{
|
||||
Assert.Null(bpcmd.GetVariable(testPOS, "variable6"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckInclude()
|
||||
{
|
||||
TextReader textReader = null;
|
||||
string outString = "out";
|
||||
var result = bpcmd.Include(null, out textReader, out outString);
|
||||
Assert.Equal(result, BatchParserAction.Abort);
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckOnError()
|
||||
{
|
||||
var errorActionChanged = bpcmd.ErrorActionChanged;
|
||||
var action = new OnErrorAction();
|
||||
var result = bpcmd.OnError(null, action);
|
||||
Assert.Equal(result, BatchParserAction.Continue);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckConnectionChangedDelegate()
|
||||
{
|
||||
var initial = bpcmd.ConnectionChanged;
|
||||
bpcmd.ConnectionChanged = null;
|
||||
Assert.Null(bpcmd.ConnectionChanged);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckVariableSubstitutionDisabled()
|
||||
{
|
||||
bpcmd.DisableVariableSubstitution();
|
||||
bpcmd.SetVariable(testPOS, "variable1", "test");
|
||||
var result = bpcmd.GetVariable(testPOS, "variable1");
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
public class BatchParserSqlCmdTests : IDisposable
|
||||
{
|
||||
private BatchParserSqlCmd bpcmd;
|
||||
private PositionStruct testPOS;
|
||||
public BatchParserSqlCmdTests()
|
||||
{
|
||||
bpcmd = new BatchParserSqlCmd();
|
||||
testPOS = new PositionStruct();
|
||||
bpcmd.SetVariable(testPOS, "variable1", "test1");
|
||||
bpcmd.SetVariable(testPOS, "variable2", "test2");
|
||||
bpcmd.SetVariable(testPOS, "variable3", "test3");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (bpcmd != null)
|
||||
{
|
||||
bpcmd = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSetVariable()
|
||||
{
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
bpcmd.SetVariable(testPOS, "variable4", "test4");
|
||||
bpcmd.SetVariable(testPOS, "variable5", "test5");
|
||||
bpcmd.SetVariable(testPOS, "variable6", "test6");
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 6);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSetNullValueVariable()
|
||||
{
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
bpcmd.SetVariable(testPOS, "variable4", "test4");
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 4);
|
||||
bpcmd.SetVariable(testPOS, "variable4", null);
|
||||
Assert.Equal(bpcmd.InternalVariables.Count, 3);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckGetVariable()
|
||||
{
|
||||
string value = bpcmd.GetVariable(testPOS, "variable1");
|
||||
Assert.Equal("test1", value);
|
||||
value = bpcmd.GetVariable(testPOS, "variable2");
|
||||
Assert.Equal("test2", value);
|
||||
value = bpcmd.GetVariable(testPOS, "variable3");
|
||||
Assert.Equal("test3", value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckGetNullVariable()
|
||||
{
|
||||
Assert.Null(bpcmd.GetVariable(testPOS, "variable6"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckInclude()
|
||||
{
|
||||
TextReader textReader = null;
|
||||
string outString = "out";
|
||||
var result = bpcmd.Include(null, out textReader, out outString);
|
||||
Assert.Equal(result, BatchParserAction.Abort);
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckOnError()
|
||||
{
|
||||
var errorActionChanged = bpcmd.ErrorActionChanged;
|
||||
var action = new OnErrorAction();
|
||||
var result = bpcmd.OnError(null, action);
|
||||
Assert.Equal(result, BatchParserAction.Continue);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckConnectionChangedDelegate()
|
||||
{
|
||||
var initial = bpcmd.ConnectionChanged;
|
||||
bpcmd.ConnectionChanged = null;
|
||||
Assert.Null(bpcmd.ConnectionChanged);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckVariableSubstitutionDisabled()
|
||||
{
|
||||
bpcmd.DisableVariableSubstitution();
|
||||
bpcmd.SetVariable(testPOS, "variable1", "test");
|
||||
var result = bpcmd.GetVariable(testPOS, "variable1");
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,272 +1,292 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common.Baselined;
|
||||
using Xunit;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
{
|
||||
public class BatchParserTests : BaselinedTest
|
||||
{
|
||||
private bool testFailed = false;
|
||||
|
||||
public BatchParserTests()
|
||||
{
|
||||
InitializeTest();
|
||||
}
|
||||
|
||||
public void InitializeTest()
|
||||
{
|
||||
CategoryName = "BatchParser";
|
||||
this.TraceOutputDirectory = RunEnvironmentInfo.GetTraceOutputLocation();
|
||||
TestInitialize();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VerifyThrowOnUnresolvedVariable()
|
||||
{
|
||||
string script = "print '$(NotDefined)'";
|
||||
StringBuilder output = new StringBuilder();
|
||||
|
||||
TestCommandHandler handler = new TestCommandHandler(output);
|
||||
IVariableResolver resolver = new TestVariableResolver(new StringBuilder());
|
||||
using (Parser p = new Parser(
|
||||
handler,
|
||||
resolver,
|
||||
new StringReader(script),
|
||||
"test"))
|
||||
{
|
||||
p.ThrowOnUnresolvedVariable = true;
|
||||
handler.SetParser(p);
|
||||
|
||||
Assert.Throws<BatchParserException>(() => p.Parse());
|
||||
}
|
||||
}
|
||||
|
||||
private static Stream GenerateStreamFromString(string s)
|
||||
{
|
||||
MemoryStream stream = new MemoryStream();
|
||||
StreamWriter writer = new StreamWriter(stream);
|
||||
writer.Write(s);
|
||||
writer.Flush();
|
||||
stream.Position = 0;
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void TokenizeWithLexer(string filename, StringBuilder output)
|
||||
{
|
||||
// Create a new file by changing CRLFs to LFs and generate a new steam
|
||||
// or the tokens generated by the lexer will always have off by one errors
|
||||
string input = File.ReadAllText(filename).Replace("\r\n", "\n");
|
||||
var inputStream = GenerateStreamFromString(input);
|
||||
using (Lexer lexer = new Lexer(new StreamReader(inputStream), filename))
|
||||
{
|
||||
|
||||
string inputText = File.ReadAllText(filename);
|
||||
inputText = inputText.Replace("\r\n", "\n");
|
||||
StringBuilder roundtripTextBuilder = new StringBuilder();
|
||||
StringBuilder outputBuilder = new StringBuilder();
|
||||
StringBuilder tokenizedInput = new StringBuilder();
|
||||
bool lexerError = false;
|
||||
|
||||
Token token = null;
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
lexer.ConsumeToken();
|
||||
token = lexer.CurrentToken;
|
||||
roundtripTextBuilder.Append(token.Text.Replace("\r\n", "\n"));
|
||||
outputBuilder.AppendLine(GetTokenString(token));
|
||||
tokenizedInput.Append('[').Append(GetTokenCode(token.TokenType)).Append(':').Append(token.Text.Replace("\r\n", "\n")).Append(']');
|
||||
} while (token.TokenType != LexerTokenType.Eof);
|
||||
}
|
||||
catch (BatchParserException ex)
|
||||
{
|
||||
lexerError = true;
|
||||
outputBuilder.AppendLine(string.Format(CultureInfo.CurrentCulture, "[ERROR: code {0} at {1} - {2} in {3}, message: {4}]", ex.ErrorCode, GetPositionString(ex.Begin), GetPositionString(ex.End), GetFilenameOnly(ex.Begin.Filename), ex.Message));
|
||||
}
|
||||
output.AppendLine("Lexer tokenized input:");
|
||||
output.AppendLine("======================");
|
||||
output.AppendLine(tokenizedInput.ToString());
|
||||
output.AppendLine("Tokens:");
|
||||
output.AppendLine("=======");
|
||||
output.AppendLine(outputBuilder.ToString());
|
||||
|
||||
if (lexerError == false)
|
||||
{
|
||||
// Verify that all text from tokens can be recombined into original string
|
||||
Assert.Equal<string>(inputText, roundtripTextBuilder.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTokenCode(LexerTokenType lexerTokenType)
|
||||
{
|
||||
switch (lexerTokenType)
|
||||
{
|
||||
case LexerTokenType.Text:
|
||||
return "T";
|
||||
case LexerTokenType.Whitespace:
|
||||
return "WS";
|
||||
case LexerTokenType.NewLine:
|
||||
return "NL";
|
||||
case LexerTokenType.Comment:
|
||||
return "C";
|
||||
default:
|
||||
return lexerTokenType.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyToOutput(string sourceDirectory, string filename)
|
||||
{
|
||||
File.Copy(Path.Combine(sourceDirectory, filename), filename, true);
|
||||
FileUtilities.SetFileReadWrite(filename);
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
public void BatchParserTest()
|
||||
{
|
||||
CopyToOutput(FilesLocation, "TS-err-cycle1.txt");
|
||||
CopyToOutput(FilesLocation, "cycle2.txt");
|
||||
Start("err-blockComment");
|
||||
Start("err-blockComment2");
|
||||
Start("err-varDefinition");
|
||||
Start("err-varDefinition2");
|
||||
Start("err-varDefinition3");
|
||||
Start("err-varDefinition4");
|
||||
Start("err-varDefinition5");
|
||||
Start("err-varDefinition6");
|
||||
Start("err-varDefinition7");
|
||||
Start("err-varDefinition8");
|
||||
Start("err-varDefinition9");
|
||||
Start("err-variableRef");
|
||||
Start("err-variableRef2");
|
||||
Start("err-variableRef3");
|
||||
Start("err-variableRef4");
|
||||
Start("err-cycle1");
|
||||
Start("input");
|
||||
Start("input2");
|
||||
Start("pass-blockComment");
|
||||
Start("pass-lineComment");
|
||||
Start("pass-lineComment2");
|
||||
Start("pass-noBlockComments");
|
||||
Start("pass-noLineComments");
|
||||
Start("pass-varDefinition");
|
||||
Start("pass-varDefinition2");
|
||||
Start("pass-varDefinition3");
|
||||
Start("pass-varDefinition4");
|
||||
Start("pass-command-and-comment");
|
||||
Assert.False(testFailed, "At least one of test cases failed. Check output for details.");
|
||||
}
|
||||
|
||||
public void TestParser(string filename, StringBuilder output)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create a new file by changing CRLFs to LFs and generate a new steam
|
||||
// or the tokens generated by the lexer will always have off by one errors
|
||||
TestCommandHandler commandHandler = new TestCommandHandler(output);
|
||||
string input = File.ReadAllText(filename).Replace("\r\n", "\n");
|
||||
var inputStream = GenerateStreamFromString(input);
|
||||
StreamReader streamReader = new StreamReader(inputStream);
|
||||
|
||||
using (Parser parser = new Parser(
|
||||
commandHandler,
|
||||
new TestVariableResolver(output),
|
||||
streamReader,
|
||||
filename))
|
||||
{
|
||||
commandHandler.SetParser(parser);
|
||||
parser.Parse();
|
||||
}
|
||||
}
|
||||
catch (BatchParserException ex)
|
||||
{
|
||||
output.AppendLine(string.Format(CultureInfo.CurrentCulture, "[PARSER ERROR: code {0} at {1} - {2} in {3}, token text: {4}, message: {5}]", ex.ErrorCode, GetPositionString(ex.Begin), GetPositionString(ex.End), GetFilenameOnly(ex.Begin.Filename), ex.Text, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
private string GetPositionString(PositionStruct pos)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}:{1} [{2}]", pos.Line, pos.Column, pos.Offset);
|
||||
}
|
||||
|
||||
private string GetTokenString(Token token)
|
||||
{
|
||||
if (token == null)
|
||||
{
|
||||
return "(null)";
|
||||
}
|
||||
else
|
||||
{
|
||||
string tokenText = token.Text;
|
||||
if (tokenText != null)
|
||||
{
|
||||
tokenText = tokenText.Replace("\r\n", "\\n").Replace("\n", "\\n").Replace("\r", "\\r").Replace("\t", "\\t");
|
||||
}
|
||||
string tokenFilename = token.Filename;
|
||||
tokenFilename = GetFilenameOnly(tokenFilename);
|
||||
return string.Format(CultureInfo.CurrentCulture, "[Token {0} at {1}({2}:{3} [{4}] - {5}:{6} [{7}]): '{8}']",
|
||||
token.TokenType,
|
||||
tokenFilename,
|
||||
token.Begin.Line, token.Begin.Column, token.Begin.Offset,
|
||||
token.End.Line, token.End.Column, token.End.Offset,
|
||||
tokenText);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetFilenameOnly(string fullPath)
|
||||
{
|
||||
return fullPath != null ? Path.GetFileName(fullPath) : null;
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
string inputFilename = GetTestscriptFilePath(CurrentTestName);
|
||||
StringBuilder output = new StringBuilder();
|
||||
|
||||
TokenizeWithLexer(inputFilename, output);
|
||||
TestParser(inputFilename, output);
|
||||
|
||||
string baselineFilename = GetBaselineFilePath(CurrentTestName);
|
||||
string baseline;
|
||||
|
||||
try
|
||||
{
|
||||
baseline = GetFileContent(baselineFilename).Replace("\r\n", "\n");
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
baseline = string.Empty;
|
||||
}
|
||||
|
||||
string outputString = output.ToString().Replace("\r\n", "\n");
|
||||
|
||||
//Console.WriteLine(baselineFilename);
|
||||
|
||||
if (string.Compare(baseline, outputString, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
DumpToTrace(CurrentTestName, outputString);
|
||||
string outputFilename = Path.Combine(TraceFilePath, GetBaselineFileName(CurrentTestName));
|
||||
Console.WriteLine(":: Output does not match the baseline!");
|
||||
Console.WriteLine("code --diff \"" + baselineFilename + "\" \"" + outputFilename + "\"");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(":: To update the baseline:");
|
||||
Console.WriteLine("copy \"" + outputFilename + "\" \"" + baselineFilename + "\"");
|
||||
Console.WriteLine();
|
||||
testFailed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common.Baselined;
|
||||
using Xunit;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.TSQLExecutionEngine;
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
public class BatchParserTests : BaselinedTest
|
||||
{
|
||||
private bool testFailed = false;
|
||||
|
||||
public BatchParserTests()
|
||||
{
|
||||
InitializeTest();
|
||||
}
|
||||
|
||||
public void InitializeTest()
|
||||
{
|
||||
CategoryName = "BatchParser";
|
||||
this.TraceOutputDirectory = RunEnvironmentInfo.GetTraceOutputLocation();
|
||||
TestInitialize();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VerifyThrowOnUnresolvedVariable()
|
||||
{
|
||||
string script = "print '$(NotDefined)'";
|
||||
StringBuilder output = new StringBuilder();
|
||||
|
||||
TestCommandHandler handler = new TestCommandHandler(output);
|
||||
IVariableResolver resolver = new TestVariableResolver(new StringBuilder());
|
||||
using (Parser p = new Parser(
|
||||
handler,
|
||||
resolver,
|
||||
new StringReader(script),
|
||||
"test"))
|
||||
{
|
||||
p.ThrowOnUnresolvedVariable = true;
|
||||
handler.SetParser(p);
|
||||
|
||||
Assert.Throws<BatchParserException>(() => p.Parse());
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VerifyExecuteScript()
|
||||
{
|
||||
string query = "select @@version";
|
||||
ExecutionEngineTest executionEngineTest = new ExecutionEngineTest();
|
||||
executionEngineTest.TestInitialize();
|
||||
using (ExecutionEngine engine = new ExecutionEngine())
|
||||
{
|
||||
engine.ExecuteScript(query);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanceltheBatch()
|
||||
{
|
||||
Batch batch = new Batch();
|
||||
batch.Cancel();
|
||||
}
|
||||
|
||||
private static Stream GenerateStreamFromString(string s)
|
||||
{
|
||||
MemoryStream stream = new MemoryStream();
|
||||
StreamWriter writer = new StreamWriter(stream);
|
||||
writer.Write(s);
|
||||
writer.Flush();
|
||||
stream.Position = 0;
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void TokenizeWithLexer(string filename, StringBuilder output)
|
||||
{
|
||||
// Create a new file by changing CRLFs to LFs and generate a new steam
|
||||
// or the tokens generated by the lexer will always have off by one errors
|
||||
string input = File.ReadAllText(filename).Replace("\r\n", "\n");
|
||||
var inputStream = GenerateStreamFromString(input);
|
||||
using (Lexer lexer = new Lexer(new StreamReader(inputStream), filename))
|
||||
{
|
||||
|
||||
string inputText = File.ReadAllText(filename);
|
||||
inputText = inputText.Replace("\r\n", "\n");
|
||||
StringBuilder roundtripTextBuilder = new StringBuilder();
|
||||
StringBuilder outputBuilder = new StringBuilder();
|
||||
StringBuilder tokenizedInput = new StringBuilder();
|
||||
bool lexerError = false;
|
||||
|
||||
Token token = null;
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
lexer.ConsumeToken();
|
||||
token = lexer.CurrentToken;
|
||||
roundtripTextBuilder.Append(token.Text.Replace("\r\n", "\n"));
|
||||
outputBuilder.AppendLine(GetTokenString(token));
|
||||
tokenizedInput.Append('[').Append(GetTokenCode(token.TokenType)).Append(':').Append(token.Text.Replace("\r\n", "\n")).Append(']');
|
||||
} while (token.TokenType != LexerTokenType.Eof);
|
||||
}
|
||||
catch (BatchParserException ex)
|
||||
{
|
||||
lexerError = true;
|
||||
outputBuilder.AppendLine(string.Format(CultureInfo.CurrentCulture, "[ERROR: code {0} at {1} - {2} in {3}, message: {4}]", ex.ErrorCode, GetPositionString(ex.Begin), GetPositionString(ex.End), GetFilenameOnly(ex.Begin.Filename), ex.Message));
|
||||
}
|
||||
output.AppendLine("Lexer tokenized input:");
|
||||
output.AppendLine("======================");
|
||||
output.AppendLine(tokenizedInput.ToString());
|
||||
output.AppendLine("Tokens:");
|
||||
output.AppendLine("=======");
|
||||
output.AppendLine(outputBuilder.ToString());
|
||||
|
||||
if (lexerError == false)
|
||||
{
|
||||
// Verify that all text from tokens can be recombined into original string
|
||||
Assert.Equal<string>(inputText, roundtripTextBuilder.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTokenCode(LexerTokenType lexerTokenType)
|
||||
{
|
||||
switch (lexerTokenType)
|
||||
{
|
||||
case LexerTokenType.Text:
|
||||
return "T";
|
||||
case LexerTokenType.Whitespace:
|
||||
return "WS";
|
||||
case LexerTokenType.NewLine:
|
||||
return "NL";
|
||||
case LexerTokenType.Comment:
|
||||
return "C";
|
||||
default:
|
||||
return lexerTokenType.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyToOutput(string sourceDirectory, string filename)
|
||||
{
|
||||
File.Copy(Path.Combine(sourceDirectory, filename), filename, true);
|
||||
FileUtilities.SetFileReadWrite(filename);
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
public void BatchParserTest()
|
||||
{
|
||||
CopyToOutput(FilesLocation, "TS-err-cycle1.txt");
|
||||
CopyToOutput(FilesLocation, "cycle2.txt");
|
||||
Start("err-blockComment");
|
||||
Start("err-blockComment2");
|
||||
Start("err-varDefinition");
|
||||
Start("err-varDefinition2");
|
||||
Start("err-varDefinition3");
|
||||
Start("err-varDefinition4");
|
||||
Start("err-varDefinition5");
|
||||
Start("err-varDefinition6");
|
||||
Start("err-varDefinition7");
|
||||
Start("err-varDefinition8");
|
||||
Start("err-varDefinition9");
|
||||
Start("err-variableRef");
|
||||
Start("err-variableRef2");
|
||||
Start("err-variableRef3");
|
||||
Start("err-variableRef4");
|
||||
Start("err-cycle1");
|
||||
Start("input");
|
||||
Start("input2");
|
||||
Start("pass-blockComment");
|
||||
Start("pass-lineComment");
|
||||
Start("pass-lineComment2");
|
||||
Start("pass-noBlockComments");
|
||||
Start("pass-noLineComments");
|
||||
Start("pass-varDefinition");
|
||||
Start("pass-varDefinition2");
|
||||
Start("pass-varDefinition3");
|
||||
Start("pass-varDefinition4");
|
||||
Start("pass-command-and-comment");
|
||||
Assert.False(testFailed, "At least one of test cases failed. Check output for details.");
|
||||
}
|
||||
|
||||
public void TestParser(string filename, StringBuilder output)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create a new file by changing CRLFs to LFs and generate a new steam
|
||||
// or the tokens generated by the lexer will always have off by one errors
|
||||
TestCommandHandler commandHandler = new TestCommandHandler(output);
|
||||
string input = File.ReadAllText(filename).Replace("\r\n", "\n");
|
||||
var inputStream = GenerateStreamFromString(input);
|
||||
StreamReader streamReader = new StreamReader(inputStream);
|
||||
|
||||
using (Parser parser = new Parser(
|
||||
commandHandler,
|
||||
new TestVariableResolver(output),
|
||||
streamReader,
|
||||
filename))
|
||||
{
|
||||
commandHandler.SetParser(parser);
|
||||
parser.Parse();
|
||||
}
|
||||
}
|
||||
catch (BatchParserException ex)
|
||||
{
|
||||
output.AppendLine(string.Format(CultureInfo.CurrentCulture, "[PARSER ERROR: code {0} at {1} - {2} in {3}, token text: {4}, message: {5}]", ex.ErrorCode, GetPositionString(ex.Begin), GetPositionString(ex.End), GetFilenameOnly(ex.Begin.Filename), ex.Text, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
private string GetPositionString(PositionStruct pos)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}:{1} [{2}]", pos.Line, pos.Column, pos.Offset);
|
||||
}
|
||||
|
||||
private string GetTokenString(Token token)
|
||||
{
|
||||
if (token == null)
|
||||
{
|
||||
return "(null)";
|
||||
}
|
||||
else
|
||||
{
|
||||
string tokenText = token.Text;
|
||||
if (tokenText != null)
|
||||
{
|
||||
tokenText = tokenText.Replace("\r\n", "\\n").Replace("\n", "\\n").Replace("\r", "\\r").Replace("\t", "\\t");
|
||||
}
|
||||
string tokenFilename = token.Filename;
|
||||
tokenFilename = GetFilenameOnly(tokenFilename);
|
||||
return string.Format(CultureInfo.CurrentCulture, "[Token {0} at {1}({2}:{3} [{4}] - {5}:{6} [{7}]): '{8}']",
|
||||
token.TokenType,
|
||||
tokenFilename,
|
||||
token.Begin.Line, token.Begin.Column, token.Begin.Offset,
|
||||
token.End.Line, token.End.Column, token.End.Offset,
|
||||
tokenText);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetFilenameOnly(string fullPath)
|
||||
{
|
||||
return fullPath != null ? Path.GetFileName(fullPath) : null;
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
string inputFilename = GetTestscriptFilePath(CurrentTestName);
|
||||
StringBuilder output = new StringBuilder();
|
||||
|
||||
TokenizeWithLexer(inputFilename, output);
|
||||
TestParser(inputFilename, output);
|
||||
|
||||
string baselineFilename = GetBaselineFilePath(CurrentTestName);
|
||||
string baseline;
|
||||
|
||||
try
|
||||
{
|
||||
baseline = GetFileContent(baselineFilename).Replace("\r\n", "\n");
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
baseline = string.Empty;
|
||||
}
|
||||
|
||||
string outputString = output.ToString().Replace("\r\n", "\n");
|
||||
|
||||
//Console.WriteLine(baselineFilename);
|
||||
|
||||
if (string.Compare(baseline, outputString, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
DumpToTrace(CurrentTestName, outputString);
|
||||
string outputFilename = Path.Combine(TraceFilePath, GetBaselineFileName(CurrentTestName));
|
||||
Console.WriteLine(":: Output does not match the baseline!");
|
||||
Console.WriteLine("code --diff \"" + baselineFilename + "\" \"" + outputFilename + "\"");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(":: To update the baseline:");
|
||||
Console.WriteLine("copy \"" + outputFilename + "\" \"" + baselineFilename + "\"");
|
||||
Console.WriteLine();
|
||||
testFailed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,74 @@
|
||||
using System;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
{
|
||||
public class BatchParserWrapperTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckSimpleSingleSQLBatchStatement()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "select * from sys.objects";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(sqlScript, batch.BatchText);
|
||||
Assert.Equal(1, batch.StartLine);
|
||||
Assert.Equal(1, batch.StartColumn);
|
||||
Assert.Equal(2, batch.EndLine);
|
||||
Assert.Equal(sqlScript.Length+1, batch.EndColumn);
|
||||
Assert.Equal(1, batch.BatchExecutionCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSQLBatchStatementWithRepeatExecution()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "select * from sys.object" + Environment.NewLine + "GO 2";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(2, batch.BatchExecutionCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckComment()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "-- this is a comment --";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(sqlScript, batch.BatchText);
|
||||
Assert.Equal(1, batch.StartLine);
|
||||
Assert.Equal(1, batch.StartColumn);
|
||||
Assert.Equal(2, batch.EndLine);
|
||||
Assert.Equal(sqlScript.Length+1, batch.EndColumn);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckNoOps()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "GO";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(0, batches.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
public class BatchParserWrapperTests
|
||||
{
|
||||
[Fact]
|
||||
public void CheckSimpleSingleSQLBatchStatement()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "select * from sys.objects";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(sqlScript, batch.BatchText);
|
||||
Assert.Equal(1, batch.StartLine);
|
||||
Assert.Equal(1, batch.StartColumn);
|
||||
Assert.Equal(2, batch.EndLine);
|
||||
Assert.Equal(sqlScript.Length + 1, batch.EndColumn);
|
||||
Assert.Equal(1, batch.BatchExecutionCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckSQLBatchStatementWithRepeatExecution()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "select * from sys.object" + Environment.NewLine + "GO 2";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(2, batch.BatchExecutionCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckComment()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "-- this is a comment --";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(1, batches.Count);
|
||||
BatchDefinition batch = batches[0];
|
||||
Assert.Equal(sqlScript, batch.BatchText);
|
||||
Assert.Equal(1, batch.StartLine);
|
||||
Assert.Equal(1, batch.StartColumn);
|
||||
Assert.Equal(2, batch.EndLine);
|
||||
Assert.Equal(sqlScript.Length + 1, batch.EndColumn);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckNoOps()
|
||||
{
|
||||
using (BatchParserWrapper parserWrapper = new BatchParserWrapper())
|
||||
{
|
||||
string sqlScript = "GO";
|
||||
var batches = parserWrapper.GetBatches(sqlScript);
|
||||
Assert.Equal(0, batches.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using System.Text;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
internal class TestCommandHandler : ICommandHandler
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
internal sealed class TestVariableResolver : IVariableResolver
|
||||
{
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
<Reference Include="Castle.Core">
|
||||
<HintPath>../../bin/ref/Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" />
|
||||
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
|
||||
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
|
||||
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" />
|
||||
<ProjectReference Include="../../src/Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
|
||||
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.1" />
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<PackageReference Include="xunit" Version="2.2.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
|
||||
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -26,16 +26,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
|
||||
Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperNotInitialized);
|
||||
Assert.NotNull(ServiceLayerSr.QueryServiceColumnNull);
|
||||
Assert.NotNull(ServiceLayerSr.Culture);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParser_CircularReference);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParser_CommentNotTerminated);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParser_IncorrectSyntax);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParser_StringNotTerminated);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParser_VariableNotDefined);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchCancelling);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchMessage);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchResultSetFinished);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchResultSetProcessing);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineError);
|
||||
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionError);
|
||||
Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullConnection);
|
||||
Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullOwnerUri);
|
||||
@@ -48,23 +38,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
|
||||
Assert.NotNull(ServiceLayerSr.ConnectionServiceDbErrorDefaultNotConnected(""));
|
||||
Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNotConnected(""));
|
||||
Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNullOwnerUri);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchError_Exception);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Halting);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Ignoring);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionInfo_RowsAffected);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageNoLineInfo);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageNoProcedureInfo);
|
||||
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageWithProcedureInfo);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionError_CommandNotSupported);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionError_VariableNotFound);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_FinalizingLoop);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_InitializingLoop);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_QueryCancelledbyUser);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ExecutionNotYetCompleteError);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ScriptError_Error);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ScriptError_FatalError);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ScriptError_ParsingSyntax);
|
||||
Assert.NotNull(ServiceLayerSr.EE_ScriptError_Warning);
|
||||
Assert.NotNull(ServiceLayerSr.ErrorEmptyStringReplacement);
|
||||
Assert.NotNull(ServiceLayerSr.PeekDefinitionAzureError(""));
|
||||
Assert.NotNull(ServiceLayerSr.PeekDefinitionDatabaseError);
|
||||
@@ -104,7 +77,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
|
||||
Assert.NotNull(ServiceLayerSr.QueryServiceSubsetBatchOutOfRange);
|
||||
Assert.NotNull(ServiceLayerSr.QueryServiceSubsetResultSetOutOfRange);
|
||||
Assert.NotNull(ServiceLayerSr.TestLocalizationConstant);
|
||||
Assert.NotNull(ServiceLayerSr.TroubleshootingAssistanceMessage);
|
||||
Assert.NotNull(ServiceLayerSr.WorkspaceServiceBufferPositionOutOfOrder(0,0,0,0));
|
||||
Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionColumnOutOfRange(0));
|
||||
Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionLineOutOfRange);
|
||||
|
||||
Reference in New Issue
Block a user