Project

General

Profile

Revision b0dc3a2e

Added by Julien Enselme over 7 years ago

Update to Drupal 7.52

View differences:

drupal7/includes/database/mysql/schema.inc
39 39
      $info['table'] = substr($table, ++$pos);
40 40
    }
41 41
    else {
42
      $db_info = Database::getConnectionInfo();
43
      $info['database'] = $db_info[$this->connection->getTarget()]['database'];
42
      $db_info = $this->connection->getConnectionOptions();
43
      $info['database'] = $db_info['database'];
44 44
      $info['table'] = $table;
45 45
    }
46 46
    return $info;
......
81 81
    // Provide defaults if needed.
82 82
    $table += array(
83 83
      'mysql_engine' => 'InnoDB',
84
      'mysql_character_set' => 'utf8',
84
      // Allow the default charset to be overridden in settings.php.
85
      'mysql_character_set' => $this->connection->utf8mb4IsActive() ? 'utf8mb4' : 'utf8',
85 86
    );
86 87

  
87 88
    $sql = "CREATE TABLE {" . $name . "} (\n";
......
109 110
      $sql .= ' COLLATE ' . $info['collation'];
110 111
    }
111 112

  
113
    // The row format needs to be either DYNAMIC or COMPRESSED in order to allow
114
    // for the innodb_large_prefix setting to take effect, see
115
    // https://dev.mysql.com/doc/refman/5.6/en/create-table.html
116
    if ($this->connection->utf8mb4IsActive()) {
117
      $sql .= ' ROW_FORMAT=DYNAMIC';
118
    }
119

  
112 120
    // Add table comment.
113 121
    if (!empty($table['description'])) {
114 122
      $sql .= ' COMMENT ' . $this->prepareComment($table['description'], self::COMMENT_MAX_TABLE);

Also available in: Unified diff