mirror of https://github.com/Icinga/icinga2.git
parent
8918b38dea
commit
306a0f476c
|
@ -837,7 +837,9 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||||
|
|
||||||
Value rawvalue = DbValue::ExtractValue(value);
|
Value rawvalue = DbValue::ExtractValue(value);
|
||||||
|
|
||||||
if (rawvalue.IsObjectType<ConfigObject>()) {
|
if (rawvalue.GetType() == ValueEmpty) {
|
||||||
|
*result = "NULL";
|
||||||
|
} else if (rawvalue.IsObjectType<ConfigObject>()) {
|
||||||
DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
|
DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
|
||||||
|
|
||||||
if (!dbobjcol) {
|
if (!dbobjcol) {
|
||||||
|
@ -950,9 +952,6 @@ bool IdoMysqlConnection::CanExecuteQuery(const DbQuery& query)
|
||||||
for (const Dictionary::Pair& kv : query.Fields) {
|
for (const Dictionary::Pair& kv : query.Fields) {
|
||||||
Value value;
|
Value value;
|
||||||
|
|
||||||
if (kv.second.IsEmpty() && !kv.second.IsString())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value))
|
if (!FieldToEscapedString(kv.first, kv.second, &value))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1129,9 +1128,6 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
||||||
for (const Dictionary::Pair& kv : query.Fields) {
|
for (const Dictionary::Pair& kv : query.Fields) {
|
||||||
Value value;
|
Value value;
|
||||||
|
|
||||||
if (kv.second.IsEmpty() && !kv.second.IsString())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||||
|
|
||||||
#ifdef I2_DEBUG /* I2_DEBUG */
|
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||||
|
|
|
@ -652,7 +652,9 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||||
|
|
||||||
Value rawvalue = DbValue::ExtractValue(value);
|
Value rawvalue = DbValue::ExtractValue(value);
|
||||||
|
|
||||||
if (rawvalue.IsObjectType<ConfigObject>()) {
|
if (rawvalue.GetType() == ValueEmpty) {
|
||||||
|
*result = "NULL";
|
||||||
|
} else if (rawvalue.IsObjectType<ConfigObject>()) {
|
||||||
DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
|
DbObject::Ptr dbobjcol = DbObject::GetOrCreateByObject(rawvalue);
|
||||||
|
|
||||||
if (!dbobjcol) {
|
if (!dbobjcol) {
|
||||||
|
@ -755,9 +757,6 @@ bool IdoPgsqlConnection::CanExecuteQuery(const DbQuery& query)
|
||||||
for (const Dictionary::Pair& kv : query.Fields) {
|
for (const Dictionary::Pair& kv : query.Fields) {
|
||||||
Value value;
|
Value value;
|
||||||
|
|
||||||
if (kv.second.IsEmpty() && !kv.second.IsString())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value))
|
if (!FieldToEscapedString(kv.first, kv.second, &value))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -911,9 +910,6 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
||||||
Value value;
|
Value value;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (const Dictionary::Pair& kv : query.Fields) {
|
for (const Dictionary::Pair& kv : query.Fields) {
|
||||||
if (kv.second.IsEmpty() && !kv.second.IsString())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
||||||
m_QueryQueue.Enqueue([this, query]() { InternalExecuteQuery(query, -1); }, query.Priority);
|
m_QueryQueue.Enqueue([this, query]() { InternalExecuteQuery(query, -1); }, query.Priority);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue