![]()  | 
  
    MySQL 8.4.7
    
   Source Code Documentation 
   | 
 
Plugin service that provides access to the parser and some operations on the parse tree. More...
Go to the source code of this file.
Classes | |
| struct | mysql_parser_service_st | 
Macros | |
| #define | MYSQL_THD THD * | 
| #define | PARSER_SERVICE_DIGEST_LENGTH 32 | 
| #define | STATEMENT_TYPE_SELECT 1 | 
| #define | STATEMENT_TYPE_UPDATE 2 | 
| #define | STATEMENT_TYPE_INSERT 3 | 
| #define | STATEMENT_TYPE_DELETE 4 | 
| #define | STATEMENT_TYPE_REPLACE 5 | 
| #define | STATEMENT_TYPE_OTHER 6 | 
Typedefs | |
| typedef Item * | MYSQL_ITEM | 
| typedef int(* | parse_node_visit_function) (MYSQL_ITEM item, unsigned char *arg) | 
| typedef int(* | sql_condition_handler_function) (int sql_errno, const char *sqlstate, const char *msg, void *state) | 
| typedef MYSQL_THD(* | mysql_current_session_t) () | 
| typedef MYSQL_THD(* | mysql_open_session_t) () | 
| typedef void(* | mysql_start_thread_t) (MYSQL_THD thd, void *(*callback_fun) (void *), void *arg, struct my_thread_handle *thread_handle) | 
| typedef void(* | mysql_join_thread_t) (struct my_thread_handle *thread_handle) | 
| typedef void(* | mysql_set_current_database_t) (MYSQL_THD thd, const MYSQL_LEX_STRING db) | 
| typedef int(* | mysql_parse_t) (MYSQL_THD thd, const MYSQL_LEX_STRING query, unsigned char is_prepared, sql_condition_handler_function handle_condition, void *condition_handler_state) | 
| Parses the query.  More... | |
| typedef int(* | mysql_get_statement_type_t) (MYSQL_THD thd) | 
| typedef int(* | mysql_get_statement_digest_t) (MYSQL_THD thd, unsigned char *digest) | 
| Returns the digest of the last parsed statement in the session.  More... | |
| typedef int(* | mysql_get_number_params_t) (MYSQL_THD thd) | 
| Returns the number of parameters ('?') in the parsed query.  More... | |
| typedef int(* | mysql_extract_prepared_params_t) (MYSQL_THD thd, int *positions) | 
| Stores in 'positions' the positions in the last parsed query of each parameter marker('?').  More... | |
| typedef int(* | mysql_visit_tree_t) (MYSQL_THD thd, parse_node_visit_function processor, unsigned char *arg) | 
| Walks the tree depth first and applies a user defined function on each literal.  More... | |
| typedef MYSQL_LEX_STRING(* | mysql_item_string_t) (MYSQL_ITEM item) | 
| Renders the MYSQL_ITEM as a string and returns a reference in the form of a MYSQL_LEX_STRING.  More... | |
| typedef void(* | mysql_free_string_t) (MYSQL_LEX_STRING string) | 
| Frees a string buffer allocated by the server.  More... | |
| typedef MYSQL_LEX_STRING(* | mysql_get_query_t) (MYSQL_THD thd) | 
| Returns the current query string.  More... | |
| typedef MYSQL_LEX_STRING(* | mysql_get_normalized_query_t) (MYSQL_THD thd) | 
| Returns the current query in normalized form.  More... | |
| typedef void *(* | callback_function) (void *) | 
Variables | |
| struct mysql_parser_service_st * | mysql_parser_service | 
Plugin service that provides access to the parser and some operations on the parse tree.
| #define MYSQL_THD THD * | 
| #define PARSER_SERVICE_DIGEST_LENGTH 32 | 
| #define STATEMENT_TYPE_DELETE 4 | 
| #define STATEMENT_TYPE_INSERT 3 | 
| #define STATEMENT_TYPE_OTHER 6 | 
| #define STATEMENT_TYPE_REPLACE 5 | 
| #define STATEMENT_TYPE_SELECT 1 | 
| #define STATEMENT_TYPE_UPDATE 2 | 
| typedef void *(* callback_function) (void *) | 
| typedef MYSQL_THD(* mysql_current_session_t) () | 
| typedef int(* mysql_extract_prepared_params_t) (MYSQL_THD thd, int *positions) | 
Stores in 'positions' the positions in the last parsed query of each parameter marker('?').
Positions must be an already allocated array of at least mysql_parser_service_st::mysql_get_number_params() size. This works only if the last query was parsed as a prepared statement.
| thd | The session in which the query was parsed. | 
| positions | An already allocated array of at least mysql_parser_service_st::mysql_get_number_params() size. | 
| typedef void(* mysql_free_string_t) (MYSQL_LEX_STRING string) | 
Frees a string buffer allocated by the server.
| string | The string whose buffer will be freed. | 
| typedef MYSQL_LEX_STRING(* mysql_get_normalized_query_t) (MYSQL_THD thd) | 
Returns the current query in normalized form.
This string is managed by the server and should not be freed by a plugin.
| thd | The session in which the query was submitted. | 
| typedef int(* mysql_get_number_params_t) (MYSQL_THD thd) | 
Returns the number of parameters ('?') in the parsed query.
This works only if the last query was parsed as a prepared statement.
| thd | The session in which the query was parsed. | 
| typedef MYSQL_LEX_STRING(* mysql_get_query_t) (MYSQL_THD thd) | 
Returns the current query string.
This string is managed by the server and should not be freed by a plugin.
| thd | The session in which the query was submitted. | 
| typedef int(* mysql_get_statement_digest_t) (MYSQL_THD thd, unsigned char *digest) | 
Returns the digest of the last parsed statement in the session.
| thd | The session in which the statement was parsed. | |
| [out] | digest | An area of at least size PARSER_SERVICE_DIGEST_LENGTH, where the digest is written. | 
| 0 | Success. | 
| 1 | Parse error. | 
| typedef int(* mysql_get_statement_type_t) (MYSQL_THD thd) | 
| typedef Item* MYSQL_ITEM | 
| typedef MYSQL_LEX_STRING(* mysql_item_string_t) (MYSQL_ITEM item) | 
Renders the MYSQL_ITEM as a string and returns a reference in the form of a MYSQL_LEX_STRING.
The string buffer is allocated by the server and must be freed by mysql_free_string().
| item | The literal to print. | 
| typedef void(* mysql_join_thread_t) (struct my_thread_handle *thread_handle) | 
| typedef MYSQL_THD(* mysql_open_session_t) () | 
| typedef int(* mysql_parse_t) (MYSQL_THD thd, const MYSQL_LEX_STRING query, unsigned char is_prepared, sql_condition_handler_function handle_condition, void *condition_handler_state) | 
Parses the query.
| thd | The session in which to parse. | 
| query | The query to parse. | 
| is_prepared | If non-zero, the query will be parsed as a prepared statement and won't throw errors when the query string contains '?'. | 
| handle_condition | Callback function that is called if a condition is raised during the preparation, parsing or cleanup after parsing. If this argument is non-NULL, the diagnostics area will be cleared before this function returns. | 
| condition_handler_state | Will be passed to handle_condition when called. Otherwise ignored. | 
| 0 | Success. | 
| 1 | Parse error. | 
| typedef void(* mysql_set_current_database_t) (MYSQL_THD thd, const MYSQL_LEX_STRING db) | 
| typedef void(* mysql_start_thread_t) (MYSQL_THD thd, void *(*callback_fun)(void *), void *arg, struct my_thread_handle *thread_handle) | 
| typedef int(* mysql_visit_tree_t) (MYSQL_THD thd, parse_node_visit_function processor, unsigned char *arg) | 
Walks the tree depth first and applies a user defined function on each literal.
| thd | The session in which the query was parsed. | 
| processor | Will be called for each literal in the parse tree. | 
| arg | Will be passed as argument to each call to 'processor'. | 
| typedef int(* parse_node_visit_function) (MYSQL_ITEM item, unsigned char *arg) | 
| typedef int(* sql_condition_handler_function) (int sql_errno, const char *sqlstate, const char *msg, void *state) | 
| MYSQL_THD mysql_parser_current_session | ( | ) | 
| int mysql_parser_extract_prepared_params | ( | MYSQL_THD | thd, | 
| int * | positions | ||
| ) | 
| void mysql_parser_free_string | ( | MYSQL_LEX_STRING | string | ) | 
| MYSQL_LEX_STRING mysql_parser_get_normalized_query | ( | MYSQL_THD | thd | ) | 
| int mysql_parser_get_number_params | ( | MYSQL_THD | thd | ) | 
| MYSQL_LEX_STRING mysql_parser_get_query | ( | MYSQL_THD | thd | ) | 
| int mysql_parser_get_statement_digest | ( | MYSQL_THD | thd, | 
| unsigned char * | digest | ||
| ) | 
| int mysql_parser_get_statement_type | ( | MYSQL_THD | thd | ) | 
| MYSQL_LEX_STRING mysql_parser_item_string | ( | MYSQL_ITEM | item | ) | 
| void mysql_parser_join_thread | ( | struct my_thread_handle * | thread_handle | ) | 
| MYSQL_THD mysql_parser_open_session | ( | ) | 
| int mysql_parser_parse | ( | MYSQL_THD | thd, | 
| const MYSQL_LEX_STRING | query, | ||
| unsigned char | is_prepared, | ||
| sql_condition_handler_function | handle_condition, | ||
| void * | condition_handler_state | ||
| ) | 
| void mysql_parser_set_current_database | ( | MYSQL_THD | thd, | 
| const MYSQL_LEX_STRING | db | ||
| ) | 
| void mysql_parser_start_thread | ( | MYSQL_THD | thd, | 
| callback_function | fun, | ||
| void * | arg, | ||
| struct my_thread_handle * | thread_handle | ||
| ) | 
| int mysql_parser_visit_tree | ( | MYSQL_THD | thd, | 
| parse_node_visit_function | processor, | ||
| unsigned char * | arg | ||
| ) | 
| struct mysql_parser_service_st * mysql_parser_service |