1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 17:29:53 +02:00

Compare commits

..

4 Commits
v2.2.4 ... v2.2

Author SHA1 Message Date
David Grudl
17df4d17fb Released version 2.2.5
This release marks the end of life of 2.2 series.
2015-10-26 19:33:34 +01:00
David Grudl
51adcd98e0 DibiFluent::fetch() uses limit only when there is no LIMIT & OFFSET (fixes 20f2093 on MSSQL) 2015-10-26 16:46:20 +01:00
David Grudl
aaa5abd4b6 DibiFluent: prevents doubled processing 2015-10-26 16:45:58 +01:00
David Grudl
e4acc4a2c8 DibiTranslator: removed die() 2015-10-26 16:45:21 +01:00
4 changed files with 12 additions and 14 deletions

View File

@@ -39,8 +39,8 @@ class dibi
FIELD_TIME = self::TIME;
/** version */
const VERSION = '2.2.4',
REVISION = 'released on 2015-10-22';
const VERSION = '2.2.5',
REVISION = 'released on 2015-10-26';
/** sorting order */
const ASC = 'ASC',

View File

@@ -188,6 +188,7 @@ class DibiFluent extends DibiObject implements IDataSource
foreach ($args as $arg) {
if ($arg instanceof self) {
$this->cursor[] = '%SQL';
$arg = "($arg)";
}
$this->cursor[] = $arg;
@@ -316,12 +317,11 @@ class DibiFluent extends DibiObject implements IDataSource
*/
public function fetch()
{
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
$result = $this->query($this->limit(1)->_export())->fetch();
$this->removeClause('LIMIT');
return $result;
if ($this->command === 'SELECT' && !$this->clauses['LIMIT'] && !$this->clauses['OFFSET']) {
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetch();
} else {
return $this->query($this->_export())->fetch();
}
return $this->query($this->_export())->fetch();
}
@@ -331,12 +331,11 @@ class DibiFluent extends DibiObject implements IDataSource
*/
public function fetchSingle()
{
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
$result = $this->query($this->limit(1)->_export())->fetchSingle();
$this->removeClause('LIMIT');
return $result;
if ($this->command === 'SELECT' && !$this->clauses['LIMIT'] && !$this->clauses['OFFSET']) {
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetchSingle();
} else {
return $this->query($this->_export())->fetchSingle();
}
return $this->query($this->_export())->fetchSingle();
}

View File

@@ -588,7 +588,7 @@ final class DibiTranslator extends DibiObject
return $matches[9] == '' ? $this->formatValue($m, FALSE) : $m . $matches[9]; // value or identifier
}
die('this should be never executed');
throw new Exception('this should be never executed');
}

View File

@@ -1 +0,0 @@
Dibi 2.2.3 (released on 2015-01-13)