diff --git a/Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreTests.cs b/Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreTests.cs index 16ea772b..89645199 100644 --- a/Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreTests.cs +++ b/Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreTests.cs @@ -1094,7 +1094,7 @@ protected async Task BulkScheduleInsertsAllFunctionsSuccessfully(Task new IdWithParam(functionId, Param: "".ToUtf8Bytes())) + functionIds.Select(functionId => new IdWithParam(functionId, Param: functionId.ToString().ToUtf8Bytes())) ); var eligibleFunctions = @@ -1105,6 +1105,13 @@ await store.BulkScheduleFunctions( { eligibleFunctions.Any(f => f.FlowId == flowId).ShouldBeTrue(); } + + foreach (var id in functionIds) + { + var sf = await store.GetFunction(id); + sf.ShouldNotBeNull(); + sf.Parameter!.ToStringFromUtf8Bytes().ShouldBe(id.ToString()); + } } public abstract Task DifferentTypesAreFetchedByGetExpiredFunctionsCall(); diff --git a/Stores/MySQL/Cleipnir.ResilientFunctions.MySQL/MySqlFunctionStore.cs b/Stores/MySQL/Cleipnir.ResilientFunctions.MySQL/MySqlFunctionStore.cs index 2fff20f2..b6378a7c 100644 --- a/Stores/MySQL/Cleipnir.ResilientFunctions.MySQL/MySqlFunctionStore.cs +++ b/Stores/MySQL/Cleipnir.ResilientFunctions.MySQL/MySqlFunctionStore.cs @@ -142,7 +142,7 @@ INSERT IGNORE INTO {_tablePrefix} var rows = new List(); foreach (var ((type, instance), param) in functionsWithParam) { - var row = $"('{type.Value.EscapeString()}', '{instance.Value.EscapeString()}', {(param == null ? "NULL" : $"'0x{Convert.ToHexString(param)}'")}, {(int) Status.Postponed}, 0, 0, {now})"; + var row = $"('{type.Value.EscapeString()}', '{instance.Value.EscapeString()}', {(param == null ? "NULL" : $"x'{Convert.ToHexString(param)}'")}, {(int) Status.Postponed}, 0, 0, {now})"; rows.Add(row); } var rowsSql = string.Join(", " + Environment.NewLine, rows);