Feature execution plan settings and request implementation (#213)

* experimental showplan implementation (tools side only)

* fix for redundant massages from showplan executions

* moved showplan batches to new variables to make it less confusing

* returns showplan as part of batch summary with in each result summary

* cleaned up showplan resultsets

* cleaning up code and making showplan var optional

* changes all var names to showplan

* adding estimated support

* small fixes

* updatin var names and adding EPOptions struct

* adding ssms execution plan logic based on server types

* adding special actions logic

* removing redundant name changes

* execution plan query handler added

* cleaning up functions and data structures

* seperated special actions into its own class

* cleaning up special actions

* cleaning up code

* small new line fixes

* commenting out pre-yukon code

* removing all pre yukon code

* last yukon code commented out

* fixes broken tests

* adding related unit tests; integration tests incoming

* finishing tests and cleaning up code

* semantic changes

* cleaning up semantics

* changes and test fixes, also adding new exceptions into RS

* fixing special actions and cleaning up request logic

* fixing comment to trigger new build

* triggering another  build

* fixed up specialaction and added tests for it
This commit is contained in:
Raymond Martin
2017-01-17 19:37:42 -08:00
committed by GitHub
parent 0e29b181c9
commit 8a8d4338f1
20 changed files with 855 additions and 1 deletions

View File

@@ -0,0 +1,80 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
{
/// <summary>
/// Class that represents a Special Action which occured by user request during the query
/// </summary>
public class SpecialAction {
#region Private Class variables
// Underlying representation as bitwise flags to simplify logic
[Flags]
private enum ActionFlags
{
None = 0,
// All added options must be powers of 2
ExpectYukonXmlShowPlan = 1
}
private ActionFlags flags;
#endregion
/// <summary>
/// The type of XML execution plan that is contained with in a result set
/// </summary>
public SpecialAction()
{
flags = ActionFlags.None;
}
#region Public Functions
/// <summary>
/// No Special action performed
/// </summary>
public bool None
{
get { return flags == ActionFlags.None; }
set
{
flags = ActionFlags.None;
}
}
/// <summary>
/// Contains an XML execution plan result set
/// </summary>
public bool ExpectYukonXMLShowPlan
{
get { return flags.HasFlag(ActionFlags.ExpectYukonXmlShowPlan); }
set
{
if (value)
{
// OR flags with value to apply
flags |= ActionFlags.ExpectYukonXmlShowPlan;
}
else
{
// AND flags with the inverse of the value we want to remove
flags &= ~(ActionFlags.ExpectYukonXmlShowPlan);
}
}
}
/// <summary>
/// Aggregate this special action with the input
/// </summary>
public void CombineSpecialAction(SpecialAction action)
{
flags |= action.flags;
}
#endregion
};
}