update MySQLMessage api

This commit is contained in:
holmes1412
2021-05-19 16:35:36 +08:00
parent fa3cdfa2e2
commit 99b80c74e8
2 changed files with 7 additions and 10 deletions

View File

@@ -358,9 +358,15 @@ unsigned long long MySQLResponse::get_affected_rows() const
// return array api
unsigned long long MySQLResponse::get_last_insert_id() const
{
unsigned long long insert_id = 0;
MySQLResultCursor cursor(this);
return cursor.get_insert_id();
do {
if (cursor.get_insert_id())
insert_id = cursor.get_insert_id();
} while (cursor.next_result_set());
return insert_id;
}
int MySQLResponse::get_warnings() const
@@ -375,14 +381,6 @@ int MySQLResponse::get_warnings() const
return warning_count;
}
// return array api
int MySQLResponse::get_status_flags() const
{
MySQLResultCursor cursor(this);
return cursor.get_server_status();
}
std::string MySQLResponse::get_info() const
{
std::string info;

View File

@@ -96,7 +96,6 @@ public:
unsigned long long get_affected_rows() const;
unsigned long long get_last_insert_id() const;
int get_warnings() const;
int get_status_flags() const;
int get_error_code() const;
std::string get_error_msg() const;
std::string get_sql_state() const;