Skip to content

Commit 11e9169

Browse files
committed
fixed:problems caused by changing table names
1 parent 44c49f7 commit 11e9169

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

XEngine_Source/MQCore_DBModule/DBModule_MQUser/DBModule_MQUser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ BOOL CDBModule_MQUser::DBModule_MQUser_KeyTopicUPDate(LPCTSTR lpszSourceTable, L
597597
TCHAR tszSQLQuery[2048];
598598
memset(tszSQLQuery, '\0', sizeof(tszSQLQuery));
599599

600-
_stprintf(tszSQLQuery, _T("UPDATE `UserKey` SET tszQueueName = '%s' WHERE tszQueueName = '%s'"), lpszSourceTable, lpszDestTable);
600+
_stprintf(tszSQLQuery, _T("UPDATE `UserKey` SET tszKeyName = '%s' WHERE tszKeyName = '%s'"), lpszDestTable, lpszSourceTable);
601601
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery))
602602
{
603603
DBModule_IsErrorOccur = TRUE;
@@ -802,7 +802,7 @@ BOOL CDBModule_MQUser::DBModule_MQUser_TimeTopicUPDate(LPCTSTR lpszSourceTable,
802802
TCHAR tszSQLQuery[2048];
803803
memset(tszSQLQuery, '\0', sizeof(tszSQLQuery));
804804

805-
_stprintf(tszSQLQuery, _T("UPDATE `UserTime` SET tszQueueName = '%s' WHERE tszQueueName = '%s'"), lpszSourceTable, lpszDestTable);
805+
_stprintf(tszSQLQuery, _T("UPDATE `UserTime` SET tszQueueName = '%s' WHERE tszQueueName = '%s'"), lpszDestTable, lpszSourceTable);
806806
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery))
807807
{
808808
DBModule_IsErrorOccur = TRUE;
@@ -956,7 +956,7 @@ BOOL CDBModule_MQUser::DBModule_MQUser_OwnerTopicUPDate(LPCTSTR lpszSourceTable,
956956
TCHAR tszSQLQuery[2048];
957957
memset(tszSQLQuery, '\0', sizeof(tszSQLQuery));
958958

959-
_stprintf(tszSQLQuery, _T("UPDATE `KeyOwner` SET tszKeyName = '%s' WHERE tszKeyName = '%s'"), lpszSourceTable, lpszDestTable);
959+
_stprintf(tszSQLQuery, _T("UPDATE `KeyOwner` SET tszKeyName = '%s' WHERE tszKeyName = '%s'"), lpszDestTable, lpszSourceTable);
960960
if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery))
961961
{
962962
DBModule_IsErrorOccur = TRUE;

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ BOOL MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCTSTR lpszC
694694
return FALSE;
695695
}
696696
pSt_ProtocolHdr->wReserve = 0;
697+
DBModule_MQUser_KeyTopicUPDate(st_MQProtocol.tszMQKey, st_MQTopic.tszMQKey);
698+
DBModule_MQUser_TimeTopicUPDate(st_MQProtocol.tszMQKey, st_MQTopic.tszMQKey);
699+
DBModule_MQUser_OwnerTopicUPDate(st_MQProtocol.tszMQKey, st_MQTopic.tszMQKey);
697700

698701
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, &st_MQProtocol, tszSDBuffer, &nSDLen);
699702
XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType);

0 commit comments

Comments
 (0)