Ask Your Question
0

Mysql 연결에서 col__Object_id를 가져오는 방법

asked 2018-03-06 21:29:04 +0900

casper7609 gravatar image

updated 2018-03-06 21:30:37 +0900

안녕하세요. 아래와 같이 col__Object_id를 가져오려 하는데 서버가 크래쉬 납니다. 추측하기로는 blob를 getstring으로 불러오면서 뭔가 문제가 생기는것 같습니다만 잘 모르겠네요 ㅎㅎ

Mariadb.Error error; string query = "SELECT * FROM tb_Object_User;"; ResultSets resultSet = connection.ExecuteQuerySync (query, out error); if (error.Code != 0) { Log.Info ("Error: code={0}, desc={1}", error.Code, error.Desc); } // As many as SELECT queries. while (resultSet.SeekNextResultSet ()) { Log.Info ("=====================");

                // As many as result rows of each query.
                while (resultSet.SeekNextRow ()) {
                    Log.Info ("No: {0}", resultSet.GetString (0));  // 또는 GetInt("No")
                }
            }

에러 로그는 다음과 같습니다.

F0306 21:25:43.855913 68758 types.cc:745] Assert failed: mono_string: * Check failure stack trace: * E0306 21:25:43.857718 68758 framework.cc:54] System has been crashed. (Event=, 1.0.0-2525trusty) E0306 21:25:43.857821 68758 framework.cc:64] Shutdown AccountManager. E0306 21:25:43.857856 68758 framework.cc:64] Shutdown EventDispatcher. E0306 21:25:43.858211 68758 framework.cc:64] Shutdown ObjectTransaction. E0306 21:25:43.858325 68758 framework.cc:64] Shutdown ObjectDatabase. I0306 21:25:43.858366 68758 object_database.cc:3599] Flushing 0 update queries /usr/share/funapi/bash/launcher-common.sh: line 89: 68731 Segmentation fault (core dumped) $fork_prefix $FUNAPI_BIN_DIR/funapi_runner $args $@ grep: write error: Broken pipe [ERROR] infinite_slayers_server@ubuntu termianted with 139.

Analyzing crashdump /home/casper7609/infinite_slayers-source/mono/bin/Debug/buildcpp/dumps/426c3996-1204-3371-75b50fbc-6436df25.dmp

OS Linux 0.0.0 Linux 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 CPU amd64 family 6 model 60 stepping 3 1 Crash SIGSEGV 0x40 18

0 libglog.so.0.0.0 (+0x10dbe) 1 (+0x7fb4b002d8b0) 2 libglog.so.0.0.0 (+0x10ce4) 3 libglog.so.0.0.0 (+0x11112) 4 libglog.so.0.0.0 (+0x106e6) 5 libglog.so.0.0.0 (+0x104fb) 6 funapi_runner: fun::GetMonoStringFromString(std::string const&) (+0x98) 7 funapi_runner: fun::engine_lib::ResultSets_GetStringByIndex(void, unsigned long) (+0x43) 8 (+0x400b4934) 9 (+0x400b2cfd) 10 (+0x400b30ec) 11 (+0x400b3254) 12 (+0x400b2a58) 13 (+0x400b2bfe) 14 (+0x400b2623) 15 libmonosgen-2.0.so.1.0.0 (+0x3b318) 16 libmonosgen-2.0.so.1.0.0 (+0x1d9ded) 17 funapi_runner: fun::InvokeMonoDelegate(MonoObject, void) (+0x25) 18 funapi_runner: fun::InvokeMonoDelegateOnObjectTransaction(MonoObject, void) (+0x29) 19 funapi_runner: fun::engine_lib::ApiService_ResponseWriter_Write(void, fun::funapi_http_Response) (+0x113f) 20 funapi_runner: boost::function2<void, unsigned="" long="" const&amp;,="" long="" const&amp;&gt;::clear()="" (+0x32)="" 21="" funapi_runner:="" fun::rawtimerimpl::createtimer(long="" const&amp;,="" long="" const&amp;,="" boost::function<void="" (unsigned="" long="" const&amp;,="" long="" const&amp;)&gt;="" const&amp;,="" bool,="" bool)="" (+0x3a4)="" 22="" libstdc++.so.6.0.19="" (+0x5d1c8)="" 23="" funapi_runner:="" boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<boost::_bi::unspecified,="" boost::function<void="" (fun::http::request2="" const&amp;,="" boost::match_results<__gnu_cxx::__normal_iterator<char="" const*,="" std::string="">, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,="" std::string=""> > > > const&, boost::function<void (boost::shared_ptr<fun::http::response=""> const&)> const&)>, boost::_bi::list3<boost::_bi::value<fun::http::request2>, boost::_bi::value<boost::match_results<__gnu_cxx::__normal_iterator<char const*,="" std::string="">, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,="" std::string=""> > > > >, boost::_bi::value<boost::function<void (boost::shared_ptr<fun::http::response=""> const&)> > > >, void>::invoke(boost::detail::function::function_buffer&) (+0x31) 24 funapi_runner: fun::NullEvent::OnNullEvent(boost::shared_ptr<fun ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-03-07 09:20:34 +0900

Jinuk gravatar image

해당 값은 BLOB인데 문자열로 가져오려고 해서 크래시합니다. 아이펀엔진에 포함된 ResultSet 인터페이스가 GetBlob 에 해당하는 부분이 없어서 현재는 col__Object_Id_ 를 바로 가져오지는 못합니다. 우회적으로 다음과 같이 해결할 수 있습니다.

  1. ORM을 사용해서 접근한 후, GetID 를 하면 boost::uuid 형식으로 object_id 를 반환합니다.
  2. SELECT 를 HEX(col__Object_Id_) 를 하면 GetString() 으로 가져올 수 있습니다.
edit flag offensive delete link more

Comments

오...현재 1번 방법을 쓰고있었는데 2번 방법이 더 멋진것 같네요! 좋은 답변 감사드립니다!

casper7609 gravatar imagecasper7609 ( 2018-03-08 20:10:07 +0900 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-03-06 21:29:04 +0900

Seen: 53 times

Last updated: Mar 07