D 2018-07-11T13:37:14.444 J icomment The\sproblem\swas\sthat\sthe\saffinity\schange\sfrom\s'1'\sto\s1\son\sthe\sPRIMARY\sKEY\r\ncolumn\swas\shappening\son\sthe\sfirst\sconstraint\scheck\sin\sbytecode\sorder,\swhich\r\nis\sthe\sUNIQUE\sconstraint.\s\sBut\sthe\sPRIMARY\sKEY\sconstraint\swas\schecked\sfirst,\r\nand\shence\swas\schecked\sbefore\sthe\saffinity\schange.\s\sThe\sfix\swas\sto\smove\sthe\r\naffinity\schange\sto\sbefore\sthe\sbranch\sthat\sreorders\sthe\sconstraint\schecks\r\nfor\sthe\sUPSERT. J login drh J mimetype text/x-fossil-wiki J resolution Fixed J status Fixed K 79cad5e4b2e219dd197242e9e5f4ef950f554684 U drh Z 3e9fd862dea028377ee6df54cac9a754