From 9c50b4dfecc8b53b48bcf456b084089ec65ca4ef Mon Sep 17 00:00:00 2001 From: xx Date: Fri, 28 Mar 2025 23:04:36 +0800 Subject: [PATCH] BG --- src/mysql.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mysql.cpp b/src/mysql.cpp index ff34cb7..12a1315 100644 --- a/src/mysql.cpp +++ b/src/mysql.cpp @@ -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(); type = m_result->field_type(obj.as()); + } else if (obj.get_type() == sol::type::number) + { + tmp_log = "[int]=" + std::to_string(obj.as()); type = m_result->field_type(obj.as()); + } + #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())) - std::cout << "[string]:"<< obj.as()<<"|"<<"[int]:"<< obj.as()<<"=====" << type << std::endl; + std::cout << tmp_log <<"=====" << type << std::endl; if (type == "int" || type == "tinyint unsigned") { GET_VALUE(get_int32);