You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ro...@apache.org on 2018/06/01 16:07:05 UTC

[incubator-trafficcontrol] 05/05: adjust cast syntax in named query to avoid escaping ::

This is an automated email from the ASF dual-hosted git repository.

rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 8a5307f0e20583ad6ff90640add39f3c0fb20722
Author: Dylan Volz <Dy...@comcast.com>
AuthorDate: Thu May 31 21:54:37 2018 -0600

    adjust cast syntax in named query to avoid escaping ::
---
 traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go                | 4 ++--
 traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go b/traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go
index 8fed9e9..a13fc94 100644
--- a/traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go
+++ b/traffic_ops/traffic_ops_golang/dbhelpers/db_helpers.go
@@ -147,9 +147,9 @@ func FinishTxX(tx *sqlx.Tx, commit *bool) {
 
 func AddTenancyCheck(where string, queryValues map[string]interface{},tenantColumnName string, tenantIDs []int) (string, map[string]interface{}) {
 	if where == "" {
-		where = BaseWhere + " " + tenantColumnName + " = ANY((:accessibleTenants)::::bigint[])"
+		where = BaseWhere + " " + tenantColumnName + " = ANY(CAST(:accessibleTenants AS bigint[]))"
 	} else {
-		where += " AND "+ tenantColumnName + " = ANY((:accessibleTenants)::::bigint[])"
+		where += " AND "+ tenantColumnName + " = ANY(CAST(:accessibleTenants AS bigint[]))"
 	}
 
 	queryValues["accessibleTenants"] = pq.Array(tenantIDs)
diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
index 3d74e69..bf2b1de 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservicesv13.go
@@ -976,7 +976,7 @@ ds.ccr_dns_ttl,
 ds.cdn_id,
 cdn.name as cdnName,
 ds.check_path,
-ds.deep_caching_type::::text as deep_caching_type,
+CAST(ds.deep_caching_type AS text) as deep_caching_type,
 ds.display_name,
 ds.dns_bypass_cname,
 ds.dns_bypass_ip,

-- 
To stop receiving notification emails like this one, please contact
rob@apache.org.