View Issue Details

IDProjectCategoryView StatusLast Update
0003974JEDI VCL00 JVCL Componentspublic2007-10-12 06:27
ReportercfzwitAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version3.34 
Summary0003974: JvMemoryData bug in "FindDeleted" Method And new property "OneValueInArray"
DescriptionKlaus Greiner , Send me this BUG :

I think there is a bug in JvMemorydata (JVCL 3.20).
I get an exception in TJvMemoryData.FindDeleted.

Code:

function TJvMemoryData.FindDeleted(KeyValues: Variant): Integer;
var
  I, J, Len, Equals: Integer;
  PxKey: TPVariant;
  xKey, ValRow, ValDel: Variant;
begin
  Result := -1;
  if VarIsNull(KeyValues) then
    Exit;
  PxKey := nil;
  Len := VarArrayHighBound(KeyValues, 1)
  try
    for I := 0 to FDeletedValues.Count - 1 do
    begin
      PxKey := FDeletedValues[I];
- here the exception occurs. (EVariantBadVarTypeError) because there is
no value in the list
   -> xKey := PxKey^;
 ...

I'm not so familiar with this code to find out why... Can you help me?

The exception occurs if I load a small dataset to my JvMemoryDataset,
insert a new record, delete this inserted record and insert a record
again (with append; ... := .... ; post) At the Post of the last insert
the exception ooccors described above in FindDeleted.

(***********************************************************************)

I Tried corrected this bug in "InternalDelete", "InternalPost", "Destroy" and "FindDeleted" methods

I Added an new property : "OneValueInArray". If TRUE , the GetValues method, return the value of ONE field in a Variant Array ; if FALSE, return only the variant value without array.
This change, is for compatibility with ALL database componentes (BDE, IBX, ADO, DBISAM, etc, etc, etc)
TagsNo tags attached.

Activities

2006-10-30 06:27

 

JvMemoryDataset.pas (76,509 bytes)

obones

2007-06-19 02:52

administrator   ~0013395

No Value in the list? But the Count property returned something greater than zero, so the loop is running. This is very weird...

cfzwit

2007-06-20 08:21

reporter   ~0013500

obones :
        I try fix the count bug in this week and send you the new source code

Best regards

2007-06-20 13:40

 

JvMemoryDataset.zip (15,895 bytes)

cfzwit

2007-06-20 13:48

reporter   ~0013502

obones :

I send you a new file (JvMemoryDataset.zip), with changes and comments (into the source code). Thats changes "fixed" this "bugs".
Please, search the word "FDeletedValues.Count" and you find two comments and modifications.

Thank you !!!, and sorry my not good English.

PD : into this file, the three mantis issues are fixed.

cfzwit

2007-06-20 13:57

reporter   ~0013503

obones :

I send you a new file (JvMemoryDataset.zip), with changes and comments (into the source code). Thats changes "fixed" this "bugs".
Please, search the word "FDeletedValues.Count" and you find two comments and modifications.

Thank you !!!, and sorry my not good English.

PD : into this file, the three mantis issues are fixed.

obones

2007-10-12 06:26

administrator   ~0013914

This is now in SVN

Issue History

Date Modified Username Field Change
2006-10-30 06:27 cfzwit New Issue
2006-10-30 06:27 cfzwit File Added: JvMemoryDataset.pas
2007-06-19 02:52 obones Note Added: 0013395
2007-06-19 02:52 obones Status new => feedback
2007-06-20 08:21 cfzwit Note Added: 0013500
2007-06-20 13:40 cfzwit File Added: JvMemoryDataset.zip
2007-06-20 13:48 cfzwit Note Added: 0013502
2007-06-20 13:57 cfzwit Note Added: 0013503
2007-10-12 06:26 obones Status feedback => resolved
2007-10-12 06:26 obones Fixed in Version => Daily / SVN
2007-10-12 06:26 obones Resolution open => fixed
2007-10-12 06:26 obones Assigned To => obones
2007-10-12 06:26 obones Note Added: 0013914