Loading DataBase.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include <algorithm> #include "DatabaseConnectionHandle.h" #include "Utils.h" #include "common.h" /* clang-format off */ /*----- PROTECTED REGION END -----*/ // DataBase.cpp Loading Loading @@ -431,7 +432,7 @@ void DataBase::init_device() } // Load history depth property historyDepth = 10; historyDepth = DEFAULT_HISTORY_DEPTH; try { Tango::DevVarStringArray *argin = new Tango::DevVarStringArray(); Loading @@ -451,7 +452,7 @@ void DataBase::init_device() if(historyDepth == 0) { TANGO_LOG << "Warning, Invalid historyDepth property, resetting to default value (10)" << std::endl; historyDepth = 10; historyDepth = DEFAULT_HISTORY_DEPTH; } } } Loading Loading @@ -5147,7 +5148,7 @@ Tango::DevVarStringArray *DataBase::db_get_property(const Tango::DevVarStringArr * Description: Retrieve object property history * * @param argin Str[0] = Object name * Str[2] = Property name * Str[1] = Property name * @returns Str[0] = Property name * Str[1] = date * Str[2] = Property value number (array case) Loading DataBase.h +1 −1 Original line number Diff line number Diff line Loading @@ -933,7 +933,7 @@ public: * Description: Retrieve object property history * * @param argin Str[0] = Object name * Str[2] = Property name * Str[1] = Property name * @returns Str[0] = Property name * Str[1] = date * Str[2] = Property value number (array case) Loading DataBase.xmi +1 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </commands> <commands name="DbGetPropertyHist" description="Retrieve object property history" execMethod="db_get_property_hist" displayLevel="OPERATOR" polledPeriod="0"> <argin description="Str[0] = Object name
Str[2] = Property name"> <argin description="Str[0] = Object name
Str[1] = Property name"> <type xsi:type="pogoDsl:StringArrayType"/> </argin> <argout description="Str[0] = Property name
Str[1] = date
Str[2] = Property value number (array case)
Str[3] = Property value 1
Str[n] = Property value n"> Loading DataBaseClass.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2901,7 +2901,7 @@ void DataBaseClass::command_factory() DbGetPropertyHistClass *pDbGetPropertyHistCmd = new DbGetPropertyHistClass("DbGetPropertyHist", Tango::DEVVAR_STRINGARRAY, Tango::DEVVAR_STRINGARRAY, "Str[0] = Object name\nStr[2] = Property name", "Str[0] = Object name\nStr[1] = Property name", "Str[0] = Property name\nStr[1] = date\nStr[2] = Property value number (array case)\nStr[3] = Property value 1\nStr[n] = Property value n", Tango::OPERATOR); command_list.push_back(pDbGetPropertyHistCmd); Loading DataBaseUtils.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,9 @@ void DataBase::simple_query(std::string sql_query, const char *method, DatabaseC o << "\n.The query was: " << sql_query << std::ends; o2 << "DataBase::" << method << std::ends; ERROR_STREAM << o.str(); ERROR_STREAM << o2.str(); Tango::Except::throw_exception(DB_SQLError, o.str(), o2.str()); } Loading Loading @@ -512,6 +515,7 @@ void DataBase::purge_property( sql_query << "SELECT DISTINCT id,date FROM " << table << " WHERE " << field << "=\"" << object << "\" AND name=\"" << name << "\" ORDER by date"; DEBUG_STREAM << "DataBase::purge_property(): sql_query " << sql_query.str() << std::endl; result = query(sql_query.str(), "purge_property()", dch); int nb_item = mysql_num_rows(result); Loading @@ -519,6 +523,7 @@ void DataBase::purge_property( { // Purge int toDelete = nb_item - historyDepth; DEBUG_STREAM << "Purging " << toDelete << " elements" << std::endl; for(int j = 0; j < toDelete; j++) { row2 = mysql_fetch_row(result); Loading Loading @@ -820,6 +825,8 @@ AutoLock::AutoLock(DataBase *db) : AutoLock::~AutoLock() { // see https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#autocommit // why this works const std::string sql_query{"SET autocommit=1;"}; // or COMMIT the_db->simple_query(sql_query, "~AutoLock", m_dch); } Loading Loading
DataBase.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include <algorithm> #include "DatabaseConnectionHandle.h" #include "Utils.h" #include "common.h" /* clang-format off */ /*----- PROTECTED REGION END -----*/ // DataBase.cpp Loading Loading @@ -431,7 +432,7 @@ void DataBase::init_device() } // Load history depth property historyDepth = 10; historyDepth = DEFAULT_HISTORY_DEPTH; try { Tango::DevVarStringArray *argin = new Tango::DevVarStringArray(); Loading @@ -451,7 +452,7 @@ void DataBase::init_device() if(historyDepth == 0) { TANGO_LOG << "Warning, Invalid historyDepth property, resetting to default value (10)" << std::endl; historyDepth = 10; historyDepth = DEFAULT_HISTORY_DEPTH; } } } Loading Loading @@ -5147,7 +5148,7 @@ Tango::DevVarStringArray *DataBase::db_get_property(const Tango::DevVarStringArr * Description: Retrieve object property history * * @param argin Str[0] = Object name * Str[2] = Property name * Str[1] = Property name * @returns Str[0] = Property name * Str[1] = date * Str[2] = Property value number (array case) Loading
DataBase.h +1 −1 Original line number Diff line number Diff line Loading @@ -933,7 +933,7 @@ public: * Description: Retrieve object property history * * @param argin Str[0] = Object name * Str[2] = Property name * Str[1] = Property name * @returns Str[0] = Property name * Str[1] = date * Str[2] = Property value number (array case) Loading
DataBase.xmi +1 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </commands> <commands name="DbGetPropertyHist" description="Retrieve object property history" execMethod="db_get_property_hist" displayLevel="OPERATOR" polledPeriod="0"> <argin description="Str[0] = Object name
Str[2] = Property name"> <argin description="Str[0] = Object name
Str[1] = Property name"> <type xsi:type="pogoDsl:StringArrayType"/> </argin> <argout description="Str[0] = Property name
Str[1] = date
Str[2] = Property value number (array case)
Str[3] = Property value 1
Str[n] = Property value n"> Loading
DataBaseClass.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2901,7 +2901,7 @@ void DataBaseClass::command_factory() DbGetPropertyHistClass *pDbGetPropertyHistCmd = new DbGetPropertyHistClass("DbGetPropertyHist", Tango::DEVVAR_STRINGARRAY, Tango::DEVVAR_STRINGARRAY, "Str[0] = Object name\nStr[2] = Property name", "Str[0] = Object name\nStr[1] = Property name", "Str[0] = Property name\nStr[1] = date\nStr[2] = Property value number (array case)\nStr[3] = Property value 1\nStr[n] = Property value n", Tango::OPERATOR); command_list.push_back(pDbGetPropertyHistCmd); Loading
DataBaseUtils.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -460,6 +460,9 @@ void DataBase::simple_query(std::string sql_query, const char *method, DatabaseC o << "\n.The query was: " << sql_query << std::ends; o2 << "DataBase::" << method << std::ends; ERROR_STREAM << o.str(); ERROR_STREAM << o2.str(); Tango::Except::throw_exception(DB_SQLError, o.str(), o2.str()); } Loading Loading @@ -512,6 +515,7 @@ void DataBase::purge_property( sql_query << "SELECT DISTINCT id,date FROM " << table << " WHERE " << field << "=\"" << object << "\" AND name=\"" << name << "\" ORDER by date"; DEBUG_STREAM << "DataBase::purge_property(): sql_query " << sql_query.str() << std::endl; result = query(sql_query.str(), "purge_property()", dch); int nb_item = mysql_num_rows(result); Loading @@ -519,6 +523,7 @@ void DataBase::purge_property( { // Purge int toDelete = nb_item - historyDepth; DEBUG_STREAM << "Purging " << toDelete << " elements" << std::endl; for(int j = 0; j < toDelete; j++) { row2 = mysql_fetch_row(result); Loading Loading @@ -820,6 +825,8 @@ AutoLock::AutoLock(DataBase *db) : AutoLock::~AutoLock() { // see https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#autocommit // why this works const std::string sql_query{"SET autocommit=1;"}; // or COMMIT the_db->simple_query(sql_query, "~AutoLock", m_dch); } Loading