change group INSERT to REPLACE to prevent merge problems in multi-master DB clusters
This commit is contained in:
parent
5e6483e97f
commit
2a519d5ae9
2 changed files with 3 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
- fixed #12050: Thing query caching #1
|
||||
- added: Let CHI cache request $dbh via an "args" : [ "dbh" ] cache conf
|
||||
- added: lineage increment_step and increment_offset for multi-master DB clusters
|
||||
- Change Group INSERT to REPLACE to prevent merge problems in multi-master DB clusters
|
||||
|
||||
7.10.11
|
||||
- fixed #12057: WebGUI::Search, assetIds search clause
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ sub addGroups {
|
|||
my $group = WebGUI::Group->new($self->session, $gid);
|
||||
my $recursive = isIn($self->getId, @{$group->getGroupsIn(1)});
|
||||
next GROUP if $recursive;
|
||||
$self->session->db->write("insert into groupGroupings (groupId,inGroup) values (?,?)",[$gid, $self->getId]);
|
||||
$self->session->db->write("REPLACE into groupGroupings (groupId,inGroup) values (?,?)",[$gid, $self->getId]);
|
||||
}
|
||||
$self->clearCaches();
|
||||
return 1;
|
||||
|
|
@ -169,7 +169,7 @@ sub addUsers {
|
|||
foreach my $uid (@{$users}) {
|
||||
my ($isIn) = $self->session->db->quickArray("select count(*) from groupings where groupId=? and userId=?", [$self->getId, $uid]);
|
||||
unless ($isIn) {
|
||||
$self->session->db->write("insert into groupings (groupId,userId,expireDate) values (?,?,?)", [$self->getId, $uid, (time()+$expireOffset)]);
|
||||
$self->session->db->write("REPLACE into groupings (groupId,userId,expireDate) values (?,?,?)", [$self->getId, $uid, (time()+$expireOffset)]);
|
||||
$self->session->stow->delete("gotGroupsForUser");
|
||||
} else {
|
||||
$self->userGroupExpireDate($uid,(time()+$expireOffset));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue