1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-21 05:11:49 +02:00

rewritten dibi::IDENTIFIER escaping; added support for [table.*]

This commit is contained in:
David Grudl
2010-05-19 14:53:19 +02:00
parent 27930611de
commit bec559448c
11 changed files with 20 additions and 37 deletions

View File

@@ -260,13 +260,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver
case dibi::IDENTIFIER:
// @see http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
$a = strrpos($value, '.');
if ($a === FALSE) {
return '"' . str_replace('"', '""', $value) . '"';
} else {
// table.col delimite as table."col"
return substr($value, 0, $a) . '."' . str_replace('"', '""', substr($value, $a + 1)) . '"';
}
return '"' . str_replace('"', '""', $value) . '"';
case dibi::BOOL:
return $value ? 'TRUE' : 'FALSE';