- 修复 Firebird Embedded 版本系统表 isidentity_type 兼容问题;

This commit is contained in:
28810
2020-10-18 19:23:13 +08:00
parent 0783b432cf
commit b91fe2ca4d
3 changed files with 30 additions and 7 deletions

View File

@ -196,7 +196,7 @@ where rdb$system_flag=0" + (tbname == null ? "" : $" and {(ignoreCase ? "upper(t
}
loc8.Append(")");
sql = string.Format(@"
sql = $@"
select
trim(d.rdb$relation_name),
trim(a.rdb$field_name),
@ -226,15 +226,15 @@ case
coalesce((select ' SUB_TYPE ' || rdb$type from rdb$types where b.rdb$field_type = 261 and rdb$type = b.rdb$field_sub_type and rdb$field_name = 'RDB$FIELD_SUB_TYPE' rows 1),'')
end || trim(case when b.rdb$dimensions = 1 then '[]' else '' end),
case when a.rdb$null_flag = 1 then 0 else 1 end,
case when a.rdb$identity_type = 1 then 1 else 0 end,
{((_orm.Ado as FirebirdAdo)?.IsFirebird2_5 == true ? "0" : "case when a.rdb$identity_type = 1 then 1 else 0 end")},
a.rdb$description,
a.rdb$default_value
from rdb$relation_fields a
inner join rdb$fields b on b.rdb$field_name = a.rdb$field_source
inner join rdb$relations d on d.rdb$relation_name = a.rdb$relation_name
where a.rdb$system_flag = 0 and {0}
where a.rdb$system_flag = 0 and {loc8}
order by a.rdb$relation_name, a.rdb$field_position
", loc8);
";
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
if (ds == null) return loc1;