git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Прибрано зайвий target у Makefile для sgconf
[stg.git]
/
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 f78586fb1cc7a2164013466409e5c991db0c2c60..f62a846f723988ff721b5b23ceb42f1aba5ffd53 100644
(file)
--- 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;
}
return -1;
}
+if (mysql_num_rows(res) != 1)
+{
+ errorStr = "User not found";
+ mysql_close(sock);
+ return -1;
+}
+
row = mysql_fetch_row(res);
string param;
row = mysql_fetch_row(res);
string param;
@@
-1774,7
+1781,6
@@
strprintf(&res,"INSERT INTO detailstat_%02d_%4d SET login='%s',"\
endTime.c_str()
);
endTime.c_str()
);
-int retRes;
map<IP_DIR_PAIR, STAT_NODE>::const_iterator stIter;
stIter = statTree.begin();
map<IP_DIR_PAIR, STAT_NODE>::const_iterator stIter;
stIter = statTree.begin();
@@
-1788,7
+1794,7
@@
while (stIter != statTree.end())
stIter->second.cash
);
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);
{
errorStr = "Couldn't insert data in WriteDetailedStat:\n";
errorStr += mysql_error(sock);