List:MySQL++« Previous MessageNext Message »
From:Dmitry Selin Date:April 26 2011 11:45pm
Subject:crash when using blob on empty table
View as plain text  
i have 3 computers under debian (lenny/sqeezy)
and on one of them latest mysql++ crashes when i'm trying to fetch blob data from empty
table

code is smth like this

sql_create_4(filesystem,1,4,sql_int,id,sql_blob, fs, sql_tinyint, full_fs,sql_int, ts);
<------>
SimFSForDB myDatabase::GetSimFS(IDTYPE simid)
{
<------>boost::lock_guard<boost::mutex> guard(m_mutexCon);
<------>if(m_Con.connected())
<------>{
<------><------>try
<------><------>{
<------><------><------>Query query = m_Con.query();
<------><------><------>query<<"SELECT id,fs,full_fs,ts FROM
sim_filesystems WHERE id="<<simid<<" AND status>0";
<------><------><------>UseQueryResult res = query.use(); //
Query::store() executes the query and returns the results.
<------><------><------>if(res)
<------><------><------>{
<------><------><------>    Row r = res.fetch_row();//**
<------><------><------>    if(!r.empty()) //**
<------><------><------>    {
<------><------><------><------>filesystem fss = r;//**
<------><------><------><------>return SimFSForDB(simid,
std::string(fss.fs.data(), fss.fs.size()), fss.full_fs,0, fss.ts);//**
<------><------><------>   }
<------><------><------>}
<------><------><------>std::cout<<"bb\n"<<std::flush;
<------><------>}
<------><------>MYCATCH("GetSimFS")
<------><------><------>std::cout<<"cc\n"<<std::flush;
<------>}
<------>return SimFSForDB();
<------><------><------>std::cout<<"dd\n"<<std::flush;
}


i receive "bb" and "cc" messages and no "dd" message. same for no exception (MYCATCH is
macro for all 3 types of exceptions from examples)

and i receive segmentation fault and no exception ...
i receive segfaul even if i comment out  lines marked with **
i think the problem is in UseQueryResult. 
once i change it too StoreQueryResult and query.use() to query.store() everything works
fine

-- реклама -----------------------------------------------------------
Никогда не покупали в интернете?
Лучшее место для покупок онлайн - http://aukro.ua

Thread
crash when using blob on empty tableDmitry Selin27 Apr
  • Re: crash when using blob on empty tableWarren Young27 Apr