From f4c7fe516cba5472980419f50afadc77a2094855 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 22 Oct 2022 22:31:46 +0800 Subject: [PATCH] Update MySql error message --- .../MySql/DbMaintenance/MySqlDbMaintenance.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs b/Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs index a27e1c8d9..1b265f6d7 100644 --- a/Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs @@ -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)