File: 0001-Fix-escaping-of-column-name-for-specific-alter-table.patch

package info (click to toggle)
php-doctrine-dbal 2.4.3-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 1,520 kB
  • sloc: php: 16,373; makefile: 19
file content (26 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Vincent Petry <PVince81@yahoo.fr>
Date: Tue, 1 Jul 2014 13:14:38 +0200
Subject: Fix escaping of column name for specific alter table case

When changing the length of a field, the column name needs to be escaped
properly.

Origin: https://github.com/doctrine/dbal/pull/627
Bug-Debian: https://bugs.debian.org/754091
---
 lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
index 89f57dc..8f25826 100644
--- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
@@ -489,7 +489,7 @@ class PostgreSqlPlatform extends AbstractPlatform
             }
 
             if ($columnDiff->hasChanged('length')) {
-                $query = 'ALTER ' . $column->getName() . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
+                $query = 'ALTER ' . $oldColumnName . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
                 $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query;
             }
         }