Skip to content

Commit ae3856b

Browse files
committed
Core/Database: Remove warning suppression for mysql_stmt_bind_param, it has been undeprecated by MySQL
(cherry picked from commit 55687670c8f5a282c0d4d9727e0bb1d088d50833)
1 parent 521ec0b commit ae3856b

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/server/database/Database/MySQLConnection.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,6 @@ bool MySQLConnection::Execute(char const* sql)
213213
return true;
214214
}
215215

216-
static auto mysql_bind_param_no_deprecated(MYSQL_STMT* stmt, MYSQL_BIND* bnd)
217-
{
218-
#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
219-
#pragma GCC diagnostic push
220-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
221-
#else
222-
#pragma warning(push)
223-
#pragma warning(disable: 4996)
224-
#endif
225-
226-
return mysql_stmt_bind_param(stmt, bnd);
227-
228-
#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
229-
#pragma GCC diagnostic pop
230-
#else
231-
#pragma warning(pop)
232-
#endif
233-
}
234-
235216
bool MySQLConnection::Execute(PreparedStatementBase* stmt)
236217
{
237218
if (!m_Mysql)
@@ -249,7 +230,7 @@ bool MySQLConnection::Execute(PreparedStatementBase* stmt)
249230

250231
uint32 _s = getMSTime();
251232

252-
if (mysql_bind_param_no_deprecated(msql_STMT, msql_BIND))
233+
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
253234
{
254235
uint32 lErrno = mysql_errno(m_Mysql);
255236
TC_LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));
@@ -297,7 +278,7 @@ bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLPreparedStatement
297278

298279
uint32 _s = getMSTime();
299280

300-
if (mysql_bind_param_no_deprecated(msql_STMT, msql_BIND))
281+
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
301282
{
302283
uint32 lErrno = mysql_errno(m_Mysql);
303284
TC_LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));

0 commit comments

Comments
 (0)