summaryrefslogtreecommitdiff
path: root/modules/path
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-16 15:23:16 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-05-16 15:23:16 +0000
commitf577c125e84bc3a1f30bcc40105788d0547a534a (patch)
tree87654a9fbf162a10ffcb21c4c32289743687b8cd /modules/path
parent8b63d832de0c708836393bdf83fffe8bf10c2a3f (diff)
downloadbrdo-f577c125e84bc3a1f30bcc40105788d0547a534a.tar.gz
brdo-f577c125e84bc3a1f30bcc40105788d0547a534a.tar.bz2
#196862 by Damien Tournoud, et al: Replace COUNT(*) queries with SELECT 1 ... LIMIT 1 queries when all that's required is a check for whether rows exist.
Diffstat (limited to 'modules/path')
-rw-r--r--modules/path/path.admin.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index b980998c6..9fc9ef52b 100644
--- a/modules/path/path.admin.inc
+++ b/modules/path/path.admin.inc
@@ -15,8 +15,8 @@ function path_admin_overview($keys = NULL) {
// Add the filter form above the overview table.
$output = drupal_get_form('path_admin_filter_form', $keys);
// Enable language column if locale is enabled or if we have any alias with language
- $count = db_query("SELECT COUNT(*) FROM {url_alias} WHERE language <> ''")->fetchField();
- $multilanguage = (module_exists('locale') || $count);
+ $alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE language <> :language', array(':language' => ''), 0, 1)->fetchField();
+ $multilanguage = (module_exists('locale') || $alias_exists);
$header = array(
array('data' => t('Alias'), 'field' => 'dst', 'sort' => 'asc'),