Projet

Général

Profil

Révision 5587145e

Ajouté par Assos Assos il y a presque 7 ans

Update to 7.56

Voir les différences:

drupal7/includes/database/sqlite/query.inc
99 99

  
100 100
/**
101 101
 * SQLite specific implementation of DeleteQuery.
102
 *
103
 * When the WHERE is omitted from a DELETE statement and the table being deleted
104
 * has no triggers, SQLite uses an optimization to erase the entire table content
105
 * without having to visit each row of the table individually.
106
 *
107
 * Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted
108
 * by that optimized "truncate" optimization.
109 102
 */
110 103
class DeleteQuery_sqlite extends DeleteQuery {
111 104
  public function execute() {
105
    // When the WHERE is omitted from a DELETE statement and the table being
106
    // deleted has no triggers, SQLite uses an optimization to erase the entire
107
    // table content without having to visit each row of the table individually.
108
    // Prior to SQLite 3.6.5, SQLite does not return the actual number of rows
109
    // deleted by that optimized "truncate" optimization. But we want to return
110
    // the number of rows affected, so we calculate it directly.
112 111
    if (!count($this->condition)) {
113 112
      $total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
114 113
      parent::execute();

Formats disponibles : Unified diff