From d512e890e024c51d61545960294fd011dbda376f Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 31 May 2023 17:23:15 +0200 Subject: [PATCH] Fix wrong comparison of table and org_table in PMYSQL_FIELD. Found while looking for the cause of issue #1818 --- source/dbconnection.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 845492e1..93e5d4fd 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -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