xx 1 rok temu
rodzic
commit
9c50b4dfec
1 zmienionych plików z 9 dodań i 1 usunięć
  1. 9 1
      src/mysql.cpp

+ 9 - 1
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<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);