I have a custom collation which worked well in 3.3.6,
but now gives random errors on 3.3.13.  Might just be
coincidence but wanted to get feedback from the
community.

Under random circumstances, my Delphi function
(compare function defined in sqlite3_create_collation)
doesn't seem to receive the right parameters.  After
debugging, the error...

"Access violation at address 00405190 in module
'app.exe'. Read of address 016D000" 

...happens in line #15, like if the pointer to the
second variable (B) is invalid:

 1 FUNCTION fnComp(user:pointer;
 2   lenA:integer; A:pChar;
 3   lenB:integer; B:pChar
 4   ):integer; cdecl;
 5
 6 VAR S1,S2 :string; 
 7     i:integer;
 8 BEGIN
 9  S1 := '';
10  S2 := '';
11  IF lenA>0 THEN 
12    S1 := copy(A,1,lenA);
13
14  IF lenB>0 THEN
15    S2 := copy(B,1,lenB); // error happens here!
16
17  i := ansiCompareText(S1,S2);
18
19  IF (i=0) THEN 
20    IF (lena<lenb) THEN
21      i := -1
22    ELSE
23      i := 1
24  ELSE ;
25
26 Result := i;
27 END;
...
The collation is created using:

sqlResult:=sqlite3_create_collation(db3,
   'myCollate',
   SQLITE_UTF8,
   self,
   fnComp);

- - - -
No error happens when using the BINARY and NOCASE
collation.

Does anybody have similar experiences or have a clue
of what might be going on?  The error happens after
processing several thousand records, but sometimes
happens on an INSERT, other times during a SELECT, and
never in exactly the same place (even with the same
set of data/database).

jp




 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to