From 9669fede189dded576944f408abe3a8d4feb5cf6 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 9 Jun 2017 10:18:15 -0400 Subject: [PATCH] fix merge by putting back my dbRow object --- src/zm_config.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/zm_config.cpp b/src/zm_config.cpp index eedebaf45..c1e5bd182 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -69,7 +69,8 @@ void zmLoadConfig() { Debug( 1, "Fetching ZM_SERVER_ID For Name = %s", staticConfig.SERVER_NAME.c_str() ); std::string sql = stringtf("SELECT Id FROM Servers WHERE Name='%s'", staticConfig.SERVER_NAME.c_str() ); - if ( MYSQL_ROW dbrow = zmDbFetchOne( sql.c_str() ) ) { + zmDbRow dbrow; + if ( dbrow.fetch( sql.c_str() ) ) { staticConfig.SERVER_ID = atoi(dbrow[0]); } else { Fatal("Can't get ServerId for Server %s", staticConfig.SERVER_NAME.c_str() ); @@ -80,11 +81,13 @@ void zmLoadConfig() { Debug( 1, "Fetching ZM_SERVER_NAME For Id = %d", staticConfig.SERVER_ID ); std::string sql = stringtf("SELECT Name FROM Servers WHERE Id='%d'", staticConfig.SERVER_ID ); - if ( MYSQL_ROW dbrow = zmDbFetchOne( sql.c_str() ) ) { - staticConfig.SERVER_NAME = std::string(dbrow[0]); - } else { - Fatal("Can't get ServerName for Server ID %d", staticConfig.SERVER_ID ); - } + zmDbRow dbrow; + if ( dbrow.fetch( sql.c_str() ) ) { + staticConfig.SERVER_NAME = std::string(dbrow[0]); + } else { + Fatal("Can't get ServerName for Server ID %d", staticConfig.SERVER_ID ); + } + if ( staticConfig.SERVER_ID ) { Debug( 3, "Multi-server configuration detected. Server is %d.", staticConfig.SERVER_ID ); } else {