Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed some too small integer types to fix #147 #155

Merged
merged 3 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ _TeamCity*
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
*.ncrunch*

# MightyMoose
*.mm.*
Expand Down Expand Up @@ -437,3 +438,4 @@ $RECYCLE.BIN/

# The build keeps auto-generating this file. We do not want this.
/.nuget/NuGet.Config

18 changes: 9 additions & 9 deletions src/DurableTask.SqlServer/Scripts/logic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ BEGIN
DECLARE @taskHub varchar(50) = __SchemaNamePlaceholder__.CurrentTaskHub()
DECLARE @now datetime2 = SYSUTCDATETIME()

DECLARE @liveInstances int = 0
DECLARE @liveTasks int = 0
DECLARE @liveInstances bigint = 0
DECLARE @liveTasks bigint = 0

SELECT
@liveInstances = COUNT(DISTINCT E.[InstanceID]),
@liveTasks = COUNT(T.[InstanceID])
@liveInstances = COUNT_BIG(DISTINCT E.[InstanceID]),
@liveTasks = COUNT_BIG(T.[InstanceID])
FROM Instances I WITH (NOLOCK)
LEFT OUTER JOIN NewEvents E WITH (NOLOCK) ON E.[TaskHub] = @taskHub AND E.[InstanceID] = I.[InstanceID]
LEFT OUTER JOIN NewTasks T WITH (NOLOCK) ON T.[TaskHub] = @taskHub AND T.[InstanceID] = I.[InstanceID]
Expand All @@ -65,12 +65,12 @@ BEGIN
DECLARE @taskHub varchar(50) = __SchemaNamePlaceholder__.CurrentTaskHub()
DECLARE @now datetime2 = SYSUTCDATETIME()

DECLARE @liveInstances int = 0
DECLARE @liveTasks int = 0
DECLARE @liveInstances bigint = 0
DECLARE @liveTasks bigint = 0

SELECT
@liveInstances = COUNT(DISTINCT E.[InstanceID]),
@liveTasks = COUNT(T.[InstanceID])
@liveInstances = COUNT_BIG(DISTINCT E.[InstanceID]),
@liveTasks = COUNT_BIG(T.[InstanceID])
FROM Instances I WITH (NOLOCK)
LEFT OUTER JOIN NewEvents E WITH (NOLOCK) ON E.[TaskHub] = @taskHub AND E.[InstanceID] = I.[InstanceID]
LEFT OUTER JOIN NewTasks T WITH (NOLOCK) ON T.[TaskHub] = @taskHub AND T.[InstanceID] = I.[InstanceID]
Expand Down Expand Up @@ -1057,7 +1057,7 @@ GO

CREATE OR ALTER PROCEDURE __SchemaNamePlaceholder__._QueryManyOrchestrations
@PageSize smallint = 100,
@PageNumber smallint = 0,
@PageNumber int = 0,
@FetchInput bit = 1,
@FetchOutput bit = 1,
@CreatedTimeFrom datetime2 = NULL,
Expand Down
4 changes: 2 additions & 2 deletions src/DurableTask.SqlServer/SqlOrchestrationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -811,13 +811,13 @@ public async Task<IReadOnlyCollection<OrchestrationState>> GetManyOrchestrations
using SqlCommand command = this.GetSprocCommand(connection, $"{this.settings.SchemaName}._QueryManyOrchestrations");

command.Parameters.Add("@PageSize", SqlDbType.SmallInt).Value = query.PageSize;
command.Parameters.Add("@PageNumber", SqlDbType.SmallInt).Value = query.PageNumber;
command.Parameters.Add("@PageNumber", SqlDbType.Int).Value = query.PageNumber;
command.Parameters.Add("@FetchInput", SqlDbType.Bit).Value = query.FetchInput;
command.Parameters.Add("@FetchOutput", SqlDbType.Bit).Value = query.FetchOutput;
command.Parameters.Add("@CreatedTimeFrom", SqlDbType.DateTime2).Value = createdTimeFrom;
command.Parameters.Add("@CreatedTimeTo", SqlDbType.DateTime2).Value = createdTimeTo;
command.Parameters.Add("@InstanceIDPrefix", SqlDbType.VarChar, size: 100).Value = query.InstanceIdPrefix ?? SqlString.Null;
command.Parameters.Add("@ExcludeSubOrchestrations", SqlDbType.SmallInt).Value = query.ExcludeSubOrchestrations;
command.Parameters.Add("@ExcludeSubOrchestrations", SqlDbType.Bit).Value = query.ExcludeSubOrchestrations;

if (query.StatusFilter?.Count > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion test/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker pull mcr.microsoft.com/mssql/server:$tag

# Start the SQL Server docker container with the specified edition
Write-Host "Starting SQL Server $tag $sqlpid docker container on port $port" -ForegroundColor DarkYellow
docker run $additinalRunFlags --name mssql-server -e 'ACCEPT_EULA=Y' -e "SA_PASSWORD=$pw" -e "MSSQL_PID=$sqlpid" -p ${port}:1433 -d mcr.microsoft.com/mssql/server:$tag
docker run $additinalRunFlags --name mssql-server -e 'ACCEPT_EULA=Y' -e "MSSQL_SA_PASSWORD=$pw" -e "MSSQL_PID=$sqlpid" -p ${port}:1433 -d mcr.microsoft.com/mssql/server:$tag
bhugot marked this conversation as resolved.
Show resolved Hide resolved

# The container needs a bit more time before it can start accepting commands
Write-Host "Sleeping for 30 seconds to let the container finish initializing..." -ForegroundColor Yellow
Expand Down