[php-doctrine-dbal] backport another OwnCloud-related pgsql fix from upstream master

Adam Williamson adamwill at fedoraproject.org
Tue Jul 29 08:30:08 UTC 2014


commit b630bd23c768c0dbc504f58b495f11043b1d42e5
Author: Adam Williamson <awilliam at redhat.com>
Date:   Tue Jul 29 01:29:47 2014 -0700

    backport another OwnCloud-related pgsql fix from upstream master

 f8c1d77efa988974026189bf8214ef0fecaf1522.patch |   27 ++++++++++++++++++++++++
 php-doctrine-dbal.spec                         |   10 ++++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/f8c1d77efa988974026189bf8214ef0fecaf1522.patch b/f8c1d77efa988974026189bf8214ef0fecaf1522.patch
new file mode 100644
index 0000000..c6dfc27
--- /dev/null
+++ b/f8c1d77efa988974026189bf8214ef0fecaf1522.patch
@@ -0,0 +1,27 @@
+From f8c1d77efa988974026189bf8214ef0fecaf1522 Mon Sep 17 00:00:00 2001
+From: Vincent Petry <PVince81 at yahoo.fr>
+Date: Tue, 1 Jul 2014 13:14:38 +0200
+Subject: [PATCH] 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.
+---
+ 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 916e857..c3015b5 100644
+--- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
++++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+@@ -467,7 +467,7 @@
+             }
+ 
+             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;
+             }
+         }
+-- 
+2.0.3
+
diff --git a/php-doctrine-dbal.spec b/php-doctrine-dbal.spec
index 553f47b..aa5f09d 100644
--- a/php-doctrine-dbal.spec
+++ b/php-doctrine-dbal.spec
@@ -29,7 +29,7 @@
 
 Name:      php-%{composer_vendor}-%{composer_project}
 Version:   %{github_version}
-Release:   4%{?github_release}%{?dist}
+Release:   5%{?github_release}%{?dist}
 Summary:   Doctrine Database Abstraction Layer (DBAL)
 
 Group:     Development/Libraries
@@ -41,6 +41,10 @@ Source0:   https://github.com/%{github_owner}/%{github_name}/archive/%{github_co
 # but immediately reverted in
 # https://github.com/doctrine/dbal/commit/894493b285c71a33e6ed29994ba415bad5e0a457
 Patch0:    %{name}-2.4.2-primary_index.patch
+# From upstream master (2.5), not yet backported to 2.4 upstream. Required for
+# OwnCloud (pgsql-backed OC 6.x upgrades to 7.x fail without it.) Rediffed
+# https://github.com/doctrine/dbal/commit/f8c1d77efa988974026189bf8214ef0fecaf1522
+Patch1:    f8c1d77efa988974026189bf8214ef0fecaf1522.patch
 
 BuildArch: noarch
 
@@ -79,6 +83,7 @@ extension under the hood.
 %prep
 %setup -qn %{github_name}-%{github_commit}
 %patch0 -p3 -b .primary_index
+#patch1 -p1 -b .escape_column
 
 # Make a single executable
 echo '#!%{_bindir}/php' > bin/doctrine-dbal
@@ -117,6 +122,9 @@ install -pm 0755 bin/doctrine-dbal %{buildroot}/%{_bindir}/
 
 
 %changelog
+* Tue Jul 29 2014 Adam Williamson <awilliam at redhat.com> - 2.4.2-5
+- backport another OwnCloud-related pgsql fix from upstream master
+
 * Fri Jun 20 2014 Shawn Iwinski <shawn.iwinski at gmail.com> - 2.4.2-4
 - Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide
 - Updated Doctrine dependencies to use php-composer virtual provides


More information about the scm-commits mailing list