From owner-svn-ports-all@freebsd.org Wed Oct 9 14:27:31 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5FB314D679; Wed, 9 Oct 2019 14:27:31 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46pGl73ymcz4VPk; Wed, 9 Oct 2019 14:27:31 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CA4B19C90; Wed, 9 Oct 2019 14:27:31 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x99ERVx4095971; Wed, 9 Oct 2019 14:27:31 GMT (envelope-from madpilot@FreeBSD.org) Received: (from madpilot@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x99ERVfg095970; Wed, 9 Oct 2019 14:27:31 GMT (envelope-from madpilot@FreeBSD.org) Message-Id: <201910091427.x99ERVfg095970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: madpilot set sender to madpilot@FreeBSD.org using -f From: Guido Falsi Date: Wed, 9 Oct 2019 14:27:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r514158 - in head/net/asterisk13: . files X-SVN-Group: ports-head X-SVN-Commit-Author: madpilot X-SVN-Commit-Paths: in head/net/asterisk13: . files X-SVN-Commit-Revision: 514158 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Oct 2019 14:27:31 -0000 Author: madpilot Date: Wed Oct 9 14:27:30 2019 New Revision: 514158 URL: https://svnweb.freebsd.org/changeset/ports/514158 Log: Fix CDR with PostgreSQL 12 PR: 241116 Submitted by: cmt MFH: 2019Q4 Added: head/net/asterisk13/files/patch-cdr_cdr__pgsql.c (contents, props changed) Modified: head/net/asterisk13/Makefile Modified: head/net/asterisk13/Makefile ============================================================================== --- head/net/asterisk13/Makefile Wed Oct 9 14:14:17 2019 (r514157) +++ head/net/asterisk13/Makefile Wed Oct 9 14:27:30 2019 (r514158) @@ -2,6 +2,7 @@ PORTNAME= asterisk PORTVERSION= 13.28.1 +PORTRREVISION= 1 CATEGORIES= net MASTER_SITES= https://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729 MASTER_SITE_SUBDIR= asterisk/ \ Added: head/net/asterisk13/files/patch-cdr_cdr__pgsql.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/asterisk13/files/patch-cdr_cdr__pgsql.c Wed Oct 9 14:27:30 2019 (r514158) @@ -0,0 +1,11 @@ +--- cdr/cdr_pgsql.c.orig 2019-10-06 21:08:37 UTC ++++ cdr/cdr_pgsql.c +@@ -707,7 +707,7 @@ static int config_module(int reload) + schemaname = ast_alloca(strlen(tmp_schemaname) * 2 + 1); + PQescapeStringConn(conn, schemaname, tmp_schemaname, strlen(tmp_schemaname), NULL); + +- snprintf(sqlcmd, sizeof(sqlcmd), "SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum", ++ snprintf(sqlcmd, sizeof(sqlcmd), "SELECT a.attname, t.typname, a.attlen, a.attnotnull, pg_catalog.pg_get_expr(d.adbin, d.adrelid) adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum", + tablename, + ast_strlen_zero(schemaname) ? "" : "'", ast_strlen_zero(schemaname) ? "current_schema()" : schemaname, ast_strlen_zero(schemaname) ? "" : "'"); + } else {