1
0
mirror of https://github.com/dg/dibi.git synced 2025-09-04 11:45:27 +02:00

Compare commits

...

3 Commits
v2.0.4 ... v2.0

Author SHA1 Message Date
David Grudl
697ffcd44a released 2.0.5
This release marks the end of life of  2.0 series.
2015-01-13 05:52:56 +01:00
Pavel Zelezny
4535bc5458 Oracle use double quotes for escaping 2015-01-13 05:51:44 +01:00
Rossler Jan
bf36cf96ee PostgreSQL: fixed identifier escaping in reflection. 2015-01-13 05:51:43 +01:00
4 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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