MCPcopy Create free account
hub / github.com/Icinga/icinga2 / FetchRow

Method FetchRow

lib/db_ido_mysql/idomysqlconnection.cpp:736–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736Dictionary::Ptr IdoMysqlConnection::FetchRow(const IdoMysqlResult& result)
737{
738 AssertOnWorkQueue();
739
740 MYSQL_ROW row;
741 MYSQL_FIELD *field;
742 unsigned long *lengths, i;
743
744 row = m_Mysql->fetch_row(result.get());
745
746 if (!row)
747 return nullptr;
748
749 lengths = m_Mysql->fetch_lengths(result.get());
750
751 if (!lengths)
752 return nullptr;
753
754 Dictionary::Ptr dict = new Dictionary();
755
756 m_Mysql->field_seek(result.get(), 0);
757 for (field = m_Mysql->fetch_field(result.get()), i = 0; field; field = m_Mysql->fetch_field(result.get()), i++)
758 dict->Set(field->name, String(row[i], row[i] + lengths[i]));
759
760 return dict;
761}
762
763void IdoMysqlConnection::DiscardRows(const IdoMysqlResult& result)
764{

Callers

nothing calls this directly

Calls 7

fetch_rowMethod · 0.80
fetch_lengthsMethod · 0.80
field_seekMethod · 0.80
fetch_fieldMethod · 0.80
StringClass · 0.50
getMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected