Skip navigation
Help

DeleteQuery_sqlite

user warning: Got error 28 from storage engine query: SELECT ad.branch_id, ad.title, ad.object_name, ad.summary, ad.object_type, ad.file_name, ao.overrides_did, ad.did FROM api_members am INNER JOIN api_documentation ad ON ad.did = am.did LEFT JOIN api_overrides ao ON ao.did = am.did WHERE am.class_did = 18413 ORDER BY title in /srv/www/api.ubercart.me/drupal/sites/all/modules/api/api.pages.inc on line 741.
  1. drupal
    1. 7 drupal/includes/database/sqlite/query.inc

SQLite specific implementation of DeleteQuery.

When the WHERE is omitted from a DELETE statement and the table being deleted has no triggers, SQLite uses an optimization to erase the entire table content without having to visit each row of the table individually.

Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted by that optimized "truncate" optimization.

Hierarchy

File

drupal/includes/database/sqlite/query.inc, line 130
Query code for SQLite embedded database engine.

View source
class DeleteQuery_sqlite extends DeleteQuery {
  public function execute() {
    if (!count($this->condition)) {
      $total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
      parent::execute();
      return $total_rows;
    }
    else {
      return parent::execute();
    }
  }
}

Related topics