Projet

Général

Profil

Révision 01dfd3b5

Ajouté par Assos Assos il y a plus de 3 ans

Udpate to 7.77

Voir les différences:

drupal7/includes/database/sqlite/schema.inc
668 668
    $this->alterTable($table, $old_schema, $new_schema);
669 669
  }
670 670

  
671
  /**
672
   * {@inheritdoc}
673
   */
671 674
  public function findTables($table_expression) {
672 675
    // Don't add the prefix, $table_expression already includes the prefix.
673 676
    $info = $this->getPrefixInfo($table_expression, FALSE);
......
680 683
    ));
681 684
    return $result->fetchAllKeyed(0, 0);
682 685
  }
686

  
687
  /**
688
   * {@inheritdoc}
689
   */
690
  public function findTablesD8($table_expression) {
691
    $tables = array();
692

  
693
    // The SQLite implementation doesn't need to use the same filtering strategy
694
    // as the parent one because individually prefixed tables live in their own
695
    // schema (database), which means that neither the main database nor any
696
    // attached one will contain a prefixed table name, so we just need to loop
697
    // over all known schemas and filter by the user-supplied table expression.
698
    $attached_dbs = $this->connection->getAttachedDatabases();
699
    foreach ($attached_dbs as $schema) {
700
      // Can't use query placeholders for the schema because the query would
701
      // have to be :prefixsqlite_master, which does not work. We also need to
702
      // ignore the internal SQLite tables.
703
      $result = db_query("SELECT name FROM " . $schema . ".sqlite_master WHERE type = :type AND name LIKE :table_name AND name NOT LIKE :pattern", array(
704
        ':type' => 'table',
705
        ':table_name' => $table_expression,
706
        ':pattern' => 'sqlite_%',
707
      ));
708
      $tables += $result->fetchAllKeyed(0, 0);
709
    }
710

  
711
    return $tables;
712
  }
713

  
683 714
}

Formats disponibles : Unified diff