Browse Source

Update mysql createindex bug

(cherry picked from commit a7a73fd94b)

# Conflicts:
#	Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs
pull/20/head
Sysaa 2 years ago
parent
commit
33e03bb2cf
  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

@ -333,7 +333,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

@ -268,7 +268,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