summaryrefslogtreecommitdiff
path: root/adodb-lib.inc.php
diff options
context:
space:
mode:
authormike.benoit <mikeb@timetrex.com>2016-05-05 08:18:47 -0700
committerDamien Regad <dregad@mantisbt.org>2016-05-25 20:11:24 +0200
commita2ac4be2bf0a2a79661db3f26b9c4e492db984b2 (patch)
tree63ec7b143b62730fc2f65b0ca4fa663c2ae8e5de /adodb-lib.inc.php
parente3619e01a7c2a22ea2ae8b6b7d5382d6e06fe1d1 (diff)
downloadadodb-a2ac4be2bf0a2a79661db3f26b9c4e492db984b2.tar.gz
adodb-a2ac4be2bf0a2a79661db3f26b9c4e492db984b2.tar.bz2
adodb-a2ac4be2bf0a2a79661db3f26b9c4e492db984b2.zip
Fix _adodb_getcount()
This reverts the regular expression back to its original (i.e. before it was changed in #88, see commit 41839f5c18abe262ee088f1d4bd92453616d2a4a) as it seems to work in more cases, and doesn't break simple ones. Since we support _ADODB_COUNT now anyways we should be able to handle any possible situation. Fixes #236, #239 Signed-off-by: Damien Regad <dregad@mantisbt.org>
Diffstat (limited to 'adodb-lib.inc.php')
-rw-r--r--adodb-lib.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/adodb-lib.inc.php b/adodb-lib.inc.php
index 625077df..fb9055c4 100644
--- a/adodb-lib.inc.php
+++ b/adodb-lib.inc.php
@@ -426,7 +426,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
$rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
} else {
- $rewritesql = preg_replace('/^\s*?SELECT\s.*?\s+(.*?)\s+FROM\s/is','SELECT COUNT(*) FROM ',$sql);
+ $rewritesql = preg_replace('/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
}
// fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
// with mssql, access and postgresql. Also a good speedup optimization - skips sorting!