From: Elena Mamontova Date: Tue, 21 Jun 2016 08:30:50 +0000 (+0300) Subject: Ticket 37. if (schemaVersion > 1) check added and td->tariffConf.changePolicy variable X-Git-Tag: 2.409~152 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/7609fb07ae0d884f4467ba16e674c05797a3be6c?ds=inline Ticket 37. if (schemaVersion > 1) check added and td->tariffConf.changePolicy variable value assignment added in the RestoreTariff() function. --- 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;