| 594 | } |
| 595 | |
| 596 | bool vtkMySQLDatabase::DropDatabase(const char* dbName) |
| 597 | { |
| 598 | std::string queryStr; |
| 599 | queryStr = "DROP DATABASE IF EXISTS "; |
| 600 | queryStr += dbName; |
| 601 | bool status = false; |
| 602 | char* tmpName = this->DatabaseName; |
| 603 | bool dropSelf = false; |
| 604 | if (!strcmp(dbName, tmpName)) |
| 605 | { |
| 606 | this->Close(); |
| 607 | this->DatabaseName = nullptr; |
| 608 | dropSelf = true; |
| 609 | } |
| 610 | if (this->IsOpen() || this->Open(this->Password)) |
| 611 | { |
| 612 | vtkSQLQuery* query = this->GetQueryInstance(); |
| 613 | query->SetQuery(queryStr.c_str()); |
| 614 | status = query->Execute(); |
| 615 | query->Delete(); |
| 616 | } |
| 617 | if (dropSelf) |
| 618 | { |
| 619 | this->Close(); |
| 620 | this->DatabaseName = tmpName; |
| 621 | } |
| 622 | return status; |
| 623 | } |
| 624 | VTK_ABI_NAMESPACE_END |
no test coverage detected