From bd020f7701bf8c40dd56644ad2b488a356006097 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Tue, 10 May 2016 09:31:45 +0200
Subject: [PATCH] ZSQLCatalog.Query.EntireQuery: Strip parentheses from
 pre-mapped column.

---
 product/ZSQLCatalog/Query/EntireQuery.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/product/ZSQLCatalog/Query/EntireQuery.py b/product/ZSQLCatalog/Query/EntireQuery.py
index 4baf088f8a..7b6e8e80ec 100644
--- a/product/ZSQLCatalog/Query/EntireQuery.py
+++ b/product/ZSQLCatalog/Query/EntireQuery.py
@@ -131,7 +131,8 @@ class EntireQuery(object):
           column = alias
           if '.' in alias:
             # If given column is pre-mapped, strip table name from its alias.
-            _, alias = alias.replace('`', '').split('.')
+            _, alias = alias.split('.')
+            alias = alias.strip('`()')
         else:
           column = raw_column
         try:
-- 
2.30.9