diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 17cdca092..600fe11a6 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -59,7 +59,7 @@ void DBcore::ping() { MDatabase.unlock(); } -bool DBcore::RunQuery(const std::string query, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) { +bool DBcore::RunQuery(const std::string& query, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) { _CP(DBcore_RunQuery); if (errnum) *errnum = 0; diff --git a/common/dbcore.h b/common/dbcore.h index 51e0ee1a4..25e33fcf2 100644 --- a/common/dbcore.h +++ b/common/dbcore.h @@ -22,7 +22,7 @@ public: DBcore(); ~DBcore(); eStatus GetStatus() { return pStatus; } - bool RunQuery(const std::string query, char* errbuf = 0, MYSQL_RES** result = 0, uint32* affected_rows = 0, uint32* last_insert_id = 0, uint32* errnum = 0, bool retry = true); + bool RunQuery(const std::string& query, char* errbuf = 0, MYSQL_RES** result = 0, uint32* affected_rows = 0, uint32* last_insert_id = 0, uint32* errnum = 0, bool retry = true); void DoEscapeString(std::string& outString, const char* frombuf, uint32 fromlen); void ping(); MYSQL* getMySQL(){ return &mysql; }