]> git.stg.codes - stg.git/commitdiff
Ticket 37. The changePolicyTimeout field added in SELECT FROM
authorElena Mamontova <helenh463@gmail.com>
Thu, 22 Sep 2016 12:52:46 +0000 (15:52 +0300)
committerElena Mamontova <helenh463@gmail.com>
Thu, 22 Sep 2016 12:52:46 +0000 (15:52 +0300)
tb_tariffs query in the if (version > 7) construction.
Assign a value to change PolicyTimeout added in if (version > 7)
construction.

projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp

index 0dd74902531b09fd678858ba4fac78ca3a242b86..1623988d549e92252e56449bc92d21e89103eb7c 100644 (file)
@@ -460,7 +460,8 @@ if (version > 6)
     query << ", period";
 
 if (version > 7)
     query << ", period";
 
 if (version > 7)
-    query << ", change_policy";
+    query << ", change_policy \
+              , change_policy_timeout";
 
 query << " FROM tb_tariffs WHERE name = '" << ename << "'";
 
 
 query << " FROM tb_tariffs WHERE name = '" << ename << "'";
 
@@ -513,7 +514,10 @@ if (version > 6)
     td->tariffConf.period = TARIFF::StringToPeriod(PQgetvalue(result, 0, 5));
 
 if (version > 7)
     td->tariffConf.period = TARIFF::StringToPeriod(PQgetvalue(result, 0, 5));
 
 if (version > 7)
+    {
     td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(PQgetvalue(result, 0, 6));
     td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(PQgetvalue(result, 0, 6));
+    td->tariffConf.changePolicyTimeout = TS2Int(PQgetvalue(result, 0, 7));
+    }
 
 PQclear(result);
 
 
 PQclear(result);