]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/mysql/mysql_store.cpp
Ticket 52. Definition of the tariff pointer added to the
[stg.git] / projects / stargazer / plugins / store / mysql / mysql_store.cpp
index 2600c85980de602eee14a8eeeb73cc8eadb14634..8108de0900a12b4d29278965fc0397968ffcfc2a 100644 (file)
@@ -222,12 +222,13 @@ else
             {
                  if(mysql_select_db(sock, storeSettings.GetDBName().c_str()))
                  {
-                    errorStr = "Couldn't select database! With error:\n";
-                    errorStr += mysql_error(sock);
-                    mysql_close(sock);
-                    ret = -1;
+                     errorStr = "Couldn't select database! With error:\n";
+                     errorStr += mysql_error(sock);
+                     mysql_close(sock);
+                     ret = -1;
                  }
-                 ret = CheckAllTables(sock);
+                 else
+                     ret = CheckAllTables(sock);
             }
         }
         else
@@ -1766,7 +1767,8 @@ if (schemaVersion > 0)
     res += ", Period='" + TARIFF::PeriodToString(td.tariffConf.period) + "'";
 
 if (schemaVersion > 1)
-    res += ", change_policy='" + TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) + "'";
+    res += ", change_policy='" + TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) + "'"\
+           ", change_policy_timeout='" + formatTime(td.tariffConf.changePolicy) + "'";
 
 strprintf(&param, " WHERE name='%s' LIMIT 1", tariffName.c_str());
 res += param;