ResNSel Query::execute(const char* str, size_t len) { if (lock()) { success_ = false; if (throw_exceptions()) { throw LockFailed(); } else { return ResNSel(); } } success_ = !mysql_real_query(&conn_->mysql_, str, len); unlock(); if (success_) { return ResNSel(conn_); } else if (throw_exceptions()) { throw BadQuery(error()); } else { return ResNSel(); } }
//-------------------------------------------------------------------------- ResNSel Connection::execute(const string &str, bool throw_excptns) { Success = false; if (lock()) if (throw_excptns) throw BadQuery(error()); else return ResNSel(); Success = !mysql_query(&mysql, str.c_str()); unlock(); if (!Success) if (throw_excptns) throw BadQuery(error()); else return ResNSel(); return ResNSel(this); }