mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[12023] Enable SQL-Storage to work with entries of value zero
This commit is contained in:
parent
a309de2e6d
commit
314c448a3d
2 changed files with 24 additions and 26 deletions
|
|
@ -28,7 +28,6 @@ class SQLStorage
|
|||
friend struct SQLStorageLoaderBase;
|
||||
|
||||
public:
|
||||
|
||||
SQLStorage(const char* fmt, const char* _entry_field, const char* sqlname)
|
||||
{
|
||||
src_format = fmt;
|
||||
|
|
@ -43,7 +42,6 @@ class SQLStorage
|
|||
init(_entry_field, sqlname);
|
||||
}
|
||||
|
||||
|
||||
~SQLStorage()
|
||||
{
|
||||
Free();
|
||||
|
|
@ -52,8 +50,6 @@ class SQLStorage
|
|||
template<class T>
|
||||
T const* LookupEntry(uint32 id) const
|
||||
{
|
||||
if( id == 0 )
|
||||
return NULL;
|
||||
if (id >= MaxEntry)
|
||||
return NULL;
|
||||
return reinterpret_cast<T const*>(pIndex[id]);
|
||||
|
|
@ -70,6 +66,7 @@ class SQLStorage
|
|||
void Free();
|
||||
|
||||
void EraseEntry(uint32 id);
|
||||
|
||||
private:
|
||||
void init(const char* _entry_field, const char* sqlname)
|
||||
{
|
||||
|
|
@ -113,6 +110,7 @@ struct SQLStorageLoaderBase
|
|||
template<class D>
|
||||
void convert_from_str(uint32 field_pos, char* src, D& dst);
|
||||
void convert_str_to_str(uint32 field_pos, char* src, char*& dst);
|
||||
|
||||
private:
|
||||
template<class V>
|
||||
void storeValue(V value, SQLStorage& store, char* p, uint32 x, uint32& offset);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12022"
|
||||
#define REVISION_NR "12023"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue