------------------------------------------------------------------------------
| 225 | |
| 226 | //------------------------------------------------------------------------------ |
| 227 | vtkStringArray* 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 | |
| 255 | bool vtkMySQLDatabase::HasError() |
| 256 | { |
nothing calls this directly
no test coverage detected