mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Compare commits
4 commits
0feee9aa3e
...
dcd02b50bb
Author | SHA1 | Date | |
---|---|---|---|
dcd02b50bb | |||
4fe956dffc | |||
ChillerDragon | 7c2f058c40 | ||
6bf4a016ba |
|
@ -61,6 +61,7 @@ public:
|
|||
virtual void BindInt(int Idx, int Value) = 0;
|
||||
virtual void BindInt64(int Idx, int64_t Value) = 0;
|
||||
virtual void BindFloat(int Idx, float Value) = 0;
|
||||
virtual void BindNull(int Idx) = 0;
|
||||
|
||||
// Print expanded sql statement
|
||||
virtual void Print() = 0;
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
void BindInt(int Idx, int Value) override;
|
||||
void BindInt64(int Idx, int64_t Value) override;
|
||||
void BindFloat(int Idx, float Value) override;
|
||||
void BindNull(int Idx) override;
|
||||
|
||||
void Print() override {}
|
||||
bool Step(bool *pEnd, char *pError, int ErrorSize) override;
|
||||
|
@ -421,6 +422,22 @@ void CMysqlConnection::BindFloat(int Idx, float Value)
|
|||
pParam->error = nullptr;
|
||||
}
|
||||
|
||||
void CMysqlConnection::BindNull(int Idx)
|
||||
{
|
||||
m_NewQuery = true;
|
||||
Idx -= 1;
|
||||
dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds");
|
||||
|
||||
MYSQL_BIND *pParam = &m_vStmtParameters[Idx];
|
||||
pParam->buffer_type = MYSQL_TYPE_NULL;
|
||||
pParam->buffer = nullptr;
|
||||
pParam->buffer_length = 0;
|
||||
pParam->length = nullptr;
|
||||
pParam->is_null = nullptr;
|
||||
pParam->is_unsigned = false;
|
||||
pParam->error = nullptr;
|
||||
}
|
||||
|
||||
bool CMysqlConnection::Step(bool *pEnd, char *pError, int ErrorSize)
|
||||
{
|
||||
if(m_NewQuery)
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
void BindInt(int Idx, int Value) override;
|
||||
void BindInt64(int Idx, int64_t Value) override;
|
||||
void BindFloat(int Idx, float Value) override;
|
||||
void BindNull(int Idx) override;
|
||||
|
||||
void Print() override;
|
||||
bool Step(bool *pEnd, char *pError, int ErrorSize) override;
|
||||
|
@ -241,6 +242,13 @@ void CSqliteConnection::BindFloat(int Idx, float Value)
|
|||
m_Done = false;
|
||||
}
|
||||
|
||||
void CSqliteConnection::BindNull(int Idx)
|
||||
{
|
||||
int Result = sqlite3_bind_null(m_pStmt, Idx);
|
||||
AssertNoError(Result);
|
||||
m_Done = false;
|
||||
}
|
||||
|
||||
// Keep support for SQLite < 3.14 on older Linux distributions. MinGW does not
|
||||
// support __attribute__((weak)): https://sourceware.org/bugzilla/show_bug.cgi?id=9687
|
||||
#if defined(__GNUC__) && !defined(__MINGW32__)
|
||||
|
|
|
@ -102,7 +102,7 @@ void CStatboard::OnMessage(int MsgType, void *pRawMsg)
|
|||
|
||||
if(t <= p)
|
||||
return;
|
||||
str_utf8_truncate(aName, sizeof(aName), p, t - p);
|
||||
str_truncate(aName, sizeof(aName), p, t - p);
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue