mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
merging with mysql-5.1-bugteam tree
This commit is contained in:
commit
90939fc50d
2 changed files with 18 additions and 2 deletions
|
@ -1085,7 +1085,7 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char
|
|||
if (bytesToStore)
|
||||
memcpy(db2Buf, dataToStore, bytesToStore);
|
||||
if (bytesToPad)
|
||||
wmemset((wchar_t*)(db2Buf + bytesToStore), 0x0020, bytesToPad/2);
|
||||
memset16((db2Buf + bytesToStore), 0x0020, bytesToPad/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1108,7 +1108,7 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char
|
|||
bytesToStore = db2BytesToStore;
|
||||
}
|
||||
if (db2BytesToStore < maxDb2BytesToStore) // If need to pad
|
||||
wmemset((wchar_t*)(db2Buf + db2BytesToStore), 0x0020, (maxDb2BytesToStore - db2BytesToStore)/2);
|
||||
memset16((db2Buf + db2BytesToStore), 0x0020, (maxDb2BytesToStore - db2BytesToStore)/2);
|
||||
}
|
||||
|
||||
if (db2FieldType == QMY_VARGRAPHIC)
|
||||
|
|
|
@ -109,5 +109,21 @@ bool isOrdinaryIdentifier(const char* s)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
Fill memory with a 16-bit word.
|
||||
|
||||
@param p Pointer to space to fill.
|
||||
@param v Value to fill
|
||||
@param l Length of space (in 16-bit words)
|
||||
*/
|
||||
void memset16(void* p, uint16 v, size_t l)
|
||||
{
|
||||
uint16* p2=(uint16*)p;
|
||||
while (l--)
|
||||
{
|
||||
*(p2++) = v;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue