php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17989 Pear->db->oci8->numrows
Submitted: 2002-06-26 04:57 UTC Modified: 2002-07-02 12:40 UTC
From: awu at elca dot ch Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.2.0 OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: awu at elca dot ch
New email:
PHP Version: OS:

 

 [2002-06-26 04:57 UTC] awu at elca dot ch
Numrows function for Oracle does not return the correct number if "DISTINCT" is used in the query. ("distinct" is dropped..)

have a look at /PEAR/DB/oci8.php line 268: numRows function:

$countquery = preg_replace('/^\s*SELECT\s+(.*?)\s+FROM\s+/is','SELECT COUNT(*) FROM ',$this->last_query);

doesn't work for queries with the keyword "DISTINCT"

I suggest you something really more simple:

$countquery = "SELECT count(*) FROM (".$this->last_query.")";

bye!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-02 12:40 UTC] mj@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 16:01:33 2024 UTC