summaryrefslogtreecommitdiff
path: root/src/common/Database/MySQLConnection.cpp
diff options
context:
space:
mode:
authorKitzunu <24550914+Kitzunu@users.noreply.github.com>2021-03-02 01:34:20 +0100
committerGitHub <noreply@github.com>2021-03-02 01:34:20 +0100
commit28f1dc5c0cc0d3ce26bb64bfc4475329fb5166c2 (patch)
tree147c9b86f29ae601e37a7dde53570dcac3552b9d /src/common/Database/MySQLConnection.cpp
parentdbefa17a534500522a174e9906d8923445c16e79 (diff)
refactor(Core): replace NULL with nullptr (#4593)
Diffstat (limited to 'src/common/Database/MySQLConnection.cpp')
-rw-r--r--src/common/Database/MySQLConnection.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/Database/MySQLConnection.cpp b/src/common/Database/MySQLConnection.cpp
index 6dbd99ded1..d3b25fc2aa 100644
--- a/src/common/Database/MySQLConnection.cpp
+++ b/src/common/Database/MySQLConnection.cpp
@@ -26,9 +26,9 @@
MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) :
m_reconnecting(false),
m_prepareError(false),
- m_queue(NULL),
- m_worker(NULL),
- m_Mysql(NULL),
+ m_queue(nullptr),
+ m_worker(nullptr),
+ m_Mysql(nullptr),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_SYNCH)
{
@@ -38,7 +38,7 @@ MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInf
m_reconnecting(false),
m_prepareError(false),
m_queue(queue),
- m_Mysql(NULL),
+ m_Mysql(nullptr),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_ASYNC)
{
@@ -64,7 +64,7 @@ void MySQLConnection::Close()
bool MySQLConnection::Open()
{
MYSQL* mysqlInit;
- mysqlInit = mysql_init(NULL);
+ mysqlInit = mysql_init(nullptr);
if (!mysqlInit)
{
sLog->outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str());
@@ -313,15 +313,15 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES** pResult, uint6
ResultSet* MySQLConnection::Query(const char* sql)
{
if (!sql)
- return NULL;
+ return nullptr;
- MYSQL_RES* result = NULL;
- MYSQL_FIELD* fields = NULL;
+ MYSQL_RES* result = nullptr;
+ MYSQL_FIELD* fields = nullptr;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(sql, &result, &fields, &rowCount, &fieldCount))
- return NULL;
+ return nullptr;
return new ResultSet(result, fields, rowCount, fieldCount);
}
@@ -460,7 +460,7 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
// to save memory that will not be used.
if (!(m_connectionFlags & flags))
{
- m_stmts[index] = NULL;
+ m_stmts[index] = nullptr;
return;
}
@@ -490,12 +490,12 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
{
- MYSQL_RES* result = NULL;
+ MYSQL_RES* result = nullptr;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(stmt, &result, &rowCount, &fieldCount))
- return NULL;
+ return nullptr;
if (mysql_more_results(m_Mysql))
{