Heine

  • home
  • drupal
  • drupal core commits
  • about
Home › Drupal Core Commits

Commit 233040 by dries

- Patch #509122 by Berdir: rest in peace db_affected_rows().

--- includes/database/database.inc      2009/07/03 04:36:50     1.58
+++ includes/database/database.inc      2009/07/03 10:57:46     1.59
@@ -184,16 +184,6 @@
 abstract class DatabaseConnection extends PDO {
 
   /**
-   * Reference to the last statement that was executed.
-   *
-   * We only need this for the legacy db_affected_rows() call, which will be removed.
-   *
-   * @var DatabaseStatementInterface
-   * @todo Remove this variable.
-   */
-  public $lastStatement;
-
-  /**
    * The database target this connection is for.
    *
    * We need this information for later auditing and logging.
@@ -1681,7 +1671,6 @@
         $this->setFetchMode($options['fetch']);
       }
     }
-    $this->dbh->lastStatement = $this;
 
     $logger = $this->dbh->getLogger();
     if (!empty($logger)) {
@@ -2539,21 +2528,6 @@
 }
 
 /**
- * Determine the number of rows changed by the preceding query.
- *
- * This may not work, actually, without some tricky temp code.
- *
- * @todo Remove this function when all queries have been ported to db_update().
- */
-function db_affected_rows() {
-  $statement = Database::getConnection()->lastStatement;
-  if (!$statement) {
-    return 0;
-  }
-  return $statement->rowCount();
-}
-
-/**
  * Helper function for db_rewrite_sql.
  *
  * Collects JOIN and WHERE statements via hook_db_rewrite_sql()

--- includes/database/prefetch.inc      2009/04/20 20:02:30     1.5
+++ includes/database/prefetch.inc      2009/07/03 10:57:46     1.6
@@ -1,5 +1,5 @@
 <?php
-// $Id$
+// $Id: prefetch.inc,v 1.5 2009/04/20 20:02:30 dries Exp $
 
 /**
  * @file
@@ -154,7 +154,6 @@
         $this->setFetchMode($options['fetch']);
       }
     }
-    $this->dbh->lastStatement = $this;
 
     $logger = $this->dbh->getLogger();
     if (!empty($logger)) {

--- modules/node/node.module    2009/07/02 04:27:23     1.1077
+++ modules/node/node.module    2009/07/03 10:57:46     1.1078
@@ -522,11 +522,10 @@
  *   The number of nodes whose node type field was modified.
  */
 function node_type_update_nodes($old_type, $type) {
-  db_update('node')
+  return db_update('node')
     ->fields(array('type' => $type))
     ->condition('type', $old_type)
     ->execute();
-  return db_affected_rows();
 }
 
 /**

No votes yet
  • Drupal Core
  • Download patch

Recent posts

  • The Joomlafication of the Dutch-speaking community
  • Upgraded from 6.14 to 6.15, but Drupal still thinks it's 6.14?
  • Google Friendconnect Drupal module not recommended (yet)
  • The OpenID 2.0 Compliance Crusade - Part I
  • Using <embed> for XSS
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF DOH! Drupal embed Input Format modx OpenID Performance Planet Drupal Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.