]> git.evergreen-ils.org Git - Evergreen.git/commit
LP 1786534: Don't merge a user with itself.
authorJason Stephenson <jason@sigio.com>
Fri, 10 Aug 2018 19:10:04 +0000 (15:10 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 13 Sep 2018 14:20:20 +0000 (10:20 -0400)
commit9ca85be79f32a35cd6e8d0159a02b84c61fb3031
treef4ee619a6ff5aee1683c9dc721cc8bd76f3558aa
parent04c79c3d914ca59a92f8fd4ff05b9de5ffcdd010
LP 1786534: Don't merge a user with itself.

It's possible to merge a user with itself using the actor.usr_merge
database function.  This does not produce a useful result.  One ends
up with a user that is flagged deleted, has a null card field, and is
likely to have their addresses and other cards deleted from the
database.

A simple check at the top of the database function to bail if the
src_usr and dest_usr are the same prevents this from happening.  That
is the change that this commit makes.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/999.functions.global.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.actor_usr_merge-bail-on-same-user.sql [new file with mode: 0644]