错误修正
This commit is contained in:
@@ -137,9 +137,11 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
|
||||
|
||||
// 在这里处理特殊列
|
||||
#region HandleFields
|
||||
if (field.Length == 2 && field == @"\N") // MyDumper NULL
|
||||
|
||||
const string NULL = "NULL";
|
||||
if (field.Length == 2 && field == @"\N") // MyDumper导出的NULL为'\N'('\'不是转义字符)
|
||||
{
|
||||
recordSb.Append("NULL");
|
||||
recordSb.Append(NULL);
|
||||
goto Escape;
|
||||
}
|
||||
|
||||
@@ -148,14 +150,18 @@ public partial class MySqlDestination : IDisposable, IAsyncDisposable
|
||||
case ColumnType.Text:
|
||||
if(string.IsNullOrEmpty(field))
|
||||
recordSb.Append("''");
|
||||
else if (field == NULL)
|
||||
recordSb.Append(NULL);
|
||||
else recordSb.Append($"_utf8mb4 0x{field}");
|
||||
break;
|
||||
case ColumnType.Blob:
|
||||
if (string.IsNullOrEmpty(field))
|
||||
recordSb.Append("''");
|
||||
else if (field == NULL)
|
||||
recordSb.Append(NULL);
|
||||
else recordSb.Append($"0x{field}");
|
||||
break;
|
||||
case ColumnType.Json:
|
||||
case ColumnType.Json:// 生产库没有JSON列,仅用于测试库进行测试
|
||||
if(string.IsNullOrEmpty(field))
|
||||
recordSb.Append("'[]'"); // JObject or JArray?
|
||||
else if (_options.Value.TreatJsonAsHex)
|
||||
|
Reference in New Issue
Block a user