View Issue Details

IDProjectCategoryView StatusLast Update
0003638JEDI VCL00 JVCL Componentspublic2006-06-08 08:01
ReportertellisAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version3.30 
Summary0003638: TJvCsvDataSet bug when field is string and size is 1
DescriptionIf the field size is 1 and the CP variable in TJvCustomCsvDataSet.SetFieldData does not get initialized which sometimes causes the data to get lost.

I see that this error was reported previously in 0002387 but was closed as "unable to duplicate"

Fixed code is on line 1858

Attached is an app with a sample of the error as well as my JvCSVData.pas Please note that I have also increased the MAXCOLUMNS to 120 from 80 since 80 is a bit small for some of the larger enterprise systems.

Thomas Ellis
Additional Informationprocedure TJvCustomCsvDataSet.SetFieldData(Field: TField; Buffer: Pointer);
...
          // Copy 0 to Field.Size bytes into NewVal (delphi String)
          if PChar(Buffer)[0] = Chr(0) then
            CP := -1
          else
            //TE: If the field size is 1
            //since the for-loop will not get executed and therefor the CP value
            //will never get initialized which can cause serious problems
            if Field.Size > 1 then
            begin
              for CP := 1 to Field.Size - 1 do
                if PChar(Buffer)[CP] = Chr(0) then
                  Break;
            end else
              CP := 0;

          if CP > Field.Size - 1 then
            CP := Field.Size - 1;
          NewVal := Copy(PChar(Buffer), 1, CP + 1);
TagsNo tags attached.

Activities

2006-04-14 04:50

 

JvCSVData(Error).zip (30,071 bytes)

obones

2006-06-08 08:01

administrator   ~0009492

This is now in SVN.

Issue History

Date Modified Username Field Change
2006-04-14 04:50 tellis New Issue
2006-04-14 04:50 tellis File Added: JvCSVData(Error).zip
2006-06-08 08:01 obones Status new => resolved
2006-06-08 08:01 obones Resolution open => fixed
2006-06-08 08:01 obones Assigned To => obones
2006-06-08 08:01 obones Note Added: 0009492