View Issue Details

IDProjectCategoryView StatusLast Update
0026064FPCDatabasepublic2015-08-30 23:26
Reporterdmitryb Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWin32OSWin7 
Target Version2.6.5Fixed in Version3.0.0 
Summary0026064: TBlobField.BlobType is out of range
DescriptionTBlobField.BlobType is out of range
On creating new TBlobField the BlobType property = 0
Steps To ReproduceCreate new TBlobField at run time
TagsNo tags attached.
Fixed in Revision27645
FPCOldBugId
FPCTarget
Attached Files

Activities

dmitryb

2014-04-24 11:21

reporter  

TestBlob.zip (129,183 bytes)

Reinier Olislagers

2014-04-24 12:53

developer   ~0074559

1. Ran test project on Laz trunk, FPC trunk x86, Windows. Confirmed that blobtype gives result 0 which indeed is not ftBlob or any of the other TBlobTypes...
Creating bufdataset in code gives the same result

2. Attached patch seems to fix the problem. Comments?

3. Related: Blobtype apparently can be this:
TBlobType = ftBlob..ftWideMemo =>
ftBlob, ftMemo, ftGraphic, ftFmtMemo,
    ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar,
    ftWideString, ftLargeint, ftADT, ftArray, ftReference,
    ftDataSet, ftOraBlob, ftOraClob, ftVariant, ftInterface,
    ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd, ftFixedWideChar, ftWideMemo
is this as expected? I would expect e.g. ftWideString, ftLargeInt to not be part of this.

Reinier Olislagers

2014-04-24 12:53

developer  

blobtype.diff (412 bytes)   
Index: packages/fcl-db/src/base/fields.inc
===================================================================
--- packages/fcl-db/src/base/fields.inc	(revision 27644)
+++ packages/fcl-db/src/base/fields.inc	(working copy)
@@ -2999,7 +2999,10 @@
 
 begin
   If AValue in [Low(TBlobType)..High(TBlobType)] then
+    begin
     SetDatatype(AValue);
+    FBlobType := AValue;
+    end;
 end;
 
 { TMemoField }
blobtype.diff (412 bytes)   

Michael Van Canneyt

2014-04-24 13:15

administrator   ~0074560

Patch is IMHO not good enough. It doesn't set blobtype for TMemoField for example, because that calls SetDataType directly in it's constructor.

I would expect TField.SetDataType to be virtual, override this in TBlobField
and in the overridden method set FBlobType.

Or else SetDataType must be changed to SetFieldType everywhere.

Reinier Olislagers

2014-04-24 16:07

developer   ~0074563

Chose first option; implemented r27645.

dmitryb, thanks for reporting; please test with fpc trunk and close if ok. Thanks.

Reinier Olislagers

2014-04-24 16:50

developer   ~0074564

@dmitry, you cannot add notes once the issue is marked resolved; you have to reopen it first (which I just did).

dmitryb

2014-04-24 17:03

reporter   ~0074565

Ok, How to apply fix in my installed Lazatus?

Reinier Olislagers

2014-04-24 17:17

developer   ~0074566

Please ask these questions on the Lazarus mailing list or the forum (I'm not active on the forum right now). One way of doing this is to run my fpcup tool specifying the trunk fpc version http://wiki.lazarus.freepascal.org/fpcup

There is also a lot of documentation on installing FPC+Lazarus on the wiki http://wiki.lazarus.freepascal.org/Installing_Lazarus

I'm resolving this issue now but happy to help on the Lazarus mailing list

Issue History

Date Modified Username Field Change
2014-04-24 11:21 dmitryb New Issue
2014-04-24 11:21 dmitryb File Added: TestBlob.zip
2014-04-24 11:30 Reinier Olislagers Project Mantis => FPC
2014-04-24 11:31 Reinier Olislagers Category Other => Database
2014-04-24 12:53 Reinier Olislagers Note Added: 0074559
2014-04-24 12:53 Reinier Olislagers File Added: blobtype.diff
2014-04-24 13:15 Michael Van Canneyt Note Added: 0074560
2014-04-24 14:39 Reinier Olislagers Assigned To => Reinier Olislagers
2014-04-24 14:39 Reinier Olislagers Status new => assigned
2014-04-24 16:07 Reinier Olislagers Fixed in Revision => 27645
2014-04-24 16:07 Reinier Olislagers Note Added: 0074563
2014-04-24 16:07 Reinier Olislagers Status assigned => resolved
2014-04-24 16:07 Reinier Olislagers Resolution open => fixed
2014-04-24 16:07 Reinier Olislagers Target Version => 2.6.5
2014-04-24 16:27 dmitryb Tag Attached: Hot to add Notes?
2014-04-24 16:49 Reinier Olislagers Tag Detached: Hot to add Notes?
2014-04-24 16:50 Reinier Olislagers Note Added: 0074564
2014-04-24 16:50 Reinier Olislagers Status resolved => feedback
2014-04-24 16:50 Reinier Olislagers Resolution fixed => reopened
2014-04-24 17:03 dmitryb Note Added: 0074565
2014-04-24 17:03 dmitryb Status feedback => assigned
2014-04-24 17:17 Reinier Olislagers Note Added: 0074566
2014-04-24 17:18 Reinier Olislagers Status assigned => resolved
2014-04-24 17:18 Reinier Olislagers Resolution reopened => fixed
2015-08-30 23:26 Joost van der Sluis Assigned To Reinier Olislagers =>
2015-08-30 23:26 Joost van der Sluis Fixed in Version => 3.0.1