1
0
mirror of https://github.com/dg/dibi.git synced 2025-09-01 18:12:51 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
David Grudl
cd7362efa6 Released version 2.1.3
This release marks the end of life of 2.1 series.
2015-01-13 05:56:52 +01:00
Petr BAGR Smrkovský
fa342fd240 DibiResult: float detection locale fix [Closes #154] 2015-01-13 05:53:54 +01:00
Pavel Zelezny
2277896109 Oracle use double quotes for escaping 2015-01-13 05:53:54 +01:00
Rossler Jan
f9c9003fc1 PostgreSQL: fixed identifier escaping in reflection. 2015-01-13 05:53:53 +01:00
6 changed files with 9 additions and 9 deletions

View File

@@ -71,8 +71,8 @@ class dibi
FIELD_TIME = dibi::TIME;
/** version */
const VERSION = '2.1.2',
REVISION = '$WCREV$ released on $WCDATE$';
const VERSION = '2.1.3',
REVISION = 'released on 2015-01-13';
/** sorting order */
const ASC = 'ASC',

View File

@@ -255,6 +255,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
case 'mysql':
return '`' . str_replace('`', '``', $value) . '`';
case 'oci':
case 'pgsql':
return '"' . str_replace('"', '""', $value) . '"';
@@ -263,7 +264,6 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
return '[' . strtr($value, '[]', ' ') . ']';
case 'odbc':
case 'oci': // TODO: not tested
case 'mssql':
return '[' . str_replace(array('[', ']'), array('[[', ']]'), $value) . ']';

View File

@@ -482,7 +482,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getColumns($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT indkey
FROM pg_class
@@ -522,7 +522,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getIndexes($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT ordinal_position, column_name
FROM information_schema.columns
@@ -563,7 +563,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
*/
public function getForeignKeys($table)
{
$_table = $this->escape($table, dibi::TEXT);
$_table = $this->escape($this->escape($table, dibi::IDENTIFIER), dibi::TEXT);
$res = $this->query("
SELECT

View File

@@ -514,7 +514,7 @@ class DibiResult extends DibiObject implements IDataSource
$row[$key] = is_float($tmp = $value * 1) ? $value : $tmp;
} elseif ($type === dibi::FLOAT) {
$row[$key] = ltrim((string) ($tmp = (float) $value), '0') === ltrim(rtrim(rtrim($value, '0'), '.'), '0') ? $tmp : $value;
$row[$key] = str_replace(',', '.', ltrim((string) ($tmp = (float) $value), '0')) === ltrim(rtrim(rtrim($value, '0'), '.'), '0') ? $tmp : $value;
} elseif ($type === dibi::BOOL) {
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';

View File

@@ -2,7 +2,7 @@ body {
font: 15px/1.5 Tahoma, Verdana, Myriad Web, Syntax, sans-serif;
color: #333;
background: #fff url('dibi-powered.gif') no-repeat 99% 1em;
margin: 1.6em;
margin: 1.6em;
padding: 0;
}

View File

@@ -1 +1 @@
Dibi 2.1.2 (revision $WCREV$ released on $WCDATE$)
Dibi 2.1.3 (released on 2015-01-13)