@ -64,6 +64,7 @@ struct BufferTypeInfo {
// Helper lambda to convert binary data to a hex string.
auto binaryToHex = [ ] ( const MYSQL_BIND * bind , unsigned long len , std : : string & out ) {
std : : ostringstream oss ;
oss < < " 0x " ;
const unsigned char * data = reinterpret_cast < const unsigned char * > ( bind - > buffer ) ;
for ( unsigned long i = 0 ; i < len ; i + + ) {
oss < < std : : setw ( 2 ) < < std : : setfill ( ' 0 ' ) < < std : : hex < < ( int ) data [ i ] ;
@ -109,7 +110,7 @@ static const std::unordered_map<unsigned int, BufferTypeInfo> bufferTypeInfoMap
} ,
{ MYSQL_TYPE_TIMESTAMP ,
{ " TIMESTAMP " , [ ] ( const MYSQL_BIND * bind , unsigned long len , std : : string & out ) {
binaryToHex ( bind , len , out ) ;
binaryToHex ( bind , sizeof ( MYSQL_TIME ) , out ) ;
} }
} ,
{ MYSQL_TYPE_LONGLONG ,
@ -125,17 +126,17 @@ static const std::unordered_map<unsigned int, BufferTypeInfo> bufferTypeInfoMap
} ,
{ MYSQL_TYPE_DATE ,
{ " DATE " , [ ] ( const MYSQL_BIND * bind , unsigned long len , std : : string & out ) {
binaryToHex ( bind , len , out ) ;
binaryToHex ( bind , sizeof ( MYSQL_TIME ) , out ) ;
} }
} ,
{ MYSQL_TYPE_TIME ,
{ " TIME " , [ ] ( const MYSQL_BIND * bind , unsigned long len , std : : string & out ) {
binaryToHex ( bind , len , out ) ;
binaryToHex ( bind , sizeof ( MYSQL_TIME ) , out ) ;
} }
} ,
{ MYSQL_TYPE_DATETIME ,
{ " DATETIME " , [ ] ( const MYSQL_BIND * bind , unsigned long len , std : : string & out ) {
binaryToHex ( bind , len , out ) ;
binaryToHex ( bind , sizeof ( MYSQL_TIME ) , out ) ;
} }
} ,
{ MYSQL_TYPE_YEAR ,