Cleanup and applying code style to some Database files.
--HG-- branch : trunk
This commit is contained in:
@@ -32,7 +32,6 @@ DBCFileLoader::DBCFileLoader()
|
||||
|
||||
bool DBCFileLoader::Load(const char *filename, const char *fmt)
|
||||
{
|
||||
|
||||
uint32 header;
|
||||
if (data)
|
||||
{
|
||||
@@ -41,12 +40,14 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt)
|
||||
}
|
||||
|
||||
FILE * f = fopen(filename,"rb");
|
||||
if(!f)return false;
|
||||
if (!f)
|
||||
return false;
|
||||
|
||||
if (fread(&header,4,1,f)!=1) // Number of records
|
||||
return false;
|
||||
|
||||
EndianConvert(header);
|
||||
|
||||
if (header!=0x43424457)
|
||||
return false; //'WDBC'
|
||||
|
||||
@@ -88,6 +89,7 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt)
|
||||
return false;
|
||||
|
||||
fclose(f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,6 +97,7 @@ DBCFileLoader::~DBCFileLoader()
|
||||
{
|
||||
if (data)
|
||||
delete [] data;
|
||||
|
||||
if (fieldsOffset)
|
||||
delete [] fieldsOffset;
|
||||
}
|
||||
@@ -110,6 +113,7 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos)
|
||||
uint32 recordsize = 0;
|
||||
int32 i = -1;
|
||||
for (uint32 x=0; format[x]; ++x)
|
||||
{
|
||||
switch(format[x])
|
||||
{
|
||||
case FT_FLOAT:
|
||||
@@ -130,6 +134,7 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos)
|
||||
recordsize += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (index_pos)
|
||||
*index_pos = i;
|
||||
@@ -190,9 +195,7 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
|
||||
for (uint32 y =0; y<recordCount; ++y)
|
||||
{
|
||||
if(i>=0)
|
||||
{
|
||||
indexTable[getRecord(y).getUInt(i)]=&dataTable[offset];
|
||||
}
|
||||
else
|
||||
indexTable[y]=&dataTable[offset];
|
||||
|
||||
@@ -220,6 +223,7 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sqlDataTable = dataTable + offset;
|
||||
|
||||
return dataTable;
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
Database::~Database()
|
||||
{
|
||||
/*Delete objects*/
|
||||
}
|
||||
|
||||
bool Database::Initialize(const char *)
|
||||
@@ -114,12 +113,12 @@ bool Database::PExecuteLog(const char * format,...)
|
||||
void Database::SetResultQueue(SqlResultQueue * queue)
|
||||
{
|
||||
m_queryQueues[ACE_Based::Thread::current()] = queue;
|
||||
|
||||
}
|
||||
|
||||
QueryResult_AutoPtr Database::PQuery(const char *format,...)
|
||||
{
|
||||
if(!format) return QueryResult_AutoPtr(NULL);
|
||||
if (!format)
|
||||
return QueryResult_AutoPtr(NULL);
|
||||
|
||||
va_list ap;
|
||||
char szQuery [MAX_QUERY_LEN];
|
||||
@@ -138,7 +137,8 @@ QueryResult_AutoPtr Database::PQuery(const char *format,...)
|
||||
|
||||
QueryNamedResult* Database::PQueryNamed(const char *format,...)
|
||||
{
|
||||
if(!format) return NULL;
|
||||
if (!format)
|
||||
return NULL;
|
||||
|
||||
va_list ap;
|
||||
char szQuery [MAX_QUERY_LEN];
|
||||
|
||||
@@ -18,11 +18,14 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "Database/Database.h"
|
||||
#include "Database/SqlOperations.h"
|
||||
|
||||
|
||||
/// Function body definitions for the template function members of the Database class
|
||||
|
||||
|
||||
#define ASYNC_QUERY_BODY(sql, queue_itr) \
|
||||
if (!sql) return false; \
|
||||
\
|
||||
@@ -34,6 +37,7 @@
|
||||
if (queue_itr == m_queryQueues.end()) return false; \
|
||||
}
|
||||
|
||||
|
||||
#define ASYNC_PQUERY_BODY(format, szQuery) \
|
||||
if(!format) return false; \
|
||||
\
|
||||
@@ -53,6 +57,7 @@
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define ASYNC_DELAYHOLDER_BODY(holder, queue_itr) \
|
||||
if (!holder) return false; \
|
||||
\
|
||||
@@ -64,8 +69,10 @@
|
||||
if (queue_itr == m_queryQueues.end()) return false; \
|
||||
}
|
||||
|
||||
|
||||
// -- Query / member --
|
||||
|
||||
|
||||
template<class Class>
|
||||
bool
|
||||
Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr), const char *sql)
|
||||
@@ -74,6 +81,7 @@ Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr),
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class>(object, method), itr->second));
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1>
|
||||
bool
|
||||
Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1), ParamType1 param1, const char *sql)
|
||||
@@ -82,6 +90,7 @@ Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, P
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class, ParamType1>(object, method, (QueryResult_AutoPtr)NULL, param1), itr->second));
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1, typename ParamType2>
|
||||
bool
|
||||
Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1, ParamType2), ParamType1 param1, ParamType2 param2, const char *sql)
|
||||
@@ -90,6 +99,7 @@ Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, P
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class, ParamType1, ParamType2>(object, method, (QueryResult_AutoPtr)NULL, param1, param2), itr->second));
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1, typename ParamType2, typename ParamType3>
|
||||
bool
|
||||
Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1, ParamType2, ParamType3), ParamType1 param1, ParamType2 param2, ParamType3 param3, const char *sql)
|
||||
@@ -98,8 +108,10 @@ Database::AsyncQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, P
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::QueryCallback<Class, ParamType1, ParamType2, ParamType3>(object, method, (QueryResult_AutoPtr)NULL, param1, param2, param3), itr->second));
|
||||
}
|
||||
|
||||
|
||||
// -- Query / static --
|
||||
|
||||
|
||||
template<typename ParamType1>
|
||||
bool
|
||||
Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1), ParamType1 param1, const char *sql)
|
||||
@@ -108,6 +120,7 @@ Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1), ParamType1
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::SQueryCallback<ParamType1>(method, (QueryResult_AutoPtr)NULL, param1), itr->second));
|
||||
}
|
||||
|
||||
|
||||
template<typename ParamType1, typename ParamType2>
|
||||
bool
|
||||
Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2), ParamType1 param1, ParamType2 param2, const char *sql)
|
||||
@@ -116,6 +129,7 @@ Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2)
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::SQueryCallback<ParamType1, ParamType2>(method, (QueryResult_AutoPtr)NULL, param1, param2), itr->second));
|
||||
}
|
||||
|
||||
|
||||
template<typename ParamType1, typename ParamType2, typename ParamType3>
|
||||
bool
|
||||
Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2, ParamType3), ParamType1 param1, ParamType2 param2, ParamType3 param3, const char *sql)
|
||||
@@ -124,8 +138,10 @@ Database::AsyncQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2,
|
||||
return m_threadBody->Delay(new SqlQuery(sql, new Trinity::SQueryCallback<ParamType1, ParamType2, ParamType3>(method, (QueryResult_AutoPtr)NULL, param1, param2, param3), itr->second));
|
||||
}
|
||||
|
||||
|
||||
// -- PQuery / member --
|
||||
|
||||
|
||||
template<class Class>
|
||||
bool
|
||||
Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr), const char *format,...)
|
||||
@@ -134,6 +150,7 @@ Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr),
|
||||
return AsyncQuery(object, method, szQuery);
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1>
|
||||
bool
|
||||
Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1), ParamType1 param1, const char *format,...)
|
||||
@@ -142,6 +159,7 @@ Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr,
|
||||
return AsyncQuery(object, method, param1, szQuery);
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1, typename ParamType2>
|
||||
bool
|
||||
Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1, ParamType2), ParamType1 param1, ParamType2 param2, const char *format,...)
|
||||
@@ -150,6 +168,7 @@ Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr,
|
||||
return AsyncQuery(object, method, param1, param2, szQuery);
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1, typename ParamType2, typename ParamType3>
|
||||
bool
|
||||
Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr, ParamType1, ParamType2, ParamType3), ParamType1 param1, ParamType2 param2, ParamType3 param3, const char *format,...)
|
||||
@@ -158,8 +177,10 @@ Database::AsyncPQuery(Class *object, void (Class::*method)(QueryResult_AutoPtr,
|
||||
return AsyncQuery(object, method, param1, param2, param3, szQuery);
|
||||
}
|
||||
|
||||
|
||||
// -- PQuery / static --
|
||||
|
||||
|
||||
template<typename ParamType1>
|
||||
bool
|
||||
Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1), ParamType1 param1, const char *format,...)
|
||||
@@ -168,6 +189,7 @@ Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1), ParamType
|
||||
return AsyncQuery(method, param1, szQuery);
|
||||
}
|
||||
|
||||
|
||||
template<typename ParamType1, typename ParamType2>
|
||||
bool
|
||||
Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2), ParamType1 param1, ParamType2 param2, const char *format,...)
|
||||
@@ -176,6 +198,7 @@ Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2
|
||||
return AsyncQuery(method, param1, param2, szQuery);
|
||||
}
|
||||
|
||||
|
||||
template<typename ParamType1, typename ParamType2, typename ParamType3>
|
||||
bool
|
||||
Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2, ParamType3), ParamType1 param1, ParamType2 param2, ParamType3 param3, const char *format,...)
|
||||
@@ -184,8 +207,10 @@ Database::AsyncPQuery(void (*method)(QueryResult_AutoPtr, ParamType1, ParamType2
|
||||
return AsyncQuery(method, param1, param2, param3, szQuery);
|
||||
}
|
||||
|
||||
|
||||
// -- QueryHolder --
|
||||
|
||||
|
||||
template<class Class>
|
||||
bool
|
||||
Database::DelayQueryHolder(Class *object, void (Class::*method)(QueryResult_AutoPtr, SqlQueryHolder*), SqlQueryHolder *holder)
|
||||
@@ -194,6 +219,7 @@ Database::DelayQueryHolder(Class *object, void (Class::*method)(QueryResult_Auto
|
||||
return holder->Execute(new Trinity::QueryCallback<Class, SqlQueryHolder*>(object, method, (QueryResult_AutoPtr)NULL, holder), m_threadBody, itr->second);
|
||||
}
|
||||
|
||||
|
||||
template<class Class, typename ParamType1>
|
||||
bool
|
||||
Database::DelayQueryHolder(Class *object, void (Class::*method)(QueryResult_AutoPtr, SqlQueryHolder*, ParamType1), SqlQueryHolder *holder, ParamType1 param1)
|
||||
@@ -202,7 +228,7 @@ Database::DelayQueryHolder(Class *object, void (Class::*method)(QueryResult_Auto
|
||||
return holder->Execute(new Trinity::QueryCallback<Class, SqlQueryHolder*, ParamType1>(object, method, (QueryResult_AutoPtr)NULL, holder, param1), m_threadBody, itr->second);
|
||||
}
|
||||
|
||||
|
||||
#undef ASYNC_QUERY_BODY
|
||||
#undef ASYNC_PQUERY_BODY
|
||||
#undef ASYNC_DELAYHOLDER_BODY
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ DatabaseMysql::~DatabaseMysql()
|
||||
|
||||
bool DatabaseMysql::Initialize(const char *infoString)
|
||||
{
|
||||
|
||||
if (!Database::Initialize(infoString))
|
||||
return false;
|
||||
|
||||
@@ -143,24 +142,14 @@ bool DatabaseMysql::Initialize(const char *infoString)
|
||||
|
||||
if (mMysql)
|
||||
{
|
||||
sLog.outDetail( "Connected to MySQL database at %s",
|
||||
host.c_str());
|
||||
sLog.outDetail("Connected to MySQL database at %s", host.c_str());
|
||||
sLog.outString("MySQL client library: %s", mysql_get_client_info());
|
||||
sLog.outString("MySQL server ver: %s ", mysql_get_server_info( mMysql));
|
||||
|
||||
/*----------SET AUTOCOMMIT ON---------*/
|
||||
// It seems mysql 5.0.x have enabled this feature
|
||||
// by default. In crash case you can lose data!!!
|
||||
// So better to turn this off
|
||||
// ---
|
||||
// This is wrong since Trinity use transactions,
|
||||
// autocommit is turned of during it.
|
||||
// Setting it to on makes atomic updates work
|
||||
if (!mysql_autocommit(mMysql, 1))
|
||||
sLog.outDetail("AUTOCOMMIT SUCCESSFULLY SET TO 1");
|
||||
else
|
||||
sLog.outDetail("AUTOCOMMIT NOT SET TO 1");
|
||||
/*-------------------------------------*/
|
||||
|
||||
// set connection properties to UTF8 to properly handle locales for different
|
||||
// server configs - core sends data in UTF8, so MySQL must expect UTF8 too
|
||||
@@ -170,13 +159,9 @@ bool DatabaseMysql::Initialize(const char *infoString)
|
||||
#if MYSQL_VERSION_ID >= 50003
|
||||
my_bool my_true = (my_bool)1;
|
||||
if (mysql_options(mMysql, MYSQL_OPT_RECONNECT, &my_true))
|
||||
{
|
||||
sLog.outDetail("Failed to turn on MYSQL_OPT_RECONNECT.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outDetail("Successfully turned on MYSQL_OPT_RECONNECT.");
|
||||
}
|
||||
#else
|
||||
#warning "Your mySQL client lib version does not support reconnecting after a timeout.\nIf this causes you any trouble we advice you to upgrade your mySQL client libs to at least mySQL 5.0.13 to resolve this problem."
|
||||
#endif
|
||||
@@ -185,8 +170,7 @@ bool DatabaseMysql::Initialize(const char *infoString)
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError( "Could not connect to MySQL database at %s: %s\n",
|
||||
host.c_str(),mysql_error(mysqlInit));
|
||||
sLog.outError("Could not connect to MySQL database at %s: %s\n", host.c_str(),mysql_error(mysqlInit));
|
||||
mysql_close(mysqlInit);
|
||||
return false;
|
||||
}
|
||||
@@ -219,7 +203,6 @@ bool DatabaseMysql::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **p
|
||||
*pResult = mysql_store_result(mMysql);
|
||||
*pRowCount = mysql_affected_rows(mMysql);
|
||||
*pFieldCount = mysql_field_count(mMysql);
|
||||
// end guarded block
|
||||
}
|
||||
|
||||
if (!*pResult )
|
||||
@@ -279,19 +262,15 @@ bool DatabaseMysql::Execute(const char *sql)
|
||||
return false;
|
||||
|
||||
// don't use queued execution if it has not been initialized
|
||||
if (!m_threadBody) return DirectExecute(sql);
|
||||
if (!m_threadBody)
|
||||
return DirectExecute(sql);
|
||||
|
||||
tranThread = ACE_Based::Thread::current(); // owner of this transaction
|
||||
TransactionQueues::iterator i = m_tranQueues.find(tranThread);
|
||||
if (i != m_tranQueues.end() && i->second != NULL)
|
||||
{ // Statement for transaction
|
||||
i->second->DelayExecute(sql);
|
||||
}
|
||||
i->second->DelayExecute(sql); // Statement for transaction
|
||||
else
|
||||
{
|
||||
// Simple sql statement
|
||||
m_threadBody->Delay(new SqlStatement(sql));
|
||||
}
|
||||
m_threadBody->Delay(new SqlStatement(sql)); // Simple sql statement
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -320,7 +299,6 @@ bool DatabaseMysql::DirectExecute(const char* sql)
|
||||
sLog.outDebug("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql);
|
||||
#endif
|
||||
}
|
||||
// end guarded block
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -335,9 +313,8 @@ bool DatabaseMysql::_TransactionCmd(const char *sql)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("SQL: %s", sql);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -383,6 +360,7 @@ bool DatabaseMysql::CommitTransaction()
|
||||
{
|
||||
if (tranThread != ACE_Based::Thread::current())
|
||||
return false;
|
||||
|
||||
bool _res = _TransactionCmd("COMMIT");
|
||||
tranThread = NULL;
|
||||
mMutex.release();
|
||||
@@ -411,6 +389,7 @@ bool DatabaseMysql::RollbackTransaction()
|
||||
{
|
||||
if (tranThread != ACE_Based::Thread::current())
|
||||
return false;
|
||||
|
||||
bool _res = _TransactionCmd("ROLLBACK");
|
||||
tranThread = NULL;
|
||||
mMutex.release();
|
||||
@@ -424,6 +403,7 @@ bool DatabaseMysql::RollbackTransaction()
|
||||
delete i->second;
|
||||
i->second = NULL;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -446,7 +426,8 @@ void DatabaseMysql::InitDelayThread()
|
||||
|
||||
void DatabaseMysql::HaltDelayThread()
|
||||
{
|
||||
if (!m_threadBody || !m_delayThread) return;
|
||||
if (!m_threadBody || !m_delayThread)
|
||||
return;
|
||||
|
||||
m_threadBody->Stop(); //Stop event
|
||||
m_delayThread->wait(); //Wait for flush to DB
|
||||
@@ -455,4 +436,3 @@ void DatabaseMysql::HaltDelayThread()
|
||||
m_threadBody = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,12 +50,14 @@ mType(type)
|
||||
|
||||
Field::~Field()
|
||||
{
|
||||
if(mValue) delete [] mValue;
|
||||
if (mValue)
|
||||
delete [] mValue;
|
||||
}
|
||||
|
||||
void Field::SetValue(const char *value)
|
||||
{
|
||||
if(mValue) delete [] mValue;
|
||||
if (mValue)
|
||||
delete [] mValue;
|
||||
|
||||
if (value)
|
||||
{
|
||||
@@ -65,4 +67,3 @@ void Field::SetValue(const char *value)
|
||||
else
|
||||
mValue = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,4 +105,3 @@ enum Field::DataTypes QueryResultMysql::ConvertNativeType(enum_field_types mysql
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,4 +48,3 @@ class QueryResultMysql : public QueryResult
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ void SqlDelayThread::run()
|
||||
#endif
|
||||
|
||||
SqlAsyncTask * s = NULL;
|
||||
// Lets wait for next async task no more than 2 secs
|
||||
|
||||
ACE_Time_Value _time(2);
|
||||
while (m_running)
|
||||
{
|
||||
|
||||
@@ -48,4 +48,3 @@ class SqlDelayThread : public ACE_Based::Runnable
|
||||
virtual void run(); ///< Main Thread loop
|
||||
};
|
||||
#endif //__SQLDELAYTHREAD_H
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ void SqlTransaction::Execute(Database *db)
|
||||
|
||||
free((void*)const_cast<char*>(sql));
|
||||
}
|
||||
|
||||
db->DirectExecute("COMMIT");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,7 @@ void SqlQuery::Execute(Database *db)
|
||||
{
|
||||
if (!m_callback || !m_queue)
|
||||
return;
|
||||
|
||||
/// execute the query and store the result in the callback
|
||||
m_callback->SetResult(db->Query(m_sql));
|
||||
/// add the callback to the sql result queue of the thread it originated from
|
||||
@@ -196,4 +198,3 @@ void SqlQueryHolderEx::Execute(Database *db)
|
||||
/// sync with the caller thread
|
||||
m_queue->add(m_callback);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user