Skip to content

Commit

Permalink
Added missing e.getSQLState() on mysql error log output
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianopteodoro committed Jul 24, 2015
1 parent 6169b34 commit e91ea91
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions BaseLib/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Database::Database()
driver = get_driver_instance();
driver->threadInit();
} catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
}

Expand All @@ -22,7 +22,7 @@ Database::~Database()
driver->threadEnd();
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
}

Expand All @@ -43,7 +43,7 @@ bool Database::Connect(char* host, char* database, char* user, char* password, i
return false;
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
return false;
}
Expand All @@ -57,7 +57,7 @@ bool Database::ChangeDB(char* db)
return true;
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
return false;
}
Expand All @@ -76,7 +76,7 @@ bool Database::ExecuteQuery(char* Format, ...)
return true;
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
return false;
}
Expand All @@ -95,7 +95,7 @@ bool Database::ExecuteSelect(char* Format, ...)
return true;
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
return false;
}
Expand All @@ -114,7 +114,7 @@ bool Database::ExecuteSp(char* Format, ...)
return true;
}
catch (SQLException &e) {
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode());
Logger::Log("# ERROR # %s (MySQL error code: %d SQLState: %s)\n", e.what(), e.getErrorCode(), e.getSQLState());
}
return false;
}
Expand Down

0 comments on commit e91ea91

Please sign in to comment.