This commit is contained in:
xx
2025-03-28 23:04:36 +08:00
parent 8275b54d7a
commit 9c50b4dfec

View File

@@ -606,11 +606,19 @@ bool module::mysql_result::next()
sol::object module::mysql_result::get(sol::object obj, sol::this_state s)
{
std::string tmp_log;
std::string type;
if (obj.get_type() == sol::type::string)
{
tmp_log = "[string]=" + obj.as<std::string>();
type = m_result->field_type(obj.as<std::string>());
}
else if (obj.get_type() == sol::type::number)
{
tmp_log = "[int]=" + std::to_string(obj.as<int>());
type = m_result->field_type(obj.as<int>());
}
#define GET_VALUE(FUNCTION) \
if (obj.get_type() == sol::type::string) \
@@ -618,7 +626,7 @@ sol::object module::mysql_result::get(sol::object obj, sol::this_state s)
else if (obj.get_type() == sol::type::number) \
return sol::make_object(s, m_result->FUNCTION(obj.as<uint32>()))
std::cout << "[string]:"<< obj.as<std::string>()<<"|"<<"[int]:"<< obj.as<int>()<<"=====" << type << std::endl;
std::cout << tmp_log <<"=====" << type << std::endl;
if (type == "int" || type == "tinyint unsigned")
{
GET_VALUE(get_int32);