Commit c1dfd0de authored by Thomas Braun's avatar Thomas Braun
Browse files

DataBase.cpp: Remove tmp prefix from escaped_string variables

parent ce846099
Loading
Loading
Loading
Loading
+30 −32
Original line number Diff line number Diff line
@@ -6171,7 +6171,7 @@ void DataBase::db_put_class_attribute_property(const Tango::DevVarStringArray *a
            for(j = k + 2; j < k + n_properties * 2 + 2; j = j + 2)
            {
                name = (*property_list)[j];
                std::string tmp_escaped_string = escape_string((*property_list)[j + 1]);
                std::string escaped_string = escape_string((*property_list)[j + 1]);

                // first delete the tuple (device,name,count) from the property table
                sql_query_stream.str("");
@@ -6183,7 +6183,7 @@ void DataBase::db_put_class_attribute_property(const Tango::DevVarStringArray *a
                // then insert the new value for this tuple
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_attribute_class SET class='" << cls << "',attribute='"
                                 << attribute << "',name='" << name << "',count='1',value='" << tmp_escaped_string
                                 << attribute << "',name='" << name << "',count='1',value='" << escaped_string
                                 << "',updated=NOW(),accessed=NOW()";
                DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_class_attribute_property()", al.get_dch());
@@ -6194,7 +6194,7 @@ void DataBase::db_put_class_attribute_property(const Tango::DevVarStringArray *a
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_attribute_class_hist SET class='" << cls << "',attribute='"
                                 << attribute << "',name='" << name << "',id='" << class_attribute_property_hist_id
                                 << "',count='1',value='" << tmp_escaped_string << "'";
                                 << "',count='1',value='" << escaped_string << "'";
                DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_class_attribute_property()", al.get_dch());

@@ -6267,7 +6267,7 @@ void DataBase::db_put_class_attribute_property2(const Tango::DevVarStringArray *
                Tango::DevULong64 class_attribute_property_hist_id = get_id("class_attribute", al.get_dch());
                for(l = j + 1; l < j + n_rows + 1; l++)
                {
                    std::string tmp_escaped_string = escape_string((*argin)[l + 1]);
                    std::string escaped_string = escape_string((*argin)[l + 1]);
                    tmp_count++;
                    snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

@@ -6276,7 +6276,7 @@ void DataBase::db_put_class_attribute_property2(const Tango::DevVarStringArray *
                    sql_query_stream.str("");
                    sql_query_stream << "INSERT INTO property_attribute_class SET class=\'" << cls << "\',attribute=\'"
                                     << attribute << "\',name=\'" << name << "\',count=\'" << tmp_count_str
                                     << "\',value=\'" << tmp_escaped_string << "\',updated=NOW(),accessed=NOW()";
                                     << "\',value=\'" << escaped_string << "\',updated=NOW(),accessed=NOW()";
                    DEBUG_STREAM << "DataBase::PutClassAttributeProperty2(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_class_attribute_property2()", al.get_dch());
@@ -6287,7 +6287,7 @@ void DataBase::db_put_class_attribute_property2(const Tango::DevVarStringArray *
                    sql_query_stream << "INSERT INTO property_attribute_class_hist SET class=\'" << cls
                                     << "\',attribute=\'" << attribute << "\',name=\'" << name << "\',count=\'"
                                     << tmp_count_str << "\',id=\'" << class_attribute_property_hist_id << "\',value=\'"
                                     << tmp_escaped_string << "\'";
                                     << escaped_string << "\'";
                    DEBUG_STREAM << "DataBase::PutClassAttributeProperty2(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_class_attribute_property2()", al.get_dch());
@@ -6358,15 +6358,14 @@ void DataBase::db_put_class_property(const Tango::DevVarStringArray *argin)
            Tango::DevULong64 class_property_hist_id = get_id("class", al.get_dch());
            for(j = k + 2; j < k + n_rows + 2; j++)
            {
                std::string tmp_escaped_string = escape_string((*property_list)[j]);
                std::string escaped_string = escape_string((*property_list)[j]);
                tmp_count++;
                snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

                // then insert the new value for this tuple
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_class SET class='" << cls << "',name='" << name << "',count='"
                                 << tmp_count_str << "',value='" << tmp_escaped_string
                                 << "',updated=NOW(),accessed=NOW()";
                                 << tmp_count_str << "',value='" << escaped_string << "',updated=NOW(),accessed=NOW()";
                DEBUG_STREAM << "DataBase::PutClassProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_class_property()", al.get_dch());

@@ -6374,7 +6373,7 @@ void DataBase::db_put_class_property(const Tango::DevVarStringArray *argin)
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_class_hist SET class='" << cls << "',name='" << name
                                 << "',count='" << tmp_count_str << "',id='" << class_property_hist_id << "',value='"
                                 << tmp_escaped_string << "'";
                                 << escaped_string << "'";
                DEBUG_STREAM << "DataBase::PutClassProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_class_property()", al.get_dch());
            }
@@ -6511,7 +6510,7 @@ void DataBase::db_put_device_attribute_property(const Tango::DevVarStringArray *
            for(j = k + 2; j < k + n_properties * 2 + 2; j = j + 2)
            {
                name = (*property_list)[j];
                std::string tmp_escaped_string = escape_string((*property_list)[j + 1]);
                std::string escaped_string = escape_string((*property_list)[j + 1]);

                // first delete the tuple (device,name,count) from the property table
                sql_query_stream.str("");
@@ -6524,7 +6523,7 @@ void DataBase::db_put_device_attribute_property(const Tango::DevVarStringArray *
                // then insert the new value for this tuple
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_attribute_device SET device='" << device << "',attribute='"
                                 << attribute << "',name='" << name << "',count='1',value='" << tmp_escaped_string
                                 << attribute << "',name='" << name << "',count='1',value='" << escaped_string
                                 << "',updated=NOW(),accessed=NOW()";
                DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_device_attribute_property()", al.get_dch());
@@ -6534,8 +6533,7 @@ void DataBase::db_put_device_attribute_property(const Tango::DevVarStringArray *
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_attribute_device_hist SET device='" << device
                                 << "',attribute='" << attribute << "',name='" << name << "',id='"
                                 << device_attribute_property_hist_id << "',count='1',value='" << tmp_escaped_string
                                 << "'";
                                 << device_attribute_property_hist_id << "',count='1',value='" << escaped_string << "'";
                DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_device_attribute_property()", al.get_dch());

@@ -6624,7 +6622,7 @@ void DataBase::db_put_device_attribute_property2(const Tango::DevVarStringArray

                    for(l = j + 1; l < j + n_rows + 1; l++)
                    {
                        std::string tmp_escaped_string = escape_string((*argin)[l + 1]);
                        std::string escaped_string = escape_string((*argin)[l + 1]);
                        tmp_count++;
                        snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

@@ -6632,7 +6630,7 @@ void DataBase::db_put_device_attribute_property2(const Tango::DevVarStringArray
                        sql_query_stream.str("");
                        sql_query_stream << "INSERT INTO property_attribute_device SET device=\'" << device
                                         << "\',attribute=\'" << attribute << "\',name=\'" << name << "\',count=\'"
                                         << tmp_count_str << "\',value=\'" << tmp_escaped_string
                                         << tmp_count_str << "\',value=\'" << escaped_string
                                         << "\',updated=NOW(),accessed=NOW()";
                        DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str()
                                     << std::endl;
@@ -6643,7 +6641,7 @@ void DataBase::db_put_device_attribute_property2(const Tango::DevVarStringArray
                        sql_query_stream << "INSERT INTO property_attribute_device_hist SET device=\'" << device
                                         << "\',attribute=\'" << attribute << "\',name=\'" << name << "\',count=\'"
                                         << tmp_count_str << "\',id=\'" << device_attribute_property_hist_id
                                         << "\',value=\'" << tmp_escaped_string << "\'";
                                         << "\',value=\'" << escaped_string << "\'";
                        DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str()
                                     << std::endl;
                        simple_query(sql_query_stream.str(), "db_put_device_attribute_property2()", al.get_dch());
@@ -6721,14 +6719,14 @@ void DataBase::db_put_device_property(const Tango::DevVarStringArray *argin)

            for(j = k + 2; j < k + n_rows + 2; j++)
            {
                std::string tmp_escaped_string = escape_string((*property_list)[j]);
                std::string escaped_string = escape_string((*property_list)[j]);
                tmp_count++;
                snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

                // then insert the new value for this tuple
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_device SET device='" << device << "',name='" << name
                                 << "',count='" << tmp_count_str << "',value='" << tmp_escaped_string
                                 << "',count='" << tmp_count_str << "',value='" << escaped_string
                                 << "',updated=NOW(),accessed=NOW()";
                DEBUG_STREAM << "DataBase::PutDeviceProperty(): sql_query " << sql_query_stream.str() << std::endl;

@@ -6738,7 +6736,7 @@ void DataBase::db_put_device_property(const Tango::DevVarStringArray *argin)
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_device_hist SET device='" << device << "',id='"
                                 << device_property_hist_id << "',name='" << name << "',count='" << tmp_count_str
                                 << "',value='" << tmp_escaped_string << "'";
                                 << "',value='" << escaped_string << "'";

                DEBUG_STREAM << "DataBase::PutDeviceProperty(): sql_query " << sql_query_stream.str() << std::endl;

@@ -6807,13 +6805,13 @@ void DataBase::db_put_property(const Tango::DevVarStringArray *argin)
            Tango::DevULong64 object_property_hist_id = get_id("object", al.get_dch());
            for(int j = k + 2; j < k + n_rows + 2; j++)
            {
                std::string tmp_escaped_string = escape_string((*property_list)[j]);
                std::string escaped_string = escape_string((*property_list)[j]);
                tmp_count++;

                // then insert the new value for this tuple
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property SET object='" << tmp_object << "',name='" << name
                                 << "',count='" << tmp_count << "',value='" << tmp_escaped_string
                                 << "',count='" << tmp_count << "',value='" << escaped_string
                                 << "',updated=NOW(),accessed=NOW()";
                DEBUG_STREAM << "DataBase::db_put_property(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_property()", al.get_dch());
@@ -6822,7 +6820,7 @@ void DataBase::db_put_property(const Tango::DevVarStringArray *argin)
                sql_query_stream.str("");
                sql_query_stream << "INSERT INTO property_hist SET object='" << tmp_object << "',name='" << name
                                 << "',count='" << tmp_count << "',id='" << object_property_hist_id << "',value='"
                                 << tmp_escaped_string << "'";
                                 << escaped_string << "'";
                DEBUG_STREAM << "DataBase::db_put_property(): sql_query " << sql_query_stream.str() << std::endl;
                simple_query(sql_query_stream.str(), "db_put_property()", al.get_dch());
            }
@@ -8802,7 +8800,7 @@ void DataBase::db_put_class_pipe_property(const Tango::DevVarStringArray *argin)
                Tango::DevULong64 class_pipe_property_hist_id = get_id("class_pipe", al.get_dch());
                for(l = j + 1; l < j + n_rows + 1; l++)
                {
                    std::string tmp_escaped_string = escape_string((*argin)[l + 1]);
                    std::string escaped_string = escape_string((*argin)[l + 1]);
                    tmp_count++;
                    snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

@@ -8811,7 +8809,7 @@ void DataBase::db_put_class_pipe_property(const Tango::DevVarStringArray *argin)
                    sql_query_stream.str("");
                    sql_query_stream << "INSERT INTO property_pipe_class SET class=\'" << cls << "\',pipe=\'"
                                     << tmp_pipe << "\',name=\'" << name << "\',count=\'" << tmp_count_str
                                     << "\',value=\'" << tmp_escaped_string << "\',updated=NOW(),accessed=NOW()";
                                     << "\',value=\'" << escaped_string << "\',updated=NOW(),accessed=NOW()";
                    DEBUG_STREAM << "DataBase::PutClassPipeProperty(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_class_pipe_property()", al.get_dch());
@@ -8821,7 +8819,7 @@ void DataBase::db_put_class_pipe_property(const Tango::DevVarStringArray *argin)
                    sql_query_stream.str("");
                    sql_query_stream << "INSERT INTO property_pipe_class_hist SET class=\'" << cls << "\',pipe=\'"
                                     << tmp_pipe << "\',name=\'" << name << "\',count=\'" << tmp_count_str << "\',id=\'"
                                     << class_pipe_property_hist_id << "\',value=\'" << tmp_escaped_string << "\'";
                                     << class_pipe_property_hist_id << "\',value=\'" << escaped_string << "\'";
                    DEBUG_STREAM << "DataBase::PutClassPipeProperty(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_class_pipe_property()", al.get_dch());
@@ -8897,7 +8895,7 @@ void DataBase::db_put_device_pipe_property(const Tango::DevVarStringArray *argin

                for(l = j + 1; l < j + n_rows + 1; l++)
                {
                    std::string tmp_escaped_string = escape_string((*argin)[l + 1]);
                    std::string escaped_string = escape_string((*argin)[l + 1]);
                    tmp_count++;
                    snprintf(tmp_count_str, sizeof(tmp_count_str), "%d", tmp_count);

@@ -8905,7 +8903,7 @@ void DataBase::db_put_device_pipe_property(const Tango::DevVarStringArray *argin
                    sql_query_stream.str("");
                    sql_query_stream << "INSERT INTO property_pipe_device SET device=\'" << device << "\',pipe=\'"
                                     << tmp_pipe << "\',name=\'" << name << "\',count=\'" << tmp_count_str
                                     << "\',value=\'" << tmp_escaped_string << "\',updated=NOW(),accessed=NOW()";
                                     << "\',value=\'" << escaped_string << "\',updated=NOW(),accessed=NOW()";
                    DEBUG_STREAM << "DataBase::DbPutDevicePipeProperty(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_device_pipe_property()", al.get_dch());
@@ -8914,7 +8912,7 @@ void DataBase::db_put_device_pipe_property(const Tango::DevVarStringArray *argin
                    sql_query_stream.str("");
                    sql_query_stream << "INSERT INTO property_pipe_device_hist SET device=\'" << device << "\',pipe=\'"
                                     << tmp_pipe << "\',name=\'" << name << "\',count=\'" << tmp_count_str << "\',id=\'"
                                     << device_pipe_property_hist_id << "\',value=\'" << tmp_escaped_string << "\'";
                                     << device_pipe_property_hist_id << "\',value=\'" << escaped_string << "\'";
                    DEBUG_STREAM << "DataBase::DbPutDevicePipeProperty(): sql_query " << sql_query_stream.str()
                                 << std::endl;
                    simple_query(sql_query_stream.str(), "db_put_device_pipe_property()", al.get_dch());
@@ -9363,8 +9361,8 @@ void DataBase::create_update_mem_att(const Tango::DevVarStringArray *argin, Auto
    //

    std::stringstream sql_query_stream;
    std::string tmp_escaped_string = escape_string((*argin)[6]);
    sql_query_stream << "UPDATE property_attribute_device SET value=\"" << tmp_escaped_string << "\" WHERE device=\""
    std::string escaped_string = escape_string((*argin)[6]);
    sql_query_stream << "UPDATE property_attribute_device SET value=\"" << escaped_string << "\" WHERE device=\""
                     << device << "\" AND attribute=\"" << attribute << "\" AND name=\"__value\" AND count=1";
    DEBUG_STREAM << "DataBase::PutAttributeProperty2(): sql_query " << sql_query_stream.str() << std::endl;

@@ -9381,7 +9379,7 @@ void DataBase::create_update_mem_att(const Tango::DevVarStringArray *argin, Auto

        sql_query_stream.str("");
        sql_query_stream << "INSERT INTO property_attribute_device SET device=\'" << device << "\',attribute=\'"
                         << attribute << "\',name=\'__value\',count=1,value=\'" << tmp_escaped_string
                         << attribute << "\',name=\'__value\',count=1,value=\'" << escaped_string
                         << "\',updated=NOW(),accessed=NOW()";
        DEBUG_STREAM << "DataBase::PutAttributeProperty(): sql_query " << sql_query_stream.str() << std::endl;