@@ -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