Skip to content
Permalink
Browse files

Restore previous logic: Allow empty result in TableName(Column), whic…

…h is the case for data tab TEXT columns with LEFT(..) clause. Other columns may have a table name in that case. Closes #837
  • Loading branch information
ansgarbecker committed Jan 3, 2020
1 parent 7c1b0c4 commit 0d0c6df599cb534444930426962c8c3ce0bd8fbb
Showing with 5 additions and 3 deletions.
  1. +5 −3 source/dbconnection.pas
@@ -7756,9 +7756,10 @@ function TDBQuery.TableName: String;
Result := '';
for i:=0 to ColumnCount-1 do begin
NextTable := TableName(i);
if (not Result.IsEmpty) and (Result <> NextTable) then
if (not Result.IsEmpty) and (not NextTable.IsEmpty) and (Result <> NextTable) then
raise EDbError.Create(_('More than one table involved.'));
Result := NextTable;
if not NextTable.IsEmpty then
Result := NextTable;
end;
if Result.IsEmpty then begin
// Untested with joins, compute columns and views
@@ -7795,8 +7796,9 @@ function TMySQLQuery.TableName(Column: Integer): String;
end;
end;
end;
end else if Field.org_table <> '' then begin
end else begin
// Normal table column
// Note: this is empty on data tab TEXT columns with LEFT(..) clause
tbl := Field.org_table;
end;

0 comments on commit 0d0c6df

Please sign in to comment.
You can’t perform that action at this time.