Przeglądaj źródła

fixed postgres identifier quote

Piotr Labudda 8 lat temu
rodzic
commit
8e612f1333
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      SE/se-lib/AclQueryBuilder.php

+ 2 - 2
SE/se-lib/AclQueryBuilder.php

@@ -163,7 +163,7 @@ class AclQueryBuilder {
 		if ($this->from instanceof Core_AclBase) $sqlPk = $this->from->getSqlPrimaryKeyField();
 		if ('*' === $select) return "{$this->_fromPrefix}.*";
 		if ('@primaryKey' === $select) {
-			return "{$this->_fromPrefix}.{$sqlPk} as `@primaryKey`";
+			return "{$this->_fromPrefix}.{$sqlPk} as " . $this->getPDO()->identifierQuote("@primaryKey");
 		}
 		if ('@instances' === $select) {
 			if (!($this->from instanceof Core_AclBase)) throw new Exception("select @instances allowed only for Acl object");
@@ -172,7 +172,7 @@ class AclQueryBuilder {
 			// > foreach ($listInstanceConfig as $instanceConfig) {
 			//  IF( ( select 1 from `{$instanceTable}` where ID = {$this->_fromPrefix}.{$sqlPk} ) > 0, '{$instanceName},', ''),
 			// )
-			return " '' as `@instances` ";
+			return " '' as " . $this->getPDO()->identifierQuote("@instances");
 		}
 		if (is_array($select)) {
 			// TODO: [ '__backRef' => [ ... ] ]