I’ve also implemented valentyn’s fix above in Principal.pm’s _HasRoleRightQuery function and Record.pm’s LockForUpdate function while getting my RT 5.0.3 instance running with MySQL 8:
*** rt-5.0.3/lib/RT/Principal.pm 2022-07-13 09:28:34.000000000 -0400
--- /opt/rt5/lib/RT/Principal.pm 2023-05-23 15:46:46.805091969 -0400
***************
*** 628,633 ****
--- 629,635 ----
. "AND Principals.id = CachedGroupMembers.GroupId "
. "AND CachedGroupMembers.MemberId IN (" . ( join ',', ('?') x (1 + @{ $groups->ItemsArrayRef } ) ) . ") "
;
+ $query =~ s/([\s,.])Groups([\s.,])/$1`Groups`$2/g;
my @bind_values = ( 0, 0, 'Group', $self->Id, map { $_->id } @{ $groups->ItemsArrayRef } );
if ( $args{'Roles'} ) {
The Record.pm LockForUpdate function had to be rewritten a little since the query was written out instead of being part of a variable:
*** rt-5.0.3/lib/RT/Record.pm 2022-07-13 09:28:34.000000000 -0400
--- /opt/rt5/lib/RT/Record.pm 2023-05-24 12:56:03.458711724 -0400
***************
*** 1615,1623 ****
"UPDATE " .$self->Table.
" SET $pk = $pk WHERE 1 = 0");
} else {
return $self->_LoadFromSQL(
! "SELECT * FROM ".$self->Table
! ." WHERE $pk = ? FOR UPDATE",
$id,
);
}
--- 1615,1625 ----
"UPDATE " .$self->Table.
" SET $pk = $pk WHERE 1 = 0");
} else {
+ my $query = "SELECT * FROM ".$self->Table
+ ." WHERE $pk = ? FOR UPDATE";
+ $query =~ s/([\s,.])Groups([\s.,])/$1`Groups`$2/g;
return $self->_LoadFromSQL(
! $query,
$id,
);
}
I am glad to hear that 5.0.4 beta is planning to support MySQL 8, but I already have my installation up and am under a time constraint to complete my migration, so I want to avoid any other potential issues with upgrading to a new version right now. Thanks to the RT team for addressing the need for supporting MySQL 8.