SQLite

Artifact [b9784104]
Login

Artifact b9784104c00b3912ca9d3902b5621b6280cf7782aa871a59a1b0944b25334cc7:

Ticket change [b9784104] - New ticket [cb91bf42] Assertion fault following PRAGMA reverse_unordered_selects=ON. by drh 2017-08-01 18:21:15.
D 2017-08-01T18:21:15.304
J foundin 3.20.0
J icomment When\sassert()s\sare\senabled\s(which\sis\sto\ssay\swhen\sSQLite\sis\scompiled\susing\r\n-DSQLITE_DEBUG)\sthe\sfollowing\sSQL\scauses\san\sassertion\sfault\sin\sthe\s\r\nbyte-code\sengine:\r\n\r\n<blockquote><verbatim>\r\nPRAGMA\sreverse_unordered_selects=on;\r\nCREATE\sTABLE\st1(a,b);\r\nINSERT\sINTO\st1\sVALUES(1,2);\r\nCREATE\sINDEX\st1b\sON\st1(b);\r\nSELECT\sa\sFROM\st1\sWHERE\sb=-99\sOR\sb>1;\r\n</verbatim></blockquote>\r\n\r\nBisecting\sshows\sthat\sthis\sbug\swas\sintroduced\swith\scheck-in\s[663473850c]\s\r\non\s2016-11-15\sand\sfirst\sappeared\sin\srelease\s3.16.0.\s\sAs\sfar\sas\swe\scan\r\ndetermine\sat\sthis\stime,\sthe\sbug\sis\sharmless\sin\sthe\ssense\sthat\sSQLite\r\nfunctions\snormally\sand\scomputes\sthe\scorrect\sanswer\swhen\sassert()s\sare\r\ndisabled.\s\sHowever,\sthe\sassertion\sfault\sdoes\sindicate\sthat\sthe\slogic\r\nis\sconfused\sand\sneeds\sto\sbe\srefactored\sfor\slong-term\smaintainability.\r\n\r\nThis\sproblem\swas\sdiscovered\sby\s[https://github.com/google/oss-fuzz|OSSFuzz].
J login drh
J mimetype text/x-fossil-wiki
J severity Minor
J status Open
J title Assertion\sfault\sfollowing\sPRAGMA\sreverse_unordered_selects=ON
J type Code_Defect
K cb91bf4290c211de24389bcefd8a06d56c099d9f
U drh
Z 1d20aeb4de3709293a766b7bf338571c