1
0
mirror of https://github.com/dg/dibi.git synced 2025-09-10 06:10:52 +02:00

Compare commits

...

4 Commits

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; FIELD_TIME = self::TIME;
/** version */ /** version */
const VERSION = '2.2.4', const VERSION = '2.2.5',
REVISION = 'released on 2015-10-22'; REVISION = 'released on 2015-10-26';
/** sorting order */ /** sorting order */
const ASC = 'ASC', const ASC = 'ASC',

View File

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