mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +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
|
|
@ -22,7 +22,7 @@
|
|||
void SQLStorage::EraseEntry(uint32 id)
|
||||
{
|
||||
uint32 offset = 0;
|
||||
for(uint32 x = 0; x < iNumFields; ++x)
|
||||
for (uint32 x = 0; x < oNumFields; ++x)
|
||||
{
|
||||
switch(dst_format[x])
|
||||
{
|
||||
|
|
@ -43,8 +43,13 @@ void SQLStorage::EraseEntry(uint32 id)
|
|||
break;
|
||||
}
|
||||
case FT_NA:
|
||||
offset += sizeof(uint32); break;
|
||||
case FT_NA_BYTE:
|
||||
break;
|
||||
offset += sizeof(char); break;
|
||||
case FT_NA_FLOAT:
|
||||
offset += sizeof(float); break;
|
||||
case FT_NA_POINTER:
|
||||
offset += sizeof(char*); break;
|
||||
case FT_IND:
|
||||
case FT_SORT:
|
||||
assert(false && "SQL storage not have sort field types");
|
||||
|
|
@ -61,7 +66,7 @@ void SQLStorage::EraseEntry(uint32 id)
|
|||
void SQLStorage::Free ()
|
||||
{
|
||||
uint32 offset = 0;
|
||||
for(uint32 x = 0; x < iNumFields; ++x)
|
||||
for (uint32 x = 0; x < oNumFields; ++x)
|
||||
{
|
||||
switch(dst_format[x])
|
||||
{
|
||||
|
|
@ -83,8 +88,13 @@ void SQLStorage::Free ()
|
|||
break;
|
||||
}
|
||||
case FT_NA:
|
||||
offset += sizeof(uint32); break;
|
||||
case FT_NA_BYTE:
|
||||
break;
|
||||
offset += sizeof(char); break;
|
||||
case FT_NA_FLOAT:
|
||||
offset += sizeof(float); break;
|
||||
case FT_NA_POINTER:
|
||||
offset += sizeof(char*); break;
|
||||
case FT_IND:
|
||||
case FT_SORT:
|
||||
assert(false && "SQL storage not have sort field types");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue