mirror of
https://github.com/mangosfour/server.git
synced 2025-12-23 16:37:03 +00:00
[11999.5] Support loading tables with default filling into SQL-Loader
* Add special field markers to fill a column in SQLStorage with default values * Add a safeguard to DBCStorage::EraseEntry, Add helper function DBCStorage::InsertEntry to store content Note: If required similar adjustments to DBCStorage might be reasonable if required
This commit is contained in:
parent
1c1bc5c659
commit
969c10a8d9
5 changed files with 102 additions and 34 deletions
|
|
@ -29,7 +29,7 @@ class DBCStorage
|
|||
explicit DBCStorage(const char *f) : nCount(0), fieldCount(0), fmt(f), indexTable(NULL), m_dataTable(NULL) { }
|
||||
~DBCStorage() { Clear(); }
|
||||
|
||||
T const* LookupEntry(uint32 id) const { return (id>=nCount)?NULL:indexTable[id]; }
|
||||
T const* LookupEntry(uint32 id) const { return (id >= nCount) ? NULL : indexTable[id]; }
|
||||
uint32 GetNumRows() const { return nCount; }
|
||||
char const* GetFormat() const { return fmt; }
|
||||
uint32 GetFieldCount() const { return fieldCount; }
|
||||
|
|
@ -88,7 +88,8 @@ class DBCStorage
|
|||
nCount = 0;
|
||||
}
|
||||
|
||||
void EraseEntry(uint32 id) { indexTable[id] = NULL; }
|
||||
void EraseEntry(uint32 id) { assert(id < nCount && "To be erased entry must be in bounds!") ; indexTable[id] = NULL; }
|
||||
void InsertEntry(T* entry, uint32 id) { assert(id < nCount && "To be inserted entry must be in bounds!"); indexTable[id] = entry; }
|
||||
|
||||
private:
|
||||
uint32 nCount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue