Yongheng Chen, on Tuesday, December 31, 2019 03:21 AM, wrote...
>
> Hi,
>
> We found a debug assertion bug in sqlite. Here’s the PoC:
> —
> CREATE TABLE v0 ( v1 , v2 FLOAT ) ;
> CREATE TRIGGER x AFTER INSERT ON v0
> BEGIN
>     INSERT INTO v0 SELECT DISTINCT v2 / 10 , v2 / 1 FROM v0 ;
> END;
> INSERT INTO v0 ( v1 , v1 ) VALUES ( '' , 10 ) ,( '' , 0 ) ,( 'AIR' , 10
> );
> UPDATE v0 SET v2 = randomblob ( v2 ) ;
> SELECT coalesce ( max ( quote ( v1 ) ) , 10 ) FROM v0 GROUP BY v1 ;
> —
>
> This bug affects debug builds based on trunk and the latest release
> version.
>
> Special thanks to Manuel Rigger for all his help. And thanks every one in
> the sqlite team for your great work.

I don't know what "This bug affects debug builds...", this worked on 3.30.0 
released version.

 8:10:31.22>sqlite3
SQLite version 3.30.0 2019-10-04 15:03:17
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE v0 ( v1 , v2 FLOAT ) ;
sqlite> CREATE TRIGGER x AFTER INSERT ON v0
   ...> BEGIN
   ...>     INSERT INTO v0 SELECT DISTINCT v2 / 10 , v2 / 1 FROM v0 ;
   ...> END;
sqlite> INSERT INTO v0 ( v1 , v1 ) VALUES ( '' , 10 ) ,( '' , 0 ) ,( 'AIR' , 10 
);
sqlite> UPDATE v0 SET v2 = randomblob ( v2 ) ;
sqlite> SELECT coalesce ( max ( quote ( v1 ) ) , 10 ) FROM v0 GROUP BY v1 ;
NULL
''
'AIR'
sqlite>

But, I am not running any debugger. ;-)

josé
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to