Commit 8ce77cf6 authored by Leandro Isotton's avatar Leandro Isotton Committed by De Araujo, Renato [CONBR Non-J&J]
Browse files

Issue #3196961 by aubjr_drupal, lisotton, jmizarela, Irbis, RenatoG, aitala:...

Issue #3196961 by aubjr_drupal, lisotton, jmizarela, Irbis, RenatoG, aitala: Module install breaks on MySQL 8.0.22+ (General error: 3995 Character set 'utf8_bin' cannot be used in conjunction with 'binary' in call to regexp_like)
parent 357164fe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -141,12 +141,14 @@ function transliteration_retroactive_submit($form, &$form_state) {
function transliteration_file_query() {
  // Regular expressions are not supported by Drupal's database layer and
  // operators differ between manufacturers.
  $field = 'uri';
  switch (db_driver()) {
    case 'mysql':
    case 'mysqli':
      $operator = ' NOT REGEXP';
      if (variable_get('transliteration_file_lowercase', TRUE)) {
        $operator .= ' BINARY';
        $field = 'CAST(uri AS BINARY)';
      }
      $regex = '/[a-z0-9_.-]+$';
      break;
@@ -167,5 +169,5 @@ function transliteration_file_query() {

  return db_select('file_managed')
    ->fields('file_managed')
    ->condition('uri', $regex, $operator);
    ->where($field . $operator . ' :regex', array(':regex' => $regex));
}