diff --git a/ChangeLog.txt b/ChangeLog.txt index 391d8abe8c..c63b1ad984 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,10 +7,16 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2021-03-31 20:37 UTC+0200 Aleksander Czajczynski (hb fki.pl) + * contrib/hbpgsql/tpostgre.prg + ! reverted previous commit 2021-04-01 15:55 UTC-0300 as invalid + together with a little cleanup plus another minor cleanup + 2021-04-01 15:55 UTC-0300 Marco Aurelio V (marcoprodata/at/gmail.com) * contrib/hbpgsql/tpostgre.prg ! corrected buggy in refresh method when execute commands to change struct + [REVERTED] 2021-03-31 23:43 UTC+0200 Aleksander Czajczynski (hb fki.pl) * contrib/hbpgsql/postgres.c diff --git a/contrib/hbpgsql/tpostgre.prg b/contrib/hbpgsql/tpostgre.prg index fb80e765fc..6cb3f60304 100644 --- a/contrib/hbpgsql/tpostgre.prg +++ b/contrib/hbpgsql/tpostgre.prg @@ -696,13 +696,11 @@ METHOD Refresh( lQuery, lMeta ) CLASS TPQquery ::lEof := .F. ENDIF + ELSEIF ( ::lError := PQresultStatus( res ) != PGRES_COMMAND_OK ) + ::cError := PQresultErrorMessage( res ) ELSE - IF ( ::lError := ::nResultStatus != PGRES_COMMAND_OK ) - ::cError := "" - ::rows := Val( PQcmdTuples( res ) ) - ELSE - ::cError := PQresultErrorMessage( res ) - ENDIF + ::cError := "" + ::rows := Val( PQcmdTuples( res ) ) ENDIF ::pQuery := res @@ -1328,7 +1326,7 @@ STATIC FUNCTION ValueToString( xField ) SWITCH ValType( xField ) CASE "C" CASE "M" ; RETURN xField - CASE "D" ; RETURN IIF( Empty( xField ), NIL, DToS( xField ) ) + CASE "D" ; RETURN iif( Empty( xField ), NIL, DToS( xField ) ) CASE "N" ; RETURN hb_ntos( xField ) CASE "L" ; RETURN iif( xField, "t", "f" ) ENDSWITCH