From 7e5d0c947a23c0931614b167b7107c97cdd82136 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Tue, 30 Aug 2005 15:04:54 +0000
Subject: [PATCH] - Patch #20255 by Cvbge: simplified a query in the
 throttle.module.  Fixes a PostgreSQL compatibility bug too.

---
 modules/throttle.module          | 2 +-
 modules/throttle/throttle.module | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/throttle.module b/modules/throttle.module
index 2c9c933688e4..069729cf8289 100644
--- a/modules/throttle.module
+++ b/modules/throttle.module
@@ -56,7 +56,7 @@ function throttle_exit() {
       $guests = 0;
     }
     if ($max_users = variable_get('throttle_user', 0)) {
-      $users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0 GROUP BY uid ORDER BY timestamp DESC', time() - $time_period));
+      $users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0', time() - $time_period));
     }
     else {
       $users = 0;
diff --git a/modules/throttle/throttle.module b/modules/throttle/throttle.module
index 2c9c933688e4..069729cf8289 100644
--- a/modules/throttle/throttle.module
+++ b/modules/throttle/throttle.module
@@ -56,7 +56,7 @@ function throttle_exit() {
       $guests = 0;
     }
     if ($max_users = variable_get('throttle_user', 0)) {
-      $users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0 GROUP BY uid ORDER BY timestamp DESC', time() - $time_period));
+      $users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0', time() - $time_period));
     }
     else {
       $users = 0;
-- 
GitLab