[sqlite] Assertion `memIsValid(pRec)' failed

2020-01-01 Thread Yongheng Chen
Hi, We found an assertion failed in sqlite. And this assertion seems not to be fixed completely. Here’s the POC: — CREATE TABLE v0 ( v1 ) ; INSERT INTO v0 ( v1 ) VALUES ( 10 ) ,( 10 ) ; UPDATE v0 SET v1 = ( SELECT coalesce ( quote ( NULL ) , quote ( v1 ) , ( SELECT 1 FROM v0 AS v WHERE ( SELECT

[sqlite] Assertion `(mFlags_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z)' failed.

2020-01-01 Thread Yongheng Chen
Hi, We found an assertion failed in sqlite. Here’s the POC: — CREATE TABLE v0 ( v1 VARCHAR(15) ) ; INSERT INTO v0 ( v1 ) VALUES ( 10 ) ,( 10 ) ; UPDATE v0 SET v1 = ( SELECT coalesce ( quote ( NULL ) , quote ( v1 ) , quote ( v1 ) , 0 ) FROM v0 ORDER BY substr ( v1 , v1 , 10 ) ) ; —- This exists

Re: [sqlite] Causal profiling

2020-01-01 Thread Peter da Silva
Also spaghetti inheritance is a thing. On Wed, Jan 1, 2020, 19:19 D Burgess wrote: > > I’ve spent too much time lately trying to figure out or debug hellacious > C spaghetti code > > And I’ve spent too much time lately trying to figure out or debug > hellacious C++ spaghetti code > > Someone

Re: [sqlite] Causal profiling

2020-01-01 Thread D Burgess
> I’ve spent too much time lately trying to figure out or debug hellacious C > spaghetti code And I’ve spent too much time lately trying to figure out or debug hellacious C++ spaghetti code Someone who writes bad C, will write even worse C++ ___

[sqlite] Assertion `memIsValid(pRec)' failed

2020-01-01 Thread Yongheng Chen
Hi, We found an assertion failed in sqlite. Here’s the POC: — CREATE TABLE v0 ( v1 CHAR(25) ) ; CREATE TRIGGER myname AFTER INSERT ON v0 BEGIN INSERT INTO v0 SELECT ( SELECT ifnull ( count ( DISTINCT ( SELECT v1 FROM v0 ) ) , 10 ) ) FROM v0 AS d WHERE v1 = v1 AND v1 <= v1 GROUP BY v1 , v1 ORDER

Re: [sqlite] New SQL functions available for testing only.

2020-01-01 Thread Richard Hipp
On 1/1/20, Manuel Rigger wrote: > Thanks for adding these functions! My test generator/fuzzer is written in > Java and uses the JDBC interface. In order to call the C function, I would > probably need to modify the driver code or use JNI, which would both be a > bit hacky. Is there a compile-time

Re: [sqlite] New SQL functions available for testing only.

2020-01-01 Thread Manuel Rigger
Thanks for adding these functions! My test generator/fuzzer is written in Java and uses the JDBC interface. In order to call the C function, I would probably need to modify the driver code or use JNI, which would both be a bit hacky. Is there a compile-time option that can be set to provide

Re: [sqlite] New SQL functions available for testing only.

2020-01-01 Thread Jens Alfke
> On Jan 1, 2020, at 8:03 AM, Richard Hipp wrote: > > expr_implies_expr(A,B) > > Return non-zero if expression A implies expression B. See > https://www.sqlite.org/src/artifact/971e442fd5?ln=5277-5299 for > details. This routine is used to determine if a partial index is > usable. Thanks!

[sqlite] New SQL functions available for testing only.

2020-01-01 Thread Richard Hipp
Fuzzers and testers: I've created some new built-in SQL functions for SQLite that provide direct access to some of the internal code-generator routines that have historically given trouble: expr_compare(A,B) This function returns non-zero if expressions A and B are different. See

[sqlite] Assertion `memIsValid([p1+idx])' failed.

2020-01-01 Thread Yongheng Chen
Hi, We found an assertion failed in sqlite. Here’s the POC: — CREATE TABLE v0 ( v1 DOUBLE PRIMARY KEY ) ; INSERT INTO v0 VALUES ( 10 ) ; SELECT * FROM v0 NATURAL JOIN v0 NATURAL JOIN v0 WHERE v1 = 9223372036854775807 OR ( ( v1 = ( SELECT 10 + sum ( v1 LIKE 'LG PACK' ) OVER( ORDER BY v1 ) ) AND

[sqlite] Assertion `pRes->iTable==pSrc->a[0].iCursor'

2020-01-01 Thread Yongheng Chen
Hi, We found an assertion failed in sqlite. Here’s the POC: — CREATE TABLE v0 ( v2 INTEGER PRIMARY KEY , v1 AS( 10.10 ) UNIQUE ) ; SELECT * FROM v0 WHERE v1 + 10 IN ( SELECT v2 FROM v0 NATURAL JOIN v0 WHERE v2 IN ( SELECT v1 FROM v0 ORDER BY v1 ) ) ; —- This exists in the latest development