[ZBXNEXT-435] Add Oracle TNSNAMES connect support (https://support.zabbix.com/browse/ZBXNEXT-435) --- frontends/php/include/db.inc.php.orig 2019-06-27 08:00:56.526205359 +0300 +++ frontends/php/include/db.inc.php 2019-06-27 08:07:56.811265040 +0300 @@ -113,6 +113,8 @@ if ($DB['DATABASE']) { $connect .= '/'.$DB['DATABASE']; } + } else { + $connect = $DB['DATABASE']; } $DB['DB'] = @oci_connect($DB['USER'], $DB['PASSWORD'], $connect, 'UTF8'); --- src/libs/zbxdb/db.c.orig 2019-06-27 08:08:12.444044037 +0300 +++ src/libs/zbxdb/db.c 2019-06-27 08:11:40.680099796 +0300 @@ -443,16 +443,20 @@ zbx_vector_ptr_create(&oracle.db_results); - /* connection string format: [//]host[:port][/service name] */ - - if ('\0' != *host) + if (NULL != host && '\0' != *host) { + /* connection string format: [//]host[:port][/service name] */ connect = zbx_strdcatf(connect, "//%s", host); if (0 != port) connect = zbx_strdcatf(connect, ":%d", port); if (NULL != dbname && '\0' != *dbname) connect = zbx_strdcatf(connect, "/%s", dbname); } + else if (NULL != dbname && '\0' != *dbname) + { + /* use tnsname */ + connect = strdup(dbname); + } else ret = ZBX_DB_FAIL;