The update in bug 22868 flips bit 12 in flags on, however, it was backported and there is no check that the flag is off. A borrower who had bit 11 will now have 4096 added twice which will break their permissions
Created attachment 106240 [details] [review] Bug 25858: Don't attempt to set flag if already set
Hi Why not use & | and ^ ? UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) Regards Didier
(In reply to didier from comment #2) > Hi > > Why not use & | and ^ ? > > UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) > > Regards > Didier That is much more concise, I am not sure if it is clearer, but I am happy to have either solution, we just need to get this fixed
Created attachment 106282 [details] [review] Bug 25858: Don't attempt to set flag if already set Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
(In reply to Nick Clemens from comment #3) > (In reply to didier from comment #2) > > Hi > > > > Why not use & | and ^ ? > > > > UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) > > > > Regards > > Didier > > That is much more concise, I am not sure if it is clearer, but I am happy to > have either solution, we just need to get this fixed I confirm both solutions work, but in my opinion Didier's solution is more clear about what the intention is. I'll provide a followup
Created attachment 106314 [details] [review] Bug 25858: Don't attempt to set flag if already set Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 106315 [details] [review] Bug 25858: Use bitwise OR for setting a bit in borrowers.flag Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com>
Looks like it is impossible to add a new update DB entry to fix this problem :-/
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.02
backported to 19.11.x for 19.11.08
Backported to 19.05.x branch for 19.05.13