Skip to content

Commit

Permalink
Merge branch '5.0-releng/mysql-unquote-index-name' into 5.0.4-releng
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed May 3, 2023
2 parents a651fac + 98c7202 commit 0c0f0b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/RT/Handle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2249,8 +2249,13 @@ sub CreateIndex {
my $self = shift;
my %args = ( Table => undef, Name => undef, Columns => [], CaseInsensitive => {}, @_ );

my $quoted_table; # Quoted table only for mysql.
if (RT->Config->Get('DatabaseType') eq 'mysql') {
$args{'Table'} = $self->QuoteName( $self->_CanonicTableNameMysql( $args{'Table'} ));
$args{'Table'} = $self->_CanonicTableNameMysql( $args{'Table'} );
$quoted_table = $self->QuoteName($args{'Table'});
}
else {
$quoted_table = $args{'Table'};
}

my $name = $args{'Name'};
Expand All @@ -2270,9 +2275,10 @@ sub CreateIndex {
}
}


my $sql = "CREATE"
. ($args{'Unique'}? ' UNIQUE' : '')
." INDEX $name ON $args{'Table'}"
." INDEX $name ON $quoted_table"
."(". join( ', ', @columns ) .")"
;

Expand Down

0 comments on commit 0c0f0b0

Please sign in to comment.