Browse Source

* TBlobField must bet TBinaryField descendent, but needs to allow size 0

michael 6 years ago
parent
commit
b4fb0f45dd
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/fcl-db/db.pas

+ 7 - 1
packages/fcl-db/db.pas

@@ -662,7 +662,7 @@ type
   TBlobStreamMode = (bmRead, bmWrite, bmReadWrite);
 //  TBlobType = ftBlob..ftMemo;
 
-  TBlobField = class(TField)
+  TBlobField = class(TBinaryField)
   private
     FModified : Boolean;
     // Wrapper that retrieves FDataType as a TBlobType
@@ -670,6 +670,7 @@ type
     // Wrapper that calls SetFieldType
     //   procedure SetBlobType(AValue: TBlobType);
   protected
+    class procedure CheckTypeSize(AValue: Longint); override;
     function GetBlobSize: Longint; virtual;
     function GetIsNull: Boolean; override;
     procedure GetText(var AText: string; ADisplayText{%H-}: Boolean); override;
@@ -7027,6 +7028,11 @@ end;
 
 
 
+class procedure TBlobField.CheckTypeSize(AValue: Longint);
+begin
+  If AValue<0 then
+    DatabaseErrorFmt(SInvalidFieldSize,[AValue]);
+end;
 
 function TBlobField.GetBlobSize: Longint;