/ Artifact Content
Login

Artifact 7f88fd969c22521cbf0a0d61eec19eddd3863d12:

Ticket change [7f88fd96] - New ticket [1b266395] INSERT OR REPLACE with a foreign key constraint leads to assertion fault. by drh 2015-09-30 12:10:31.
D 2015-09-30T12:10:31.051
J foundin 3.8.11.1
J icomment The\sfollowing\sscript\scauses\san\sassertion\sfault:\r\n\r\n<blockquote><pre>\r\nPRAGMA\sforeign_keys=1;\r\nCREATE\sTABLE\sFoo\s(Id\sINTEGER\sPRIMARY\sKEY,\sParentId\sINTEGER\sREFERENCES\sFoo(Id)\sON\sDELETE\sCASCADE,\sC1);\r\nINSERT\sOR\sREPLACE\sINTO\sFoo(Id,\sParentId,\sC1)\sVALUES\s(1,\snull,\s'A');\r\nINSERT\sOR\sREPLACE\sINTO\sFoo(Id,\sParentId,\sC1)\sVALUES\s(2,\s1,\s'A-2-1');\r\nINSERT\sOR\sREPLACE\sINTO\sFoo(Id,\sParentId,\sC1)\sVALUES\s(3,\s2,\s'A-3-2');\r\nINSERT\sOR\sREPLACE\sINTO\sFoo(Id,\sParentId,\sC1)\sVALUES\s(4,\s3,\s'A-4-3');\r\nINSERT\sOR\sREPLACE\sINTO\sFoo(Id,\sParentId,\sC1)\sVALUES\s(2,\s3,\s'A-2-3');\r\n</pre></blockquote>\r\n\r\nThis\sproblem\sappears\sto\shave\sbeen\sintroduced\swith\sversion\s3.8.4,\sspecifically\r\nat\scheck-in\s[56bc5ce8958c8e625].
J login drh
J mimetype text/x-fossil-wiki
J severity Severe
J status Open
J title INSERT\sOR\sREPLACE\swith\sa\sforeign\skey\sconstraint\sleads\sto\sassertion\sfault
J type Code_Defect
K 1b266395d6bc1041dbd907194539b2b81b7af1e2
U drh
Z 8b580d2e863e4889ee80b9863c46ac2e