Browse Source

Merge commit '33e03bb2cf250e93f09e1a0a6a42dad620d2e565' into githubsy/SqlSugar5-indexfix

pull/20/head
Sysaa 2 years ago
parent
commit
98c2a78d08
  1. 3
      Src/Asp.NetCore2/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs
  2. 2
      Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs

3
Src/Asp.NetCore2/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs

@ -393,7 +393,8 @@ namespace SqlSugar
}
public virtual bool IsAnyIndex(string indexName)
{
string sql = string.Format(this.IsAnyIndexSql, indexName);
//string sql = string.Format(this.IsAnyIndexSql, indexName);
string sql = string.Format(this.IsAnyIndexSql, indexName, this.Context.Ado.Connection.Database);
return this.Context.Ado.GetInt(sql)>0;
}
public virtual bool AddRemark(EntityInfo entity)

2
Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs

@ -269,7 +269,7 @@ namespace SqlSugar
{
get
{
return "SELECT count(*) FROM information_schema.statistics WHERE index_name = '{0}'";
return "SELECT count(*) FROM information_schema.statistics WHERE index_name = '{0}' and index_schema = '{1}'";
}
}
#endregion

Loading…
Cancel
Save