-
Notifications
You must be signed in to change notification settings - Fork 994
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4516 from sysown/v2.x_240421
Various code split for more readibility
- Loading branch information
Showing
31 changed files
with
3,157 additions
and
3,440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef CLASS_GTID_Server_Data_H | ||
#define CLASS_GTID_Server_Data_H | ||
class GTID_Server_Data { | ||
public: | ||
char *address; | ||
uint16_t port; | ||
uint16_t mysql_port; | ||
char *data; | ||
size_t len; | ||
size_t size; | ||
size_t pos; | ||
struct ev_io *w; | ||
char uuid_server[64]; | ||
unsigned long long events_read; | ||
gtid_set_t gtid_executed; | ||
bool active; | ||
GTID_Server_Data(struct ev_io *_w, char *_address, uint16_t _port, uint16_t _mysql_port); | ||
void resize(size_t _s); | ||
~GTID_Server_Data(); | ||
bool readall(); | ||
bool writeout(); | ||
bool read_next_gtid(); | ||
bool gtid_exists(char *gtid_uuid, uint64_t gtid_trxid); | ||
void read_all_gtids(); | ||
void dump(); | ||
}; | ||
#endif // CLASS_GTID_Server_Data_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef CLASS_MySQL_Prepared_Stmt_info_H | ||
#define CLASS_MySQL_Prepared_Stmt_info_H | ||
class MySQL_Prepared_Stmt_info { | ||
public: | ||
uint32_t statement_id; | ||
uint16_t num_columns; | ||
uint16_t num_params; | ||
uint16_t warning_count; | ||
uint16_t pending_num_columns; | ||
uint16_t pending_num_params; | ||
MySQL_Prepared_Stmt_info(unsigned char *pkt, unsigned int length) { | ||
pkt += 5; | ||
statement_id = CPY4(pkt); | ||
pkt += sizeof(uint32_t); | ||
num_columns = CPY2(pkt); | ||
pkt += sizeof(uint16_t); | ||
num_params = CPY2(pkt); | ||
pkt += sizeof(uint16_t); | ||
pkt++; // reserved_1 | ||
warning_count = CPY2(pkt); | ||
pending_num_columns=num_columns; | ||
pending_num_params=num_params; | ||
} | ||
}; | ||
#endif // CLASS_MySQL_Prepared_Stmt_info_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef CLASS_MySQL_encode_H | ||
#define CLASS_MySQL_encode_H | ||
#ifdef DEBUG | ||
void __dump_pkt(const char *func, unsigned char *_ptr, unsigned int len); | ||
#endif // DEBUG | ||
char *sha1_pass_hex(char *sha1_pass); | ||
double proxy_my_rnd(struct rand_struct *rand_st); | ||
void proxy_create_random_string(char *_to, uint length, struct rand_struct *rand_st); | ||
int write_encoded_length(unsigned char *p, uint64_t val, uint8_t len, char prefix); | ||
int write_encoded_length_and_string(unsigned char *p, uint64_t val, uint8_t len, char prefix, char *string); | ||
void proxy_compute_sha1_hash_multi(uint8_t *digest, const char *buf1, int len1, const char *buf2, int len2); | ||
void proxy_compute_sha1_hash(uint8_t *digest, const char *buf, int len); | ||
void proxy_compute_two_stage_sha1_hash(const char *password, size_t pass_len, uint8_t *hash_stage1, uint8_t *hash_stage2); | ||
void proxy_my_crypt(char *to, const uint8_t *s1, const uint8_t *s2, uint len); | ||
unsigned char decode_char(char x); | ||
void unhex_pass(uint8_t *out, const char *in); | ||
void proxy_scramble(char *to, const char *message, const char *password); | ||
bool proxy_scramble_sha1(char *pass_reply, const char *message, const char *sha1_sha1_pass, char *sha1_pass); | ||
unsigned int CPY3(unsigned char *ptr); | ||
uint64_t CPY8(unsigned char *ptr); | ||
uint8_t mysql_encode_length(uint64_t len, char *hd); | ||
#endif // CLASS_MySQL_encode_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef CLASS_QR_RULE_H | ||
#define CLASS_QR_RULE_H | ||
|
||
#define QP_RE_MOD_CASELESS 1 | ||
#define QP_RE_MOD_GLOBAL 2 | ||
|
||
class QP_rule_text_hitsonly { | ||
public: | ||
char **pta; | ||
QP_rule_text_hitsonly(QP_rule_t *QPr); | ||
~QP_rule_text_hitsonly(); | ||
}; | ||
|
||
class QP_rule_text { | ||
public: | ||
char **pta; | ||
int num_fields; | ||
QP_rule_text(QP_rule_t *QPr); | ||
~QP_rule_text(); | ||
}; | ||
|
||
#endif // CLASS_QR_RULE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#ifndef PROXYSQL_COMMON_TYPEDEF | ||
#define PROXYSQL_COMMON_TYPEDEF | ||
typedef std::unordered_map<std::uint64_t, void *> umap_query_digest; | ||
typedef std::unordered_map<std::uint64_t, char *> umap_query_digest_text; | ||
#endif // PROXYSQL_COMMON_TYPEDEF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.