diff --git a/hikyuu/utilities/db_connect/mysql/MySQLStatement.cpp b/hikyuu/utilities/db_connect/mysql/MySQLStatement.cpp index 400b6a5..8598f66 100755 --- a/hikyuu/utilities/db_connect/mysql/MySQLStatement.cpp +++ b/hikyuu/utilities/db_connect/mysql/MySQLStatement.cpp @@ -416,7 +416,11 @@ void MySQLStatement::sub_getColumnAsBlob(int idx, std::vector& item) { } try { - item = boost::any_cast>(m_result_buffer[idx]); + unsigned long len = m_result_length[idx]; + std::vector* p = boost::any_cast>(&m_result_buffer[idx]); + item.resize(len); + memcpy(item.data(), p->data(), len); + } catch (...) { HKU_THROW("Field type mismatch! idx: {}", idx); }