cvs: pear /Structures_DataGrid package2-ds-dbquery.xml package2-ds-mdb2.xml /Structures_DataGrid/DataGrid/DataSource DBQuery.php MDB2.php
| From: | Mark Wiesemann | Date: | Wed, 24 Jan 2007 19:49:11 +0000 |
| Subject: | cvs: pear /Structures_DataGrid package2-ds-dbquery.xml package2-ds-mdb2.xml /Structures_DataGrid/DataGrid/DataSource DBQuery.php MDB2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44371@lists.php.net to get a copy of this message | ||
wiesemann Wed Jan 24 19:49:11 2007 UTC
Modified files:
/pear/Structures_DataGrid package2-ds-dbquery.xml
package2-ds-mdb2.xml
/pear/Structures_DataGrid/DataGrid/DataSource DBQuery.php MDB2.php
Log:
- Bug #9913: the row count was calculated wrongly for subqueries
(thanks to Harry School, HarrySchool at netscape dot net)
- update changelogs and prepare for release
http://cvs.php.net/viewvc.cgi/pear/Structures_DataGrid/package2-ds-dbquery.xml?r1=1.15&r2=1.16&diff_format=u
Index: pear/Structures_DataGrid/package2-ds-dbquery.xml
diff -u pear/Structures_DataGrid/package2-ds-dbquery.xml:1.15
pear/Structures_DataGrid/package2-ds-dbquery.xml:1.16
--- pear/Structures_DataGrid/package2-ds-dbquery.xml:1.15 Tue Jan 23 15:20:26 2007
+++ pear/Structures_DataGrid/package2-ds-dbquery.xml Wed Jan 24 19:49:11 2007
@@ -27,10 +27,10 @@
<email>wiesemann@php.net</email>
<active>yes</active>
</lead>
- <date>2007-01-23</date>
- <time>16:00:00</time>
+ <date>2007-01-24</date>
+ <time>20:50:00</time>
<version>
- <release>0.1.5</release>
+ <release>0.1.6</release>
<api>0.1.1</api>
</version>
<stability>
@@ -39,8 +39,8 @@
</stability>
<license uri="http://opensource.org/licenses/bsd-license.php">New
BSD</license>
<notes>
-- Bug #9871: regex fix for correctly removing the LIMIT statement
- (thanks Michael Mauch, michael dot mauch at gmx dot de)
+- Bug #9913: the row count was calculated wrongly for subqueries
+ (thanks to Harry School, HarrySchool at netscape dot net)
</notes>
<contents>
<dir name="/">
http://cvs.php.net/viewvc.cgi/pear/Structures_DataGrid/package2-ds-mdb2.xml?r1=1.12&r2=1.13&diff_format=u
Index: pear/Structures_DataGrid/package2-ds-mdb2.xml
diff -u pear/Structures_DataGrid/package2-ds-mdb2.xml:1.12
pear/Structures_DataGrid/package2-ds-mdb2.xml:1.13
--- pear/Structures_DataGrid/package2-ds-mdb2.xml:1.12 Fri Jan 19 10:30:07 2007
+++ pear/Structures_DataGrid/package2-ds-mdb2.xml Wed Jan 24 19:49:11 2007
@@ -27,10 +27,10 @@
<email>wiesemann@php.net</email>
<active>yes</active>
</lead>
- <date>2007-01-19</date>
- <time>11:30:00</time>
+ <date>2007-01-14</date>
+ <time>20:50:00</time>
<version>
- <release>0.1.5</release>
+ <release>0.1.6</release>
<api>0.1.1</api>
</version>
<stability>
@@ -39,8 +39,8 @@
</stability>
<license uri="http://opensource.org/licenses/bsd-license.php">New
BSD</license>
<notes>
-- Bug #9871: regex fix for correctly removing the LIMIT statement
- (thanks Michael Mauch, michael dot mauch at gmx dot de)
+- Bug #9913: the row count was calculated wrongly for subqueries
+ (thanks to Harry School, HarrySchool at netscape dot net)
</notes>
<contents>
<dir name="/">
http://cvs.php.net/viewvc.cgi/pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php?r1=1.24&r2=1.25&diff_format=u
Index: pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php
diff -u pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php:1.24
pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php:1.25
--- pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php:1.24 Tue Jan 23 15:19:36 2007
+++ pear/Structures_DataGrid/DataGrid/DataSource/DBQuery.php Wed Jan 24 19:49:11 2007
@@ -35,9 +35,9 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * CSV file id: $Id: DBQuery.php,v 1.24 2007/01/23 15:19:36 olivierg Exp $
+ * CSV file id: $Id: DBQuery.php,v 1.25 2007/01/24 19:49:11 wiesemann Exp $
*
- * @version $Revision: 1.24 $
+ * @version $Revision: 1.25 $
* @category Structures
* @package Structures_DataGrid_DataSource_DBQuery
* @license http://opensource.org/licenses/bsd-license.php
New BSD License
@@ -78,7 +78,7 @@
* If you want to give a default sorting statement that is only used if there is
* no sorting query in the HTTP request, then use $datagrid->setDefaultSort().
*
- * @version $Revision: 1.24 $
+ * @version $Revision: 1.25 $
* @author Andrew S. Nagy <asnagy@php.net>
* @author Mark Wiesemann <wiesemann@php.net>
* @author Olivier Guilyardi <olivier@samalyse.com>
@@ -281,7 +281,8 @@
// don't query the whole table, just get the number of rows
$query = preg_replace('#SELECT\s.*\sFROM#is',
'SELECT COUNT(*) FROM',
- $this->_query);
+ $this->_query,
+ 1);
$count = $this->_db->getOne($query);
// $count has an integer value with number of rows or is a
// PEAR_Error instance on failure
http://cvs.php.net/viewvc.cgi/pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php?r1=1.26&r2=1.27&diff_format=u
Index: pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php
diff -u pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php:1.26
pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php:1.27
--- pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php:1.26 Fri Jan 19 10:30:07 2007
+++ pear/Structures_DataGrid/DataGrid/DataSource/MDB2.php Wed Jan 24 19:49:11 2007
@@ -35,9 +35,9 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * CSV file id: $Id: MDB2.php,v 1.26 2007/01/19 10:30:07 olivierg Exp $
+ * CSV file id: $Id: MDB2.php,v 1.27 2007/01/24 19:49:11 wiesemann Exp $
*
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
* @category Structures
* @package Structures_DataGrid_DataSource_MDB2
* @license http://opensource.org/licenses/bsd-license.php
New BSD License
@@ -78,7 +78,7 @@
* If you want to give a default sorting statement that is only used if there is
* no sorting query in the HTTP request, then use $datagrid->setDefaultSort().
*
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
* @author Andrew S. Nagy <asnagy@php.net>
* @author Mark Wiesemann <wiesemann@php.net>
* @author Olivier Guilyardi <olivier@samalyse.com>
@@ -284,7 +284,8 @@
// don't query the whole table, just get the number of rows
$query = preg_replace('#SELECT\s.*\sFROM#is',
'SELECT COUNT(*) FROM',
- $this->_query);
+ $this->_query,
+ 1);
$count = $this->_db->extended->getOne($query);
// $count has an integer value with number of rows or is a
// PEAR_Error instance on failure