Yes, this is a bug. Thank you for the clear and concise bug report. The problem is that incorrect byte-code was being generated for a INSERT into a table that has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and where there is also an ON CONFLICT clause on the INSERT that applies to some constraint other than the INTEGER PRIMARY KEY. When the incorrect byte-code is run, an assertion-fault or a NULL-pointer dereference might occur. The problem was introduced by [check-in 6b01a24daab1e5bc][1] from about one year ago. That check-in enhanced the upsert capabilities. A preliminary fix has been checked in at [check-in 2f09b51b1ff37bf9][2]. The actual fix is the single new line of code at line 2010 of the insert.c source file. The other changes shown in that check-in are for testing and validation only. [1]: src:/info/6b01a24daab1e5bc [2]: src:/info/2f09b51b1ff37bf9