mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
- Fix detection of views in a SHOW TABLE STATUS result. Don't rely on the "Comment" field containing the exact string "VIEW", as it can also contain an error message wrt a corrupted view.
- Show this potential message in the "Comment" column of ListTables
This commit is contained in:
@ -2181,7 +2181,7 @@ begin
|
||||
// Engine
|
||||
ListCaptions.Add('');
|
||||
// Comment
|
||||
ListCaptions.Add('');
|
||||
ListCaptions.Add(FieldContent('Comment'));
|
||||
// Version
|
||||
ListCaptions.Add('');
|
||||
// Row_format
|
||||
|
@ -2177,8 +2177,16 @@ end;
|
||||
// Tell type of db object (table|view) by a given row from a SHOW TABLE STATUS result
|
||||
function GetDBObjectType( TableStatus: TFields ): Byte;
|
||||
begin
|
||||
{**
|
||||
@see http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html
|
||||
For views, all the fields displayed by SHOW TABLE STATUS are NULL except
|
||||
that Name indicates the view name and Comment says view.
|
||||
@note The "Comment" column can contain different content, normally "VIEW"
|
||||
but for views which is missing its tables, it says
|
||||
"Views bla references invalid..."
|
||||
}
|
||||
if TableStatus[1].IsNull // Engine column is NULL for views
|
||||
and (LowerCase( TableStatus.FieldByName('Comment').AsString) = 'view') then
|
||||
and TableStatus[2].IsNull then
|
||||
Result := NODETYPE_VIEW
|
||||
else
|
||||
Result := NODETYPE_BASETABLE;
|
||||
|
Reference in New Issue
Block a user