PostgreSQ regression wile switch 7.2->7.3
In case actual (from prepared stmt) parameter type is non-binary (string for example) but actual parameter is binded as binary type (Int for example) AV occures inside pglib. In this case binding should fallback to non-binary, but it doesn't.
Fix:
--- a/src/dbc/ZDbcPostgreSqlStatement.pas
+++ b/src/dbc/ZDbcPostgreSqlStatement.pas
@@ -1759,7 +1759,7 @@ var PGSQLType: TZSQLType;
procedure SetAsRaw; begin SetRawByteString(Index{$IFNDEF GENERIC_INDEX}+1{$ENDIF}, IntToRaw(Value)); end;
begin
PGSQLType := OIDToSQLType(Index, SQLType);
- if (Ord(PGSQLType) < Ord(stGUID)) then begin
+ if (Ord(PGSQLType) < Ord(stGUID)) and (PGSQLType <> stUnknown) then begin
if (FPQparamValues[Index] = nil) or (BindList[Index].SQLType <> PGSQLType) then
if ZSQLType2PGBindSizes[PGSQLType] <= 4 then begin
BindList.Put(Index, PGSQLType, P4Bytes(@Value));
Diff:
Applied with some more lines which may couse same error.
R5513 testing-7.3 (SVN).
Thank you. Please close if OK.
Last edit: EgonHugeist 2019-03-13
I can't verify it until "unofficial" git reository will be synced, because my CI depends on git submodules (Zeos is one of submodule). As far as it syncs my CI verify it on both windows anf linux
Last edit: Pavel Mash 2019-03-13
Verified and closed