Skip to content

Commit 450f271

Browse files
committed
fixed:DBModule_MQUser_KeyList function list is incorrent
1 parent 24140ee commit 450f271

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

XEngine_Source/MQCore_DBModule/DBModule_MQUser/DBModule_MQUser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ bool CDBModule_MQUser::DBModule_MQUser_KeyList(LPCXSTR lpszUser, LPCXSTR lpszKey
511511
{
512512
DBModule_IsErrorOccur = false;
513513

514-
if ((NULL == lpszUser) && (NULL == lpszKeyName))
514+
if ((NULL == lpszUser) || (NULL == lpszKeyName))
515515
{
516516
DBModule_IsErrorOccur = true;
517517
DBModule_dwErrorCode = ERROR_XENGINE_MQCORE_DATABASE_PARAMENT;
@@ -525,15 +525,15 @@ bool CDBModule_MQUser::DBModule_MQUser_KeyList(LPCXSTR lpszUser, LPCXSTR lpszKey
525525
XCHAR tszSQLStatement[1024];
526526
memset(tszSQLStatement, '\0', sizeof(tszSQLStatement));
527527
//名称为,消息名为必填
528-
if ((NULL != lpszUser) && (NULL != lpszKeyName))
528+
if (_tcsxlen(lpszUser) > 0 && _tcsxlen(lpszKeyName) > 0)
529529
{
530530
_xstprintf(tszSQLStatement, _X("SELECT * FROM `UserKey` WHERE tszKeyUser = '%s' AND tszKeyName = '%s'"), lpszUser, lpszKeyName);
531531
}
532-
else if ((NULL != lpszUser) && (NULL == lpszKeyName))
532+
else if ((_tcsxlen(lpszUser) > 0) && (_tcsxlen(lpszKeyName) == 0))
533533
{
534534
_xstprintf(tszSQLStatement, _X("SELECT * FROM `UserKey` WHERE tszKeyUser = '%s'"), lpszUser);
535535
}
536-
else if ((NULL == lpszUser) && (NULL != lpszKeyName))
536+
else if ((_tcsxlen(lpszUser) == 0) && (_tcsxlen(lpszKeyName) > 0))
537537
{
538538
_xstprintf(tszSQLStatement, _X("SELECT * FROM `UserKey` WHERE tszKeyName = '%s'"), lpszKeyName);
539539
}

0 commit comments

Comments
 (0)