From 7609fb07ae0d884f4467ba16e674c05797a3be6c Mon Sep 17 00:00:00 2001 From: Elena Mamontova Date: Tue, 21 Jun 2016 11:30:50 +0300 Subject: [PATCH] Ticket 37. if (schemaVersion > 1) check added and td->tariffConf.changePolicy variable value assignment added in the RestoreTariff() function. --- .../plugins/store/mysql/mysql_store.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index 37da860b..754a9ee2 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -1661,6 +1661,26 @@ else td->tariffConf.period = TARIFF::MONTH; } +if (schemaVersion > 1) +{ + str = row[6+8*DIR_NUM]; + param = "ChangePolicy"; + + if (str.length() == 0) + { + mysql_free_result(res); + errorStr = "Cannot read tariff " + tariffName + ". Parameter " + param; + mysql_close(sock); + return -1; + } + + td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(str); + } +else + { + td->tariffConf.changePolicy = TARIFF::ALLOW; + } + mysql_free_result(res); mysql_close(sock); return 0; -- 2.44.2