mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Restrict settings to known values (#821)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
||||||
using Microsoft.SqlTools.Utility;
|
using Microsoft.SqlTools.Utility;
|
||||||
|
|
||||||
@@ -420,10 +421,17 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
|||||||
return GetOptionValue<string>("transactionIsolationLevel", DefaultTransactionIsolationLevel);
|
return GetOptionValue<string>("transactionIsolationLevel", DefaultTransactionIsolationLevel);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (string.Equals("READ UNCOMMITTED", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("READ COMMITTED", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("REPEATABLE READ", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("SNAPSHOT", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("SERIALIZABLE", value, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
SetOptionValue("transactionIsolationLevel", value);
|
SetOptionValue("transactionIsolationLevel", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set deadlock priority
|
/// Set deadlock priority
|
||||||
@@ -435,10 +443,15 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
|||||||
return GetOptionValue<string>("deadlockPriority", DefaultDeadlockPriority);
|
return GetOptionValue<string>("deadlockPriority", DefaultDeadlockPriority);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (string.Equals("LOW", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("NORMAL", value, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals("HIGH", value, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
SetOptionValue("deadlockPriority", value);
|
SetOptionValue("deadlockPriority", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set lock timeout
|
/// Set lock timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user