Hi, sorry, but I thought that there would have been an automatic conversion to a float. The comparison is not 1 but a floating point literal like 1.0.
Am 12.12.2010 um 03:49 schrieb Richard Hipp: > On Sat, Dec 11, 2010 at 7:07 PM, Wanadoo Hartwig < > hartwig.wiesm...@wanadoo.nl> wrote: > >> Hi, >> >> take the following SQL statement: >> >> UPDATE tableA SET column1=(SELECT column2 FROM tableB WHERE >> function1(column3) < 1 ORDER BY function1(column3) LIMIT 1); >> >> Actually, this statement does not make sense because the ORDER BY >> expression does not fulfill the requirements of an ORDER BY expression. I >> wrote it by mistake. >> >> Interestingly SQLite only crashes if function1 is a user supplied function >> (using sqlite3_create_function). I tried the same with the core abs() >> function but then SQLite works. >> > > The statement you supply above never generates an OP_Real instruction. > OP_Real is only generated if your statement contains a floating point > literal, which yours does not. Are you user that the UPDATE statement you > are giving above is the statement that is crashing? > > This is the more precise statement: UPDATE tableA SET column1=(SELECT column2 FROM tableB WHERE function1(1.0,column3) < 1.0 ORDER BY function1(1.0,column3) LIMIT 1); Actually there is a WHERE expression in the update statement, too. But there is no difference if it exists or not (tested). > > >> I am using SQLite 3.7.2 and the crash occurs here: >> >> case OP_Real: { /* same as TK_FLOAT, out2-prerelease */ >> pOut->flags = MEM_Real; >> assert( !sqlite3IsNaN(*pOp->p4.pReal) ); <-- crashes here because of >> invalid pointer to p4 >> pOut->r = *pOp->p4.pReal; >> break; >> } >> >> >> Hartwig >> >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Hartwig _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users