svn: /pear/packages/MDB2/trunk/ MDB2/Driver/mssql.php package_mssql.php
| From: | Lorenzo Alberton | Date: | Sat, 26 Dec 2009 14:01:33 +0000 |
| Subject: | svn: /pear/packages/MDB2/trunk/ MDB2/Driver/mssql.php package_mssql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-58363@lists.php.net to get a copy of this message | ||
quipo Sat, 26 Dec 2009 14:01:33 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292643
Log:
- request #16903: Add ability to use ODBTP extension [hedroom]
- fixed numRows() with setLimit()
Bug: http://pear.php.net/bugs/16903 (unknown)
Changed paths:
U pear/packages/MDB2/trunk/MDB2/Driver/mssql.php
U pear/packages/MDB2/trunk/package_mssql.php
Modified: pear/packages/MDB2/trunk/MDB2/Driver/mssql.php
===================================================================
--- pear/packages/MDB2/trunk/MDB2/Driver/mssql.php 2009-12-26 13:58:01 UTC (rev 292642)
+++ pear/packages/MDB2/trunk/MDB2/Driver/mssql.php 2009-12-26 14:01:33 UTC (rev 292643)
@@ -220,7 +220,7 @@
$text = parent::escape($text, $escape_wildcards);
// http://pear.php.net/bugs/bug.php?id=16118
// http://support.microsoft.com/kb/164291
- return preg_replace('/\\(\r\n|\r|\n)/', '\\\\$1', $text);
+ return preg_replace("/\\\\(\r\n|\r|\n)/", '\\\\$1', $text);
}
// }}}
@@ -341,7 +341,11 @@
*/
function _doConnect($username, $password, $persistent = false)
{
- if (!PEAR::loadExtension($this->phptype) &&
!PEAR::loadExtension('sybase_ct')) {
+ if ( !PEAR::loadExtension($this->phptype)
+ && !PEAR::loadExtension('sybase_ct')
+ && !PEAR::loadExtension('odbtp')
+ && !function_exists('mssql_connect')
+ ) {
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'extension '.$this->phptype.' is not compiled into PHP',
__FUNCTION__);
}
@@ -884,8 +888,9 @@
/**
* Fetch a row and insert the data into an existing array.
*
- * @param int $fetchmode how the array data should be indexed
- * @param int $rownum number of the row where the data can be found
+ * @param int $fetchmode how the array data should be indexed
+ * @param int $rownum number of the row where the data can be found
+ *
* @return int data array on success, a MDB2 error on failure
* @access public
*/
@@ -1070,7 +1075,8 @@
/**
* Seek to a specific row in a result set
*
- * @param int $rownum number of the row where the data can be found
+ * @param int $rownum number of the row where the data can be found
+ *
* @return mixed MDB2_OK on success, a MDB2 error on failure
* @access public
*/
@@ -1080,7 +1086,8 @@
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
- } elseif (is_null($this->result)) {
+ }
+ if (is_null($this->result)) {
return MDB2_OK;
}
return $this->db->raiseError(MDB2_ERROR_INVALID, null, null,
@@ -1132,8 +1139,8 @@
}
if ($this->limit) {
$rows -= $this->offset;
- if ($rows > $this->limit) {
- $rows = $this->limit;
+ if ($rows > $this->limit + 1) {
+ $rows = $this->limit + 1;
}
if ($rows < 0) {
$rows = 0;
Modified: pear/packages/MDB2/trunk/package_mssql.php
===================================================================
--- pear/packages/MDB2/trunk/package_mssql.php 2009-12-26 13:58:01 UTC (rev 292642)
+++ pear/packages/MDB2/trunk/package_mssql.php 2009-12-26 14:01:33 UTC (rev 292643)
@@ -7,6 +7,8 @@
$state = 'beta';
$notes = <<<EOT
- fixed bug #16118: escape doesn't take into account trailing backslashes [urkle]
+- request #16903: Add ability to use ODBTP extension [hedroom]
+- fixed numRows() with setLimit()
open todo items:
- explore fast limit/offset emulation (Request #4544)