X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1bf5ae378079e212f6918d09d87dec5420a0d6ec..c02406ecfa463f3846f775ab9d4b9f69f5ba21a1:/projects/stargazer/plugins/store/mysql/mysql_store.cpp diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index f78586fb..f62a846f 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -711,6 +711,13 @@ if (!(res=mysql_store_result(sock))) return -1; } +if (mysql_num_rows(res) != 1) +{ + errorStr = "User not found"; + mysql_close(sock); + return -1; +} + row = mysql_fetch_row(res); string param; @@ -1774,7 +1781,6 @@ strprintf(&res,"INSERT INTO detailstat_%02d_%4d SET login='%s',"\ endTime.c_str() ); -int retRes; map::const_iterator stIter; stIter = statTree.begin(); @@ -1788,7 +1794,7 @@ while (stIter != statTree.end()) stIter->second.cash ); - if( (retRes = MysqlQuery((res+tempStr).c_str(),sock)) ) + if( MysqlQuery((res+tempStr).c_str(),sock) ) { errorStr = "Couldn't insert data in WriteDetailedStat:\n"; errorStr += mysql_error(sock);