Removed last_insert_id from PostgreSQL modules

v3.0_extended_query_protocol
Rahim Kanji 9 months ago
parent d29bf8c236
commit 026f458f7c

@ -30,7 +30,6 @@ class PgSQL_Event {
bool have_rows_sent;
uint64_t affected_rows;
uint64_t last_insert_id;
uint64_t rows_sent;
uint32_t client_stmt_id;
@ -44,7 +43,7 @@ class PgSQL_Event {
void set_query(const char *ptr, int len);
void set_server(int _hid, const char *ptr, int len);
void set_extra_info(char *);
void set_affected_rows(uint64_t ar, uint64_t lid);
void set_affected_rows(uint64_t ar);
void set_rows_sent(uint64_t rs);
};

@ -163,10 +163,8 @@ public:
bool bool_is_select_NOT_for_update_computed;
bool have_affected_rows; // if affected rows is set, last_insert_id is set too
uint64_t affected_rows;
uint64_t last_insert_id;
uint64_t rows_sent;
uint64_t waiting_since;
std::string show_warnings_prev_query_digest;
PgSQL_Query_Info();
~PgSQL_Query_Info();

@ -58,7 +58,6 @@ PgSQL_Event::PgSQL_Event (log_event_type _et, uint32_t _thread_id, char * _usern
extra_info = NULL;
have_affected_rows=false;
affected_rows=0;
last_insert_id = 0;
have_rows_sent=false;
rows_sent=0;
client_stmt_id=0;
@ -70,10 +69,9 @@ void PgSQL_Event::set_client_stmt_id(uint32_t client_stmt_id) {
// if affected rows is set, last_insert_id is set too.
// They are part of the same OK packet
void PgSQL_Event::set_affected_rows(uint64_t ar, uint64_t lid) {
void PgSQL_Event::set_affected_rows(uint64_t ar) {
have_affected_rows=true;
affected_rows=ar;
last_insert_id=lid;
}
void PgSQL_Event::set_rows_sent(uint64_t rs) {
@ -270,7 +268,6 @@ uint64_t PgSQL_Event::write_query_format_1(std::fstream *f) {
total_bytes+=mysql_encode_length(end_time,NULL);
total_bytes+=mysql_encode_length(client_stmt_id,NULL);
total_bytes+=mysql_encode_length(affected_rows,NULL);
total_bytes+=mysql_encode_length(last_insert_id,NULL); // as in MySQL Protocol, last_insert_id is immediately after affected_rows
total_bytes+=mysql_encode_length(rows_sent,NULL);
total_bytes+=mysql_encode_length(query_digest,NULL);
@ -337,10 +334,6 @@ uint64_t PgSQL_Event::write_query_format_1(std::fstream *f) {
write_encoded_length(buf,affected_rows,len,buf[0]);
f->write((char *)buf,len);
len=mysql_encode_length(last_insert_id,buf);
write_encoded_length(buf,last_insert_id,len,buf[0]);
f->write((char *)buf,len);
len=mysql_encode_length(rows_sent,buf);
write_encoded_length(buf,rows_sent,len,buf[0]);
f->write((char *)buf,len);
@ -405,9 +398,6 @@ uint64_t PgSQL_Event::write_query_format_2_json(std::fstream *f) {
// rows_affected is logged also if 0, while
// last_insert_id is log logged if 0
j["rows_affected"] = affected_rows;
if (last_insert_id != 0) {
j["last_insert_id"] = last_insert_id;
}
}
if (have_rows_sent == true) {
j["rows_sent"] = rows_sent;
@ -751,7 +741,7 @@ void PgSQL_Logger::log_request(PgSQL_Session *sess, PgSQL_Data_Stream *myds) {
}
if (sess->CurrentQuery.have_affected_rows) {
me.set_affected_rows(sess->CurrentQuery.affected_rows, sess->CurrentQuery.last_insert_id);
me.set_affected_rows(sess->CurrentQuery.affected_rows);
}
me.set_rows_sent(sess->CurrentQuery.rows_sent);

@ -310,7 +310,6 @@ PgSQL_Query_Info::PgSQL_Query_Info() {
have_affected_rows=false; // if affected rows is set, last_insert_id is set too
waiting_since = 0;
affected_rows=0;
last_insert_id = 0;
rows_sent=0;
start_time=0;
end_time=0;
@ -344,7 +343,6 @@ void PgSQL_Query_Info::begin(unsigned char *_p, int len, bool header) {
have_affected_rows=false; // if affected rows is set, last_insert_id is set too
waiting_since = 0;
affected_rows=0;
last_insert_id = 0;
rows_sent=0;
stmt_client_id=0;
}
@ -380,7 +378,6 @@ void PgSQL_Query_Info::init(unsigned char *_p, int len, bool header) {
have_affected_rows=false; // if affected rows is set, last_insert_id is set too
waiting_since = 0;
affected_rows=0;
last_insert_id = 0;
rows_sent=0;
}

Loading…
Cancel
Save