Skip to content

Commit

Permalink
Fix invalid notification_id in DB IDO query
Browse files Browse the repository at this point in the history
fixes #8976
  • Loading branch information
Michael Friedrich committed Dec 15, 2015
1 parent da3d210 commit 0239acc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions lib/db_ido_mysql/idomysqlconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,13 +682,16 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
if (key == "instance_id") {
*result = static_cast<long>(m_InstanceID);
return true;
}
if (key == "session_token") {
} else if (key == "session_token") {
*result = m_SessionToken;
return true;
}
if (key == "notification_id") {
*result = static_cast<long>(GetNotificationInsertID(value));
} else if (key == "notification_id") {
DbReference ref = GetNotificationInsertID(value);

if (!ref.IsValid())
return false;

*result = static_cast<long>(ref);
return true;
}

Expand Down
13 changes: 8 additions & 5 deletions lib/db_ido_pgsql/idopgsqlconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,16 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
if (key == "instance_id") {
*result = static_cast<long>(m_InstanceID);
return true;
}
if (key == "session_token") {
} else if (key == "session_token") {
*result = m_SessionToken;
return true;
}
if (key == "notification_id") {
*result = static_cast<long>(GetNotificationInsertID(value));
} else if (key == "notification_id") {
DbReference ref = GetNotificationInsertID(value);

if (!ref.IsValid())
return false;

*result = static_cast<long>(ref);
return true;
}

Expand Down

0 comments on commit 0239acc

Please sign in to comment.