mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:09:27 +02:00
fcl-db: sdfdataset: fix seting null value to Field, Buffer=nil
git-svn-id: trunk@30532 -
This commit is contained in:
parent
c8f610282d
commit
b5bac61409
@ -631,10 +631,10 @@ begin
|
|||||||
TempPos := RecBuf;
|
TempPos := RecBuf;
|
||||||
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
||||||
Result := (RecBuf < StrEnd(TempPos));
|
Result := (RecBuf < StrEnd(TempPos));
|
||||||
if Result and (Buffer <> nil) then
|
if Result and Assigned(Buffer) then
|
||||||
begin
|
begin
|
||||||
StrLCopy(Buffer, RecBuf, Field.Size);
|
StrLCopy(Buffer, RecBuf, Field.Size);
|
||||||
if FTrimSpace then
|
if FTrimSpace then // trim trailing spaces
|
||||||
begin
|
begin
|
||||||
TempPos := StrEnd(Buffer);
|
TempPos := StrEnd(Buffer);
|
||||||
repeat
|
repeat
|
||||||
@ -674,7 +674,7 @@ begin
|
|||||||
DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName]);
|
DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName]);
|
||||||
if State in [dsEdit, dsInsert, dsNewValue] then
|
if State in [dsEdit, dsInsert, dsNewValue] then
|
||||||
Field.Validate(Buffer);
|
Field.Validate(Buffer);
|
||||||
if Field.FieldKind <> fkInternalCalc then
|
if Assigned(Buffer) and (Field.FieldKind <> fkInternalCalc) then
|
||||||
begin
|
begin
|
||||||
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
||||||
BufEnd := StrEnd(pansichar(ActiveBuffer)); // Fill with blanks when necessary
|
BufEnd := StrEnd(pansichar(ActiveBuffer)); // Fill with blanks when necessary
|
||||||
|
Loading…
Reference in New Issue
Block a user