Fix wrong comparison of table and org_table in PMYSQL_FIELD. Found while looking for the cause of issue #1818

This commit is contained in:
Ansgar Becker
2023-05-31 17:23:15 +02:00
parent 7d9f59381f
commit d512e890e0

View File

@@ -9747,8 +9747,9 @@ var
Obj: TDBObject;
begin
Field := FConnection.Lib.mysql_fetch_field_direct(FCurrentResults, Column);
//Connection.Log(lcDebug, FColumnNames[Column]+': org_table:'+Field.org_table+ ' table:'+Field.table);
if Field.table^ <> Field.org_table^ then 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.
if Field.db <> '' then begin