Merge remote-tracking branch 'origin/multTasks'
# Conflicts: # ConsoleApp2/HostedServices/OutputService.cs # ConsoleApp2/HostedServices/TransformService.cs # ConsoleApp2/Program.cs
This commit is contained in:
@@ -77,6 +77,7 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogCritical(e, "Error when flushing records, sql: {Sql}", cmd.CommandText.Omit(1000));
|
||||
_context.AddException(e);
|
||||
|
||||
var match = MatchTableName().Match(cmd.CommandText);
|
||||
if (match is { Success: true, Groups.Count: > 1 })
|
||||
@@ -92,6 +93,7 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogCritical(e, "Error when serialize records, record:");
|
||||
_context.AddException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -156,6 +158,11 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
|
||||
recordSb.Append("''");
|
||||
else recordSb.Append($"0x{field}");
|
||||
break;
|
||||
case ColumnType.Json:
|
||||
recordSb.Append(string.IsNullOrEmpty(field)
|
||||
? "\"[]\""
|
||||
: _transformOptions.Value.TransformBinary?.Invoke(field) ?? field);
|
||||
break;
|
||||
case ColumnType.UnDefine:
|
||||
default:
|
||||
recordSb.Append(field);
|
||||
|
Reference in New Issue
Block a user