View Issue Details

IDProjectCategoryView StatusLast Update
0038770FPCDatabasepublic2021-04-22 11:53
ReporterMichal Gawrycki Assigned ToLacaK  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0038770: Reducing visibility of TFieldDef.ChildDefs property.
DescriptionSince the getter for this property is not implemented, the stream writer may behave incorrectly.
I suggest lowering the visibility of this property to at least public.
Patch included.
TagsNo tags attached.
Fixed in Revision49238
FPCOldBugId
FPCTarget-
Attached Files

Activities

Michal Gawrycki

2021-04-17 17:45

reporter  

db_childdefs.patch (1,170 bytes)   
Index: packages/fcl-db/src/base/db.pas
===================================================================
--- packages/fcl-db/src/base/db.pas	(revision 49217)
+++ packages/fcl-db/src/base/db.pas	(working copy)
@@ -196,6 +196,7 @@
     procedure Assign(APersistent: TPersistent); override;
     function CreateField(AOwner: TComponent; ParentField: TObjectField = nil;  const FieldName: string = ''; CreateChildren: Boolean = True): TField;
     function HasChildDefs: Boolean;
+    property ChildDefs: TFieldDefs read GetChildDefs write SetChildDefs stored HasChildDefs;
     property FieldClass: TFieldClass read GetFieldClass;
     property FieldNo: Longint read FFieldNo;
     property CharSize: Word read GetCharSize;
@@ -206,7 +207,6 @@
   Published
     property Attributes: TFieldAttributes read FAttributes write SetAttributes default [];
     property DataType: TFieldType read FDataType write SetDataType;
-    property ChildDefs: TFieldDefs read GetChildDefs write SetChildDefs stored HasChildDefs;
     property Precision: Longint read FPrecision write SetPrecision default 0;
     property Size: Integer read GetSize write SetSize default 0;
   end;
db_childdefs.patch (1,170 bytes)   

LacaK

2021-04-19 09:11

developer   ~0130448

IMO better would be provide implementation to GetChildDefs ;-)
As a quick fix would it be better to explicitly return nil? (until correct implementation would be provided)

LacaK

2021-04-20 08:42

developer   ~0130466

added default return values (nil, 0, NULL) for (published) properties which are not implemented yet

Michal Gawrycki

2021-04-21 12:58

reporter   ~0130494

Thanks. This fixed component streaming problem.

Issue History

Date Modified Username Field Change
2021-04-17 17:45 Michal Gawrycki New Issue
2021-04-17 17:45 Michal Gawrycki File Added: db_childdefs.patch
2021-04-19 09:11 LacaK Note Added: 0130448
2021-04-20 08:42 LacaK Assigned To => LacaK
2021-04-20 08:42 LacaK Status new => feedback
2021-04-20 08:42 LacaK FPCTarget => -
2021-04-20 08:42 LacaK Note Added: 0130466
2021-04-21 12:58 Michal Gawrycki Note Added: 0130494
2021-04-21 12:58 Michal Gawrycki Status feedback => assigned
2021-04-22 11:53 LacaK Status assigned => resolved
2021-04-22 11:53 LacaK Resolution open => fixed
2021-04-22 11:53 LacaK Fixed in Version => 3.3.1
2021-04-22 11:53 LacaK Fixed in Revision => 49238