From ffb6170a4e2bd438a1077f86cd6a6cfce98b5099 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 27 Oct 2019 22:26:15 +0100 Subject: [PATCH] Fix definition of PostgreSQL Oid from Integer to Cardinal, as it is in postgres_ext.h . Should fix negative Oids in TPGQuery.TableName. See https://www.heidisql.com/forum.php?t=34819 --- source/dbconnection.pas | 8 ++++---- source/dbstructures.pas | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index bfb24a78..ea93e7d9 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -86,7 +86,7 @@ type // General purpose editing status flag TEditingStatus = (esUntouched, esModified, esDeleted, esAddedUntouched, esAddedModified, esAddedDeleted); - TIntStringPairs = TDictionary; + TOidStringPairs = TDictionary; TColumnDefaultType = (cdtNothing, cdtText, cdtNull, cdtAutoInc, cdtExpression); @@ -347,7 +347,7 @@ type FKeepAliveTimer: TTimer; FFavorites: TStringList; FPrefetchResults: TDBQueryList; - FRegClasses: TIntStringPairs; + FRegClasses: TOidStringPairs; procedure SetActive(Value: Boolean); virtual; abstract; procedure DoBeforeConnect; virtual; procedure DoAfterConnect; virtual; @@ -459,7 +459,7 @@ type property LockedByThread: TThread read FLockedByThread write SetLockedByThread; property Datatypes: TDBDataTypeArray read FDatatypes; property Favorites: TStringList read FFavorites; - property RegClasses: TIntStringPairs read FRegClasses; + property RegClasses: TOidStringPairs read FRegClasses; function GetLockedTableCount(db: String): Integer; function IdentifierEquals(Ident1, Ident2: String): Boolean; published @@ -1545,7 +1545,7 @@ begin FKeepAliveTimer := TTimer.Create(Self); FFavorites := TStringList.Create; // PG only, cache for 123::regclass queries: - FRegClasses := TIntStringPairs.Create; + FRegClasses := TOidStringPairs.Create; end; diff --git a/source/dbstructures.pas b/source/dbstructures.pas index 21c538f8..5b8a8784 100644 --- a/source/dbstructures.pas +++ b/source/dbstructures.pas @@ -366,7 +366,7 @@ type TPQConnectStatus = (CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE, CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV, CONNECTION_SSL_STARTUP, CONNECTION_NEEDED); PPGconn = Pointer; PPGresult = Pointer; - POid = Integer; + POid = Cardinal; // Server variables TVarScope = (vsGlobal, vsSession, vsBoth);