correct databend integers types to mysql types
@@ -131,14 +131,14 @@ impl<'a, W: AsyncWrite + Send + Unpin> DFQueryResultWriter<'a, W> {
fn convert_field_type(field: &DataField) -> Result<ColumnType> {
match remove_nullable(field.data_type()).data_type_id() {
- TypeID::Int8 => Ok(ColumnType::MYSQL_TYPE_LONG),
- TypeID::Int16 => Ok(ColumnType::MYSQL_TYPE_LONG),
+ TypeID::Int8 => Ok(ColumnType::MYSQL_TYPE_TINY),
+ TypeID::Int16 => Ok(ColumnType::MYSQL_TYPE_SHORT),
TypeID::Int32 => Ok(ColumnType::MYSQL_TYPE_LONG),
- TypeID::Int64 => Ok(ColumnType::MYSQL_TYPE_LONG),
- TypeID::UInt8 => Ok(ColumnType::MYSQL_TYPE_LONG),
- TypeID::UInt16 => Ok(ColumnType::MYSQL_TYPE_LONG),
+ TypeID::Int64 => Ok(ColumnType::MYSQL_TYPE_LONGLONG),
+ TypeID::UInt8 => Ok(ColumnType::MYSQL_TYPE_TINY),
+ TypeID::UInt16 => Ok(ColumnType::MYSQL_TYPE_SHORT),
TypeID::UInt32 => Ok(ColumnType::MYSQL_TYPE_LONG),
- TypeID::UInt64 => Ok(ColumnType::MYSQL_TYPE_LONG),
+ TypeID::UInt64 => Ok(ColumnType::MYSQL_TYPE_LONGLONG),
TypeID::Float32 => Ok(ColumnType::MYSQL_TYPE_FLOAT),
TypeID::Float64 => Ok(ColumnType::MYSQL_TYPE_DOUBLE),
TypeID::String => Ok(ColumnType::MYSQL_TYPE_VARCHAR),
@@ -146,7 +146,7 @@ impl<'a, W: AsyncWrite + Send + Unpin> DFQueryResultWriter<'a, W> {
TypeID::Date => Ok(ColumnType::MYSQL_TYPE_DATE),
TypeID::Timestamp => Ok(ColumnType::MYSQL_TYPE_DATETIME),
TypeID::Null => Ok(ColumnType::MYSQL_TYPE_NULL),
- TypeID::Interval => Ok(ColumnType::MYSQL_TYPE_LONG),
+ TypeID::Interval => Ok(ColumnType::MYSQL_TYPE_LONGLONG),
TypeID::Array => Ok(ColumnType::MYSQL_TYPE_VARCHAR),
TypeID::Struct => Ok(ColumnType::MYSQL_TYPE_VARCHAR),
TypeID::Variant => Ok(ColumnType::MYSQL_TYPE_VARCHAR),
