MCPcopy Create free account
hub / github.com/Kitware/VTK / GetRecord

Method GetRecord

IO/MySQL/vtkMySQLDatabase.cxx:227–253  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

225
226//------------------------------------------------------------------------------
227vtkStringArray* vtkMySQLDatabase::GetRecord(const char* table)
228{
229 vtkStringArray* results = vtkStringArray::New();
230
231 if (!this->IsOpen())
232 {
233 vtkErrorMacro(<< "GetRecord: Database is not open!");
234 return results;
235 }
236
237 MYSQL_RES* record = mysql_list_fields(this->Private->Connection, table, nullptr);
238
239 if (!record)
240 {
241 vtkErrorMacro(<< "GetRecord: MySQL returned error: " << mysql_error(this->Private->Connection));
242 return results;
243 }
244
245 MYSQL_FIELD* field;
246 while ((field = mysql_fetch_field(record)))
247 {
248 results->InsertNextValue(field->name);
249 }
250
251 mysql_free_result(record);
252 return results;
253}
254
255bool vtkMySQLDatabase::HasError()
256{

Callers

nothing calls this directly

Calls 3

IsOpenMethod · 0.95
NewFunction · 0.50
InsertNextValueMethod · 0.45

Tested by

no test coverage detected