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

Method GetFieldName

IO/MySQL/vtkMySQLQuery.cxx:621–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619//------------------------------------------------------------------------------
620
621const char* vtkMySQLQuery::GetFieldName(int column)
622{
623 if (!this->Active)
624 {
625 vtkErrorMacro(<< "GetFieldName(): Query is not active!");
626 return nullptr;
627 }
628 else if (column < 0 || column >= this->GetNumberOfFields())
629 {
630 vtkErrorMacro(<< "GetFieldName(): Illegal field index " << column);
631 return nullptr;
632 }
633 else
634 {
635 MYSQL_FIELD* field = mysql_fetch_field_direct(this->Internals->Result, column);
636 if (field == nullptr)
637 {
638 vtkErrorMacro(<< "GetFieldName(): MySQL returned null field for column " << column);
639 return nullptr;
640 }
641 else
642 {
643 return field->name;
644 }
645 }
646}
647
648//------------------------------------------------------------------------------
649

Callers 1

TestMySQLDatabaseFunction · 0.45

Calls 1

GetNumberOfFieldsMethod · 0.95

Tested by 1

TestMySQLDatabaseFunction · 0.36