diff --git a/src/mysql/packets.cr b/src/mysql/packets.cr index ff7e19e..d41fd35 100644 --- a/src/mysql/packets.cr +++ b/src/mysql/packets.cr @@ -72,7 +72,8 @@ module MySql::Protocol packet.write_bytes caps, IO::ByteFormat::LittleEndian packet.write_bytes 0x00000000u32, IO::ByteFormat::LittleEndian - packet.write_byte 0x21u8 # utf8_general_ci + # packet.write_byte 0x21u8 # utf8_general_ci + packet.write_byte 0x2du8 # UTF8MB4_GENERAL_CI 23.times { packet.write_byte 0_u8 } packet << @username diff --git a/src/mysql/types.cr b/src/mysql/types.cr index ee54abc..6a193f6 100644 --- a/src/mysql/types.cr +++ b/src/mysql/types.cr @@ -159,7 +159,7 @@ abstract struct MySql::Type decl_type Time, 0x0bu8 decl_type DateTime, 0x0cu8, ::Time do def self.write(packet, v : ::Time) - packet.write_blob UInt8.slice(v.year.to_i16, v.year.to_i16/256, v.month.to_i8, v.day.to_i8, v.hour.to_i8, v.minute.to_i8, v.second.to_i8, v.millisecond*1000, v.millisecond*1000/256, v.millisecond*1000/65536) + packet.write_blob UInt8.slice(v.year.to_i16, v.year.to_i16/256, v.month.to_i8, v.day.to_i8, v.hour.to_i8, v.minute.to_i8, v.second.to_i8, v.millisecond*1000, v.millisecond*1000/256, v.millisecond*1000/65536, v.millisecond*1000/16777216) end def self.read(packet)