You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @brief Writes the event data in binary format (format 1) to a file stream.
132
-
* @param f A pointer to the file stream to write to. Must not be NULL.
133
-
* @return The total number of bytes written to the stream.
134
-
*
135
-
* This function serializes the event data into a binary format according to the MySQL event log format 1 specification.
136
-
* It encodes lengths using MySQL's length encoding scheme.
137
-
* The function writes the event type, thread ID, username, schema name, client address, hostgroup ID (if available), server address (if available), timestamps, client statement ID (if applicable), affected rows, last insert ID, rows sent, query digest, and query string to the file stream.
138
-
* The function writes all fields as defined by the MySQL event log format.
139
-
* It handles variable-length fields using MySQL's length encoding, which means that the length of each field is written before the field data itself.
140
-
* The function carefully handles potential errors during file writing operations.
141
-
*/
142
-
uint64_twrite_query_format_1(std::fstream* f);
143
-
144
-
145
-
/**
146
-
* @brief Writes the event data in JSON format (format 2) to a file stream.
147
-
* @param f A pointer to the file stream to write to. Must not be NULL.
148
-
* @return The total number of bytes written to the stream (always 0 in the current implementation).
126
+
* @brief Writes the event data to a LogBuffer.
127
+
* @param f A pointer to LogBuffer to write to.
128
+
* @param sess A pointer to the MySQL_Session object.
129
+
* @return The total number of bytes written.
130
+
*
131
+
* This function writes the event data to the specified LogBuffer based on the event type and the configured log format.
132
+
*/
133
+
uint64_twrite(LogBuffer* f, MySQL_Session* sess);
134
+
135
+
/**
136
+
* @brief Writes the event data in binary format (format 1) to a LogBuffer.
137
+
* @param f A pointer to the LogBuffer to write to.
138
+
* @return The total number of bytes written.
139
+
*
140
+
* This function serializes the event data into a binary format according to the MySQL event log format 1 specification.
141
+
* It encodes lengths using MySQL's length encoding scheme.
142
+
* The function writes the event type, thread ID, username, schema name, client address, hostgroup ID (if available), server address (if available), timestamps, client statement ID (if applicable), affected rows, last insert ID, rows sent, query digest, and query string to the LogBuffer.
143
+
* The function writes all fields as defined by the MySQL event log format.
144
+
* It handles variable-length fields using MySQL's length encoding, which means that the length of each field is written before the field data itself.
145
+
*/
146
+
uint64_twrite_query_format_1(LogBuffer* f);
147
+
148
+
/**
149
+
* @brief Writes the event data in JSON format (format 2) to a LogBuffer.
150
+
* @param f A pointer to the LogBuffer to write to. Must not be NULL.
151
+
* @return The total number of bytes written (always 0 in the current implementation).
149
152
*
150
153
* This function serializes the event data into a JSON format.
151
154
* It converts various data fields into a JSON object and writes this object to the file stream.
152
155
* The function uses the nlohmann::json library for JSON serialization.
153
156
* This function currently always returns 0.
154
157
* The function constructs a JSON object containing relevant event information such as the hostgroup ID, thread ID, event type, username, schema name, client and server addresses, affected rows, last insert ID, rows sent, query string, timestamps, query digest, and client statement ID (if applicable).
155
-
* After constructing the JSON object, it serializes it into a string using the `dump()` method of the nlohmann::json library and writes the resulting string to the output file stream.
158
+
* After constructing the JSON object, it serializes it into a string using the `dump()` method of the nlohmann::json library and writes the resulting string to the LogBuffer.
0 commit comments