mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22: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
|
|
@ -62,6 +62,7 @@ class SQLStorage
|
|||
uint32 RecordCount;
|
||||
uint32 MaxEntry;
|
||||
uint32 iNumFields;
|
||||
uint32 oNumFields;
|
||||
|
||||
char const* GetTableName() const { return table; }
|
||||
|
||||
|
|
@ -77,6 +78,7 @@ class SQLStorage
|
|||
data=NULL;
|
||||
pIndex=NULL;
|
||||
iNumFields = strlen(src_format);
|
||||
oNumFields = strlen(dst_format);
|
||||
MaxEntry = 0;
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +105,9 @@ struct SQLStorageLoaderBase
|
|||
template<class D>
|
||||
void convert_from_str(uint32 field_pos, char const* src, D& dst);
|
||||
void convert_str_to_str(uint32 field_pos, char const* src, char *&dst);
|
||||
template<class S, class D>
|
||||
void default_fill(uint32 field_pos, S src, D &dst);
|
||||
void default_fill_to_str(uint32 field_pos, char const* src, char * & dst);
|
||||
|
||||
// trap, no body
|
||||
template<class D>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue