diff --git a/include/mysql.hpp b/include/mysql.hpp index e39a3d08..80f47f33 100644 --- a/include/mysql.hpp +++ b/include/mysql.hpp @@ -177,8 +177,13 @@ class mysql { param.buffer = const_cast(static_cast(&value)); } else if constexpr (std::is_arithmetic_v) { - param.buffer_type = - (enum_field_types)ormpp_mysql::type_to_id(identity{}); + if constexpr (std::is_same_v) { + param.buffer_type = MYSQL_TYPE_TINY; + } + else { + param.buffer_type = + (enum_field_types)ormpp_mysql::type_to_id(identity{}); + } param.buffer = const_cast(static_cast(&value)); } else if constexpr (std::is_same_v) { @@ -214,8 +219,13 @@ class mysql { param_bind.buffer = const_cast(static_cast(&value)); } else if constexpr (std::is_arithmetic_v) { - param_bind.buffer_type = - (enum_field_types)ormpp_mysql::type_to_id(identity{}); + if constexpr (std::is_same_v) { + param_bind.buffer_type = MYSQL_TYPE_TINY; + } + else { + param_bind.buffer_type = + (enum_field_types)ormpp_mysql::type_to_id(identity{}); + } param_bind.buffer = const_cast(static_cast(&value)); } else if constexpr (std::is_same_v) { diff --git a/include/type_mapping.hpp b/include/type_mapping.hpp index fa153770..76995718 100644 --- a/include/type_mapping.hpp +++ b/include/type_mapping.hpp @@ -32,7 +32,6 @@ struct identity {}; #ifdef ORMPP_ENABLE_MYSQL namespace ormpp_mysql { -REGISTER_TYPE(bool, MYSQL_TYPE_BOOL) REGISTER_TYPE(char, MYSQL_TYPE_TINY) REGISTER_TYPE(short, MYSQL_TYPE_SHORT) REGISTER_TYPE(int, MYSQL_TYPE_LONG)