fix(Core/Database) mysql_stmt_bind_param deprecated in MySQL 8.3 (#18295)
* feat(fix/build) Test on MacOS * Syntax error * Syntax error * Adding missing parameters * typo * deprecated * Check MySQL version
This commit is contained in:
@@ -227,7 +227,11 @@ bool MySQLConnection::Execute(PreparedStatementBase* stmt)
|
|||||||
|
|
||||||
uint32 _s = getMSTime();
|
uint32 _s = getMSTime();
|
||||||
|
|
||||||
|
#if MYSQL_VERSION_ID >= 80300
|
||||||
|
if (mysql_stmt_bind_named_param(msql_STMT, msql_BIND, m_mStmt->GetParameterCount(), nullptr))
|
||||||
|
#else
|
||||||
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
uint32 lErrno = mysql_errno(m_Mysql);
|
uint32 lErrno = mysql_errno(m_Mysql);
|
||||||
LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));
|
LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));
|
||||||
@@ -275,7 +279,11 @@ bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLPreparedStatement
|
|||||||
|
|
||||||
uint32 _s = getMSTime();
|
uint32 _s = getMSTime();
|
||||||
|
|
||||||
|
#if MYSQL_VERSION_ID >= 80300
|
||||||
|
if (mysql_stmt_bind_named_param(msql_STMT, msql_BIND, m_mStmt->GetParameterCount(), nullptr))
|
||||||
|
#else
|
||||||
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
if (mysql_stmt_bind_param(msql_STMT, msql_BIND))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
uint32 lErrno = mysql_errno(m_Mysql);
|
uint32 lErrno = mysql_errno(m_Mysql);
|
||||||
LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));
|
LOG_ERROR("sql.sql", "SQL(p): {}\n [ERROR]: [{}] {}", m_mStmt->getQueryString(), lErrno, mysql_stmt_error(msql_STMT));
|
||||||
|
|||||||
Reference in New Issue
Block a user