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

Method DropDatabase

IO/MySQL/vtkMySQLDatabase.cxx:596–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596bool 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}
624VTK_ABI_NAMESPACE_END

Callers 1

CreateDatabaseMethod · 0.95

Calls 8

CloseMethod · 0.95
IsOpenMethod · 0.95
OpenMethod · 0.95
GetQueryInstanceMethod · 0.95
DeleteMethod · 0.65
SetQueryMethod · 0.45
c_strMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected