[Asterisk-code-review] cdr pgsql: Refactor magic number by definition for version (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Sep 11 07:22:59 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6466 )

Change subject: cdr_pgsql: Refactor magic number by definition for version
......................................................................

cdr_pgsql: Refactor magic number by definition for version

Change-Id: I43f25976aa3069793ddbe0086833965a6fb0a518
---
M cdr/cdr_pgsql.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index 33cc1b8..b482fe6 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -59,6 +59,8 @@
 
 #define DATE_FORMAT "'%Y-%m-%d %T'"
 
+#define PGSQL_MIN_VERSION_SCHEMA 70300
+
 static const char name[] = "pgsql";
 static const char config[] = "cdr_pgsql.conf";
 
@@ -677,7 +679,7 @@
 		}
 		version = PQserverVersion(conn);
 
-		if (version >= 70300) {
+		if (version >= PGSQL_MIN_VERSION_SCHEMA) {
 			char *schemaname, *tablename, *tmp_schemaname, *tmp_tablename;
 			if (strchr(table, '.')) {
 				tmp_schemaname = ast_strdupa(table);

-- 
To view, visit https://gerrit.asterisk.org/6466
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I43f25976aa3069793ddbe0086833965a6fb0a518
Gerrit-Change-Number: 6466
Gerrit-PatchSet: 1
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170911/effd27c1/attachment.html>


More information about the asterisk-code-review mailing list