Fix the bug of sequence currval session self-verification failure

This commit is contained in:
hwx65
2024-01-10 10:16:11 +00:00
committed by ob-robot
parent 893dcea8e1
commit 3dc90a8451
3 changed files with 119 additions and 58 deletions

View File

@ -264,8 +264,9 @@ public:
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos) = 0;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess)= 0;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length) = 0;
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length) = 0;
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) = 0;
bool is_changed_;
@ -280,8 +281,9 @@ public:
int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const;
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length);
int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length);
int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length);
};
@ -295,8 +297,9 @@ public:
int get_serialize_size(ObSQLSessionInfo& sess, int64_t &length) const;
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos);
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length);
int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length);
int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length);
int set_client_info(ObSQLSessionInfo* sess, const ObString &client_info);
@ -324,8 +327,9 @@ public:
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length);
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length);
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length);
};
@ -339,8 +343,9 @@ public:
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length);
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length);
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length);
};
@ -354,10 +359,15 @@ public:
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length) override;
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length) override;
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override;
template <bool cmp_only>
int cmp_display_sess_info_helper(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length, bool &found_mismatch);
};
class ObControlInfoEncoder : public ObSessInfoEncoder {
@ -370,8 +380,9 @@ public:
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf,
const int64_t length, int64_t &pos);
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess);
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length);
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length);
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length);
static const int16_t CONINFO_BY_SESS = 0xC078;
@ -389,8 +400,9 @@ public:
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length) override;
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length) override;
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override;
};
@ -404,8 +416,9 @@ public:
virtual int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override;
virtual int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override;
virtual int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override;
virtual int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length,
const char* last_sess_buf, int64_t last_sess_length) override;
virtual int compare_sess_info(ObSQLSessionInfo &sess, const char *current_sess_buf,
int64_t current_sess_length, const char *last_sess_buf,
int64_t last_sess_length) override;
virtual int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf,
int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override;
};
@ -418,7 +431,7 @@ public: \
int get_serialize_size(ObSQLSessionInfo &sess, int64_t &length) const override; \
int fetch_sess_info(ObSQLSessionInfo &sess, char *buf, const int64_t length, int64_t &pos) override; \
int64_t get_fetch_sess_info_size(ObSQLSessionInfo& sess) override; \
int compare_sess_info(const char* current_sess_buf, int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override; \
int compare_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf, int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override; \
int display_sess_info(ObSQLSessionInfo &sess, const char* current_sess_buf, int64_t current_sess_length, const char* last_sess_buf, int64_t last_sess_length) override; \
};
DEF_SESSION_TXN_ENCODER(ObTxnStaticInfoEncoder);