|
typedef int(* | start_result_metadata_t) (void *ctx, uint num_cols, uint flags, const CHARSET_INFO *resultcs) |
| Indicates beginning of metadata for the result set. More...
|
|
typedef int(* | field_metadata_t) (void *ctx, struct st_send_field *field, const CHARSET_INFO *charset) |
| Field metadata is provided via this callback. More...
|
|
typedef int(* | end_result_metadata_t) (void *ctx, uint server_status, uint warn_count) |
| Indicates end of metadata for the result set. More...
|
|
typedef int(* | start_row_t) (void *ctx) |
| Indicates the beginning of a new row in the result set/metadata. More...
|
|
typedef int(* | end_row_t) (void *ctx) |
| Indicates the end of the current row in the result set/metadata. More...
|
|
typedef void(* | abort_row_t) (void *ctx) |
| An error occurred during execution. More...
|
|
typedef ulong(* | get_client_capabilities_t) (void *ctx) |
| Return client's capabilities (see mysql_com.h, CLIENT_*) More...
|
|
typedef int(* | get_null_t) (void *ctx) |
| Receive NULL value from server. More...
|
|
typedef int(* | get_integer_t) (void *ctx, longlong value) |
| Receive TINY/SHORT/LONG value from server. More...
|
|
typedef int(* | get_longlong_t) (void *ctx, longlong value, uint is_unsigned) |
| Get LONGLONG value from server. More...
|
|
typedef int(* | get_decimal_t) (void *ctx, const decimal_t *value) |
| Receive DECIMAL value from server. More...
|
|
typedef int(* | get_double_t) (void *ctx, double value, uint32_t decimals) |
| Receive FLOAT/DOUBLE from server. More...
|
|
typedef int(* | get_date_t) (void *ctx, const MYSQL_TIME *value) |
| Get DATE value from server. More...
|
|
typedef int(* | get_time_t) (void *ctx, const MYSQL_TIME *value, uint decimals) |
| Receive TIME value from server. More...
|
|
typedef int(* | get_datetime_t) (void *ctx, const MYSQL_TIME *value, uint decimals) |
| Receive DATETIME value from server. More...
|
|
typedef int(* | get_string_t) (void *ctx, const char *value, size_t length, const CHARSET_INFO *valuecs) |
| Get STRING value from server. More...
|
|
typedef void(* | handle_ok_t) (void *ctx, uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *message) |
| Command ended with success. More...
|
|
typedef void(* | handle_error_t) (void *ctx, uint sql_errno, const char *err_msg, const char *sqlstate) |
| Command ended with ERROR. More...
|
|
typedef void(* | shutdown_t) (void *ctx, int server_shutdown) |
| Callback for shutdown notification from the server. More...
|
|
typedef bool(* | connection_alive_t) (void *ctx) |
| If the user of the srv_service is bound to a connection, this callback makes it possible to check if the connection is still alive. More...
|
|
Header file for the Command service.
This service is to provide means of executing different commands, like COM_QUERY, COM_STMT_PREPARE, in the server.
Indicates beginning of metadata for the result set.
- Parameters
-
ctx | Plugin's context |
num_cols | Number of fields being sent |
flags | Flags to alter the metadata sending |
resultcs | Charset of the result set |
- Note
- resultcs is the charset in which the data should be encoded before sent to the client. This is the value of the session variable character_set_results. The implementor most probably will need to save this value in the context and use it as "to" charset in get_string().
In case of CS_BINARY_REPRESENTATION, get_string() receives as a parameter the charset of the string, as it is stored on disk.
In case of CS_TEXT_REPRESENTATION, the string value might be already a stringified value or non-string data, which is in character_set_results.
- Returns
- 1 an error occurred, server will abort the command 0 ok
Executes a server command in a session.
There are two cases. Execution in a physical thread :
- initialized by the srv_session service
- NOT initialized by the srv_session service
In case of 1, if there is currently attached session, and it is different from the passed one, the former will be automatically detached. The session to be used for the execution will then be attached. After the command is executed, the attached session will not be detached. It will be detached by a next call to run_command() with another session as parameter. In other words, for all sessions used in a physical thread, there will be at most one in attached state.
In case of 2, the current state (current_thd) will be preserved. Then the given session will move to attached state and the command will be executed. After the execution the state of the session will be changed to detached and the preserved state (current_thd) will be restored.
The client charset is used for commands like COM_QUERY and COM_STMT_PREPARE to know how to threat the char* fields. This charset will be used until the next call of run_command when it may be changed again.
- Parameters
-
session | The session |
command | The command to be executed. |
data | The data needed for the command to be executed |
client_cs | The charset for the string data input(COM_QUERY for example) |
callbacks | Callbacks to be used by the server to encode data and to communicate with the client (plugin) side. |
text_or_binary | Select which representation the server will use for the data passed to the callbacks. For more information |
- See also
- cs_text_or_binary enum
- Parameters
-
service_callbacks_ctx | Context passed to the command service callbacks |
- Returns
- 0 success 1 failure