mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Set correct size of name column in SQL table
This commit is contained in:
parent
686cb5f1a7
commit
5378fdc20b
|
@ -1,7 +1,5 @@
|
|||
#include "connection.h"
|
||||
|
||||
#include <engine/shared/protocol.h>
|
||||
|
||||
IDbConnection::IDbConnection(const char *pPrefix)
|
||||
{
|
||||
str_copy(m_aPrefix, pPrefix);
|
||||
|
@ -30,7 +28,7 @@ void IDbConnection::FormatCreateRace(char *aBuf, unsigned int BufferSize, bool B
|
|||
" PRIMARY KEY (Map, Name, Time, Timestamp, Server)"
|
||||
")",
|
||||
GetPrefix(), Backup ? "_backup" : "",
|
||||
BinaryCollate(), MAX_NAME_LENGTH, BinaryCollate());
|
||||
BinaryCollate(), MAX_NAME_LENGTH_SQL, BinaryCollate());
|
||||
}
|
||||
|
||||
void IDbConnection::FormatCreateTeamrace(char *aBuf, unsigned int BufferSize, const char *pIdType, bool Backup) const
|
||||
|
@ -47,7 +45,7 @@ void IDbConnection::FormatCreateTeamrace(char *aBuf, unsigned int BufferSize, co
|
|||
" PRIMARY KEY (ID, Name)"
|
||||
")",
|
||||
GetPrefix(), Backup ? "_backup" : "",
|
||||
BinaryCollate(), MAX_NAME_LENGTH, BinaryCollate(), pIdType);
|
||||
BinaryCollate(), MAX_NAME_LENGTH_SQL, BinaryCollate(), pIdType);
|
||||
}
|
||||
|
||||
void IDbConnection::FormatCreateMaps(char *aBuf, unsigned int BufferSize) const
|
||||
|
@ -90,5 +88,5 @@ void IDbConnection::FormatCreatePoints(char *aBuf, unsigned int BufferSize) cons
|
|||
" Points INT DEFAULT 0, "
|
||||
" PRIMARY KEY (Name)"
|
||||
")",
|
||||
GetPrefix(), MAX_NAME_LENGTH, BinaryCollate());
|
||||
GetPrefix(), MAX_NAME_LENGTH_SQL, BinaryCollate());
|
||||
}
|
||||
|
|
|
@ -3,8 +3,15 @@
|
|||
|
||||
#include "connection_pool.h"
|
||||
|
||||
#include <engine/shared/protocol.h>
|
||||
#include <memory>
|
||||
|
||||
enum
|
||||
{
|
||||
// MAX_NAME_LENGTH includes the size with \0, which is not necessary in SQL
|
||||
MAX_NAME_LENGTH_SQL = MAX_NAME_LENGTH - 1,
|
||||
};
|
||||
|
||||
class IConsole;
|
||||
|
||||
// can hold one PreparedStatement with Results
|
||||
|
|
Loading…
Reference in a new issue