cvs: pear /MDB2/MDB2/Driver ibase.php
| From: | Lukas Smith | Date: | Fri, 17 Mar 2006 16:48:17 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver ibase.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39157@lists.php.net to get a copy of this message | ||
lsmith Fri Mar 17 16:48:17 2006 UTC
Modified files:
/pear/MDB2/MDB2/Driver ibase.php
Log:
- some clean ups with determining if limit_queries needs to be emulated or not
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.143&r2=1.144&diff_format=u
Index: pear/MDB2/MDB2/Driver/ibase.php
diff -u pear/MDB2/MDB2/Driver/ibase.php:1.143 pear/MDB2/MDB2/Driver/ibase.php:1.144
--- pear/MDB2/MDB2/Driver/ibase.php:1.143 Fri Mar 17 16:11:31 2006
+++ pear/MDB2/MDB2/Driver/ibase.php Fri Mar 17 16:48:17 2006
@@ -43,7 +43,7 @@
// | Author: Lorenzo Alberton <l.alberton@quipo.it> |
// +----------------------------------------------------------------------+
//
-// $Id: ibase.php,v 1.143 2006/03/17 16:11:31 lsmith Exp $
+// $Id: ibase.php,v 1.144 2006/03/17 16:48:17 lsmith Exp $
/**
* MDB2 FireBird/InterBase driver
@@ -82,7 +82,6 @@
$this->supported['order_by_text'] = true;
$this->supported['transactions'] = true;
$this->supported['current_id'] = true;
- // maybe this needs different handling for ibase and firebird?
$this->supported['limit_queries'] = 'emulated';
$this->supported['LOBs'] = true;
$this->supported['replace'] = false;
@@ -437,6 +436,7 @@
$this->connected_database_name = $database_file;
$this->opened_persistent = $this->options['persistent'];
$this->dbsyntax = $this->dsn['dbsyntax'] ?
$this->dsn['dbsyntax'] : $this->phptype;
+ $this->supported['limit_queries'] = ($this->dbsyntax ==
'firebird') ? true : 'emulated';
}
return MDB2_OK;
}
@@ -541,7 +541,7 @@
*/
function _modifyQuery($query, $is_manip, $limit, $offset)
{
- if ($limit > 0 && $this->dsn['dbsyntax'] == 'firebird') {
+ if ($limit > 0 && $this->supports('limit_queries') === true) {
$query = preg_replace('/^([\s(])*SELECT(?!\s*FIRST\s*\d+)/i',
"SELECT FIRST $limit SKIP $offset", $query);
}
@@ -799,7 +799,7 @@
*/
function _skipLimitOffset()
{
- if ($this->db->dsn['dbsyntax'] == 'firebird') {
+ if ($this->supports('limit_queries') === true) {
return true;
}
if ($this->limit) {