Skip to content

Commit 703cfc5

Browse files
committed
fixed:message modification permissions judgment incorrect
1 parent 817c25a commit 703cfc5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

XEngine_Source/MQCore_DBModule/DBModule_MQData/DBModule_MQData.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,20 @@ BOOL CDBModule_MQData::DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo
226226
memset(tszSQLStatement, '\0', sizeof(tszSQLStatement));
227227

228228
_stprintf(tszSQLStatement, _T("UPDATE `%s` SET nQueueGetTime = %lld,tszQueueLeftTime = '%s',tszQueuePublishTime = '%s',tszQueueData = '%s',nDataLen = %d,nDataType = %d WHERE tszUserName = '%s' AND tszQueueName = '%s' AND nQueueSerial = %lld"), pSt_DBInfo->tszQueueName, pSt_DBInfo->nQueueGetTime, pSt_DBInfo->tszQueueLeftTime, pSt_DBInfo->tszQueuePublishTime, pSt_DBInfo->tszMsgBuffer, pSt_DBInfo->nMsgLen, pSt_DBInfo->byMsgType, pSt_DBInfo->tszUserName, pSt_DBInfo->tszQueueName, pSt_DBInfo->nQueueSerial);
229-
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement))
229+
230+
__int64u nRows = 0;
231+
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement, &nRows))
230232
{
231233
DBModule_IsErrorOccur = TRUE;
232234
DBModule_dwErrorCode = DataBase_GetLastError();
233235
return FALSE;
234236
}
237+
if (nRows <= 0)
238+
{
239+
DBModule_IsErrorOccur = TRUE;
240+
DBModule_dwErrorCode = ERROR_XENGINE_MQCORE_DATABASE_NOTFOUND;
241+
return FALSE;
242+
}
235243
return TRUE;
236244
}
237245
/********************************************************************

0 commit comments

Comments
 (0)