Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysqlpp::Query updateQuery = this->getQuery();
- updateQuery << "INSERT INTO `database_backendsocket` ( `database` , `backend` ) VALUES ( ( SELECT DISTINCT `database`.`id` FROM `database` WHERE `database`.`inetaddress` = 'localhost' ) , ( SELECT DISTINCT `backend`.`id` FROM `backend` WHERE `backend`.`inetaddress` = " << mysqlpp::quote << serverGuardian->GetSockAddress() << " ) );";
- try {
- if( ( updateQuery.execute() ).rows() == 1 ) {
- return "valid";
- }
- else
- {
- return "invalid";
- }
- }
- catch( const mysqlpp::BadQuery &exception ) {
- this->addWarningToLog( std::string( exception.what() ) + " using query: " + updateQuery.str() );
- return "invalid";
- }
- catch( const mysqlpp::Exception &exception ) {
- this->addErrorToLog( std::string( exception.what() ) + " using query: " + updateQuery.str() );
- return "invalid";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement