mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-22 02:51:58 +08:00
Synchronization code
This commit is contained in:
@@ -1310,7 +1310,7 @@ namespace SqlSugar
|
||||
|
||||
#region Helper
|
||||
|
||||
private void SugarCatch(Exception ex, string sql, SugarParameter[] parameters)
|
||||
protected virtual void SugarCatch(Exception ex, string sql, SugarParameter[] parameters)
|
||||
{
|
||||
if (sql != null && sql.Contains("{year}{month}{day}"))
|
||||
{
|
||||
|
||||
@@ -275,6 +275,25 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public override bool IsAnyTable(string tableName, bool isCache = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
return base.IsAnyTable(tableName, isCache);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (SugarCompatible.IsFramework && ex.Message == "Invalid attempt to Read when reader is closed.")
|
||||
{
|
||||
Check.ExceptionEasy($"To upgrade the MySql.Data. Error:{ex.Message}", $" 请先升级MySql.Data 。 详细错误:{ex.Message}");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
public override bool IsAnyColumnRemark(string columnName, string tableName)
|
||||
{
|
||||
var isAny=this.Context.DbMaintenance.GetColumnInfosByTableName(tableName, false)
|
||||
|
||||
@@ -139,5 +139,14 @@ namespace SqlSugar
|
||||
}
|
||||
return result;
|
||||
}
|
||||
protected override void SugarCatch(Exception ex, string sql, SugarParameter[] parameters)
|
||||
{
|
||||
base.SugarCatch(ex, sql, parameters);
|
||||
|
||||
if (ex is NullReferenceException&&SugarCompatible.IsFramework)
|
||||
{
|
||||
Check.ExceptionEasy($"To upgrade the MySql.Data. Error:{ex.Message}", $" 请先升级MySql.Data 。 详细错误:{ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SqlSugar
|
||||
public async Task<int> ExecuteBulkCopyAsync(DataTable dt)
|
||||
{
|
||||
|
||||
var dllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "failFiles");
|
||||
var dllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bulkcopyfiles");
|
||||
DirectoryInfo dir = new DirectoryInfo(dllPath);
|
||||
if (!dir.Exists)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ namespace SqlSugar
|
||||
// IsolationLevel.Parse
|
||||
MySqlBulkLoader bulk = new MySqlBulkLoader(conn)
|
||||
{
|
||||
CharacterSet = "UTF8",
|
||||
CharacterSet = "utf8mb4",
|
||||
FieldTerminator = ",",
|
||||
FieldQuotationCharacter = '"',
|
||||
EscapeCharacter = '"',
|
||||
|
||||
Reference in New Issue
Block a user