mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Avoid running SHOW TABLE STATUS FROM '' and friends on an empty database name, when trying to determine a column's origin.
This commit is contained in:
@@ -2272,12 +2272,14 @@ begin
|
||||
|
||||
if Field.table <> Field.org_table then begin
|
||||
// Probably a VIEW, in which case we rely on the first column's table name.
|
||||
// TODO: This is unsafe when joining a view with a table/view.
|
||||
Objects := Connection.GetDBObjects(Connection.DecodeAPIString(Field.db));
|
||||
for Obj in Objects do begin
|
||||
if (Obj.Name = Connection.DecodeAPIString(Field.table)) and (Obj.NodeType = lntView) then begin
|
||||
tbl := Field.table;
|
||||
break;
|
||||
// TODO: This is unsafe when joining a view with a table/view.
|
||||
if Field.db <> '' then begin
|
||||
Objects := Connection.GetDBObjects(Connection.DecodeAPIString(Field.db));
|
||||
for Obj in Objects do begin
|
||||
if (Obj.Name = Connection.DecodeAPIString(Field.table)) and (Obj.NodeType = lntView) then begin
|
||||
tbl := Field.table;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if tbl <> '' then
|
||||
|
||||
Reference in New Issue
Block a user