Make DB_BASE::insert_id() correctly return numbers exceeding 32bits

This commit is contained in:
Rytis Slatkevičius 2021-03-24 14:30:18 +02:00
parent bdae15bce6
commit 75b7b640f6
2 changed files with 3 additions and 3 deletions

View File

@ -153,7 +153,7 @@ int DB_CONN::affected_rows() {
return (int)x;
}
int DB_CONN::insert_id() {
DB_ID_TYPE DB_CONN::insert_id() {
int retval;
MYSQL_ROW row;
MYSQL_RES* rp;
@ -162,7 +162,7 @@ int DB_CONN::insert_id() {
if (retval) return retval;
rp = mysql_store_result(mysql);
row = mysql_fetch_row(rp);
int x = atoi(row[0]);
DB_ID_TYPE x = atol(row[0]);
mysql_free_result(rp);
return x;
}

View File

@ -71,7 +71,7 @@ public:
int do_query(const char*);
int affected_rows();
void close();
int insert_id();
DB_ID_TYPE insert_id();
void print_error(const char*);
const char* error_string();
int ping();