From 7180cddb4269cfa66ddcf2f9f89f4c9d43de4842 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Tue, 14 Nov 2023 15:24:14 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20MySql=208.0=20?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=20DESC=20=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=9B#1664?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Providers/FreeSql.Provider.Custom/MySql/CustomMySqlCodeFirst.cs | 2 +- Providers/FreeSql.Provider.Custom/MySql/CustomMySqlDbFirst.cs | 2 +- Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs | 2 +- Providers/FreeSql.Provider.MySql/MySqlDbFirst.cs | 2 +- Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs | 2 +- Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlDbFirst.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlCodeFirst.cs b/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlCodeFirst.cs index 61546848..0212b3fb 100644 --- a/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlCodeFirst.cs +++ b/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlCodeFirst.cs @@ -256,7 +256,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname); select a.column_name, a.index_name 'index_id', -0 'IsDesc', +case when a.collation = 'D' then 1 else 0 end 'IsDesc', case when a.non_unique = 0 then 1 else 0 end 'IsUnique' from information_schema.statistics a where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname); diff --git a/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlDbFirst.cs b/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlDbFirst.cs index 6a90d2d5..4b6dc699 100644 --- a/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlDbFirst.cs +++ b/Providers/FreeSql.Provider.Custom/MySql/CustomMySqlDbFirst.cs @@ -299,7 +299,7 @@ a.index_name 'index_id', case when a.non_unique = 0 then 1 else 0 end 'IsUnique', case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey', 0 'IsClustered', -0 'IsDesc' +case when a.collation = 'D' then 1 else 0 end 'IsDesc' from information_schema.statistics a where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8} "; diff --git a/Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs b/Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs index c70a0952..12ce4260 100644 --- a/Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs +++ b/Providers/FreeSql.Provider.MySql/MySqlCodeFirst.cs @@ -267,7 +267,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname); select a.column_name, a.index_name 'index_id', -0 'IsDesc', +case when a.collation = 'D' then 1 else 0 end 'IsDesc', case when a.non_unique = 0 then 1 else 0 end 'IsUnique' from information_schema.statistics a where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname); diff --git a/Providers/FreeSql.Provider.MySql/MySqlDbFirst.cs b/Providers/FreeSql.Provider.MySql/MySqlDbFirst.cs index 47dd0d82..3e4034a2 100644 --- a/Providers/FreeSql.Provider.MySql/MySqlDbFirst.cs +++ b/Providers/FreeSql.Provider.MySql/MySqlDbFirst.cs @@ -332,7 +332,7 @@ a.index_name 'index_id', case when a.non_unique = 0 then 1 else 0 end 'IsUnique', case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey', 0 'IsClustered', -0 'IsDesc' +case when a.collation = 'D' then 1 else 0 end 'IsDesc' from information_schema.statistics a where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8} "; diff --git a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs index d970d326..d5a54ce4 100644 --- a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs +++ b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlCodeFirst.cs @@ -257,7 +257,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname); select a.column_name, a.index_name 'index_id', -0 'IsDesc', +case when a.collation = 'D' then 1 else 0 end 'IsDesc', case when a.non_unique = 0 then 1 else 0 end 'IsUnique' from information_schema.statistics a where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname); diff --git a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlDbFirst.cs b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlDbFirst.cs index cc3cc2b8..2ec4635e 100644 --- a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlDbFirst.cs +++ b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlDbFirst.cs @@ -298,7 +298,7 @@ a.index_name 'index_id', case when a.non_unique = 0 then 1 else 0 end 'IsUnique', case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey', 0 'IsClustered', -0 'IsDesc' +case when a.collation = 'D' then 1 else 0 end 'IsDesc' from information_schema.statistics a where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8} ";