> Maybe running under control of a debugger would help to locate the exact error position
I am not familiar with C code or C debugging, but will look into that. RBS On Thu, Oct 22, 2015 at 3:11 PM, Hick Gunter <hick at scigames.at> wrote: > > > >> Can you reproduce the problem using the sqlite shell? > >This won't be easy as the UDF is in an ActiveX dll, not in sqlite3.dlll > > > >This is the output from explain, run on this SQL: > >SELECT XXX(F1, F2) as A, XXX(F1, F2) as B FROM UDF_TEST limit 3 XXX will > just add the results of the integer values of fields F1 and F2. > >I put the underscore in the below table to indicate empty values as it is > a bit tricky to get this nicely lined up in the e-mail. > >addr opcode p1 p2 p3 p4 p5 > >0 Init 0 15 0 _ 0 > >1 Integer 3 1 0 _ 0 > >2 OpenRead 0 664359 0 _ 0 > >3 Rewind 0 13 0 _ 0 > >4 Column 0 0 4 _ 0 > >5 Column 0 1 5 _ 0 > >6 Function0 0 4 2 XXX(2) 2 > >7 Column 0 0 4 _ 0 > >8 Column 0 1 5 _ 0 > >9 Function0 0 4 3 XXX(2) 2 > >10 ResultRow 2 2 0 _ 0 > >11 DecrJumpZero 1 13 0 _ 0 > >12 Next 0 4 0 _ 1 > >13 Close 0 0 0 _ 0 > >14 Halt 0 0 0 _ 0 > >15 Transaction 0 0 867 0 1 > >16 TableLock 0 664359 0 UDF_TEST 0 > >17 Goto 0 1 0 _ 0 > > > >UDF_TEST is the name of the callback function that resides in the ActiveX > dll. > > > >> Also, your function needs to call exactly one sqlite3_result_xxx() > >function, specifying the context received as the first parameter. > >Yes, it does that. > > > >I also tried simply just setting the result and nil else: > > > >Public Sub Sum2Fields3(ByVal lPtr_ObjContext As Long, ByVal lArgCount As > Long, ByVal lPtr_ObjSQLite3_Value As Long) > > sqlite3_result_int lPtr_ObjContext, 123 End Sub > > > >And still the same crash, so that is if the UDF is called twice in the > same statement. > >The crash happens on the first sqlite3_step. > >All result codes prior to this are fine. > > The generated code looks good. It is loading the fields into contigous > registers and then calling the UDF with a parameter count of 2. > > Maybe running under control of a debugger would help to locate the exact > error position > > > ___________________________________________ > Gunter Hick > Software Engineer > Scientific Games International GmbH > FN 157284 a, HG Wien > Klitschgasse 2-4, A-1130 Vienna, Austria > Tel: +43 1 80100 0 > E-Mail: hick at scigames.at > > This communication (including any attachments) is intended for the use of > the intended recipient(s) only and may contain information that is > confidential, privileged or legally protected. Any unauthorized use or > dissemination of this communication is strictly prohibited. If you have > received this communication in error, please immediately notify the sender > by return e-mail message and delete all copies of the original > communication. Thank you for your cooperation. > > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >