mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 MySql 8.0 索引 DESC 的判断;#1664
This commit is contained in:
parent
a4dca34547
commit
7180cddb42
@ -256,7 +256,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname);
|
|||||||
select
|
select
|
||||||
a.column_name,
|
a.column_name,
|
||||||
a.index_name 'index_id',
|
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'
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
||||||
|
@ -299,7 +299,7 @@ a.index_name 'index_id',
|
|||||||
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
||||||
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
||||||
0 'IsClustered',
|
0 'IsClustered',
|
||||||
0 'IsDesc'
|
case when a.collation = 'D' then 1 else 0 end 'IsDesc'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
||||||
";
|
";
|
||||||
|
@ -267,7 +267,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname);
|
|||||||
select
|
select
|
||||||
a.column_name,
|
a.column_name,
|
||||||
a.index_name 'index_id',
|
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'
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
||||||
|
@ -332,7 +332,7 @@ a.index_name 'index_id',
|
|||||||
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
||||||
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
||||||
0 'IsClustered',
|
0 'IsClustered',
|
||||||
0 'IsDesc'
|
case when a.collation = 'D' then 1 else 0 end 'IsDesc'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
||||||
";
|
";
|
||||||
|
@ -257,7 +257,7 @@ where a.table_schema in ({0}) and a.table_name in ({1})", tboldname ?? tbname);
|
|||||||
select
|
select
|
||||||
a.column_name,
|
a.column_name,
|
||||||
a.index_name 'index_id',
|
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'
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRIMARY'", tboldname ?? tbname);
|
||||||
|
@ -298,7 +298,7 @@ a.index_name 'index_id',
|
|||||||
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
case when a.non_unique = 0 then 1 else 0 end 'IsUnique',
|
||||||
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
case when a.index_name = 'PRIMARY' then 1 else 0 end 'IsPrimaryKey',
|
||||||
0 'IsClustered',
|
0 'IsClustered',
|
||||||
0 'IsDesc'
|
case when a.collation = 'D' then 1 else 0 end 'IsDesc'
|
||||||
from information_schema.statistics a
|
from information_schema.statistics a
|
||||||
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
where {(ignoreCase ? "lower(a.table_schema)" : "a.table_schema")} in ({databaseIn}) and {loc8}
|
||||||
";
|
";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user