Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003638 [JEDI VCL] 00 JVCL Components major always 2006-04-14 04:50 2006-06-08 08:01
Reporter tellis View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.20
Summary 0003638: TJvCsvDataSet bug when field is string and size is 1
Description If 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 Information procedure 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);
Tags No tags attached.
Attached Files zip file icon JvCSVData(Error).zip [^] (30,071 bytes) 2006-04-14 04:50

- Relationships

-  Notes
(0009492)
obones (administrator)
2006-06-08 08:01

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker