Date: Wed, 9 Oct 2019 14:27:51 +0000 (UTC) From: Guido Falsi <madpilot@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r514159 - in head/net/asterisk16: . files Message-ID: <201910091427.x99ERprq096138@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: madpilot Date: Wed Oct 9 14:27:51 2019 New Revision: 514159 URL: https://svnweb.freebsd.org/changeset/ports/514159 Log: Fix CDR with PostgreSQL 12 PR: 241116 Submitted by: cmt MFH: 2019Q4 Added: head/net/asterisk16/files/patch-cdr_cdr__pgsql.c (contents, props changed) Modified: head/net/asterisk16/Makefile Modified: head/net/asterisk16/Makefile ============================================================================== --- head/net/asterisk16/Makefile Wed Oct 9 14:27:30 2019 (r514158) +++ head/net/asterisk16/Makefile Wed Oct 9 14:27:51 2019 (r514159) @@ -2,6 +2,7 @@ PORTNAME= asterisk PORTVERSION= 16.5.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729 MASTER_SITE_SUBDIR= asterisk/ \ Added: head/net/asterisk16/files/patch-cdr_cdr__pgsql.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/asterisk16/files/patch-cdr_cdr__pgsql.c Wed Oct 9 14:27:51 2019 (r514159) @@ -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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910091427.x99ERprq096138>