summaryrefslogtreecommitdiff
path: root/modules/php/php.install
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/php/php.install
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/php/php.install')
-rw-r--r--modules/php/php.install2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/php/php.install b/modules/php/php.install
index 16f67db82..6eaa0ba96 100644
--- a/modules/php/php.install
+++ b/modules/php/php.install
@@ -10,7 +10,7 @@
* Implementation of hook_install().
*/
function php_install() {
- $format_exists = db_query("SELECT COUNT(*) FROM {filter_format} WHERE name = 'PHP code'")->fetchField();
+ $format_exists = (bool) db_query_range('SELECT 1 FROM {filter_format} WHERE name = :name', array(':name' => 'PHP code'), 0, 1)->fetchField();
// Add a PHP code text format, if it does not exist. Do this only for the
// first install (or if the format has been manually deleted) as there is no
// reliable method to identify the format in an uninstall hook or in