Merge pull request #182 from Arkshine/fix/mysql-crash-amtl

Fix a mysql crash after CString -> ke::AString conversion
This commit is contained in:
Vincent Herbet 2015-01-18 19:27:35 +01:00
commit 252f1919c2

View File

@ -567,7 +567,8 @@ void AtomicResult::CopyFrom(IResultSet *rs)
{ {
*m_Table[i] = rs->FieldNumToName(i); *m_Table[i] = rs->FieldNumToName(i);
} else { } else {
m_Table[i] = new ke::AString(rs->FieldNumToName(i)); const char* string = rs->FieldNumToName(i);
m_Table[i] = new ke::AString(string ? string : "");
} }
} }
@ -582,7 +583,8 @@ void AtomicResult::CopyFrom(IResultSet *rs)
{ {
*m_Table[idx] = row->GetString(i); *m_Table[idx] = row->GetString(i);
} else { } else {
m_Table[idx] = new ke::AString(row->GetString(i)); const char* string = row->GetString(i);
m_Table[idx] = new ke::AString(string ? string : "");
} }
} }
rs->NextRow(); rs->NextRow();