MySQL 9.1.0
Source Code Documentation
|
#include "mysql_stored_program_imp.h"
#include <cstring>
#include "my_sys.h"
#include "my_time.h"
#include "mysql/components/services/bits/stored_program_bits.h"
#include "mysql/components/services/mysql_string.h"
#include "mysql/strings/m_ctype.h"
#include "mysql_time.h"
#include "sql/current_thd.h"
#include "sql/item.h"
#include "sql/item_timefunc.h"
#include "sql/sp_cache.h"
#include "sql/sp_head.h"
#include "sql/sp_pcontext.h"
#include "sql/sp_rcontext.h"
#include "sql/tztime.h"
Functions | |
static int | get_field_metadata_internal (Create_field &field, bool input, bool output, const char *key, void *value) |
Get stored program argument metadata. More... | |
static auto | set_variable (stored_program_runtime_context sp_runtime_context, Item *item, int index) -> int |
static auto | set_return_value (stored_program_runtime_context sp_runtime_context, Item *item) -> int |
static auto | get_item (stored_program_runtime_context sp_runtime_context, int index) -> Item * |
static auto | get_return_field (stored_program_runtime_context sp_runtime_context) -> Field * |
static int | runtime_argument_datetime_get (stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t *year, uint32_t *month, uint32_t *day, uint32_t *hour, uint32_t *minute, uint32_t *second, uint64_t *micro, bool *negative, int32_t *time_zone_offset, bool *is_null) |
Helper function that retrieves runtime argument value for DATETIME and TIMESTAMP types. More... | |
static int | runtime_argument_datetime_set (stored_program_runtime_context sp_runtime_context, uint16_t index, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) |
Helper function that sets runtime argument value for DATETIME and TIMESTAMP types. More... | |
static int | return_value_datetime_set (stored_program_runtime_context sp_runtime_context, uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second, uint64_t micro, bool negative, uint32_t decimals, int32_t time_zone_offset, bool time_zone_aware) |
Helper function that sets return value for DATETIME and TIMESTAMP types. More... | |
static auto | is_sp_in_current_thd (sp_head *sp) -> bool |
Ensure the sp_head is part of the current THD. More... | |
Variables | |
constexpr auto | MYSQL_SUCCESS = 0 |
constexpr auto | MYSQL_FAILURE = 1 |
|
static |
Get stored program argument metadata.
"argument_name" -> const char * "sql_type" -> uint64_t "in_variable" -> boolean "out_variable" -> boolean "is_signed" -> boolean (Applicable to numeric data types) "is_nullable" -> boolean "charset" -> char const * "max_byte_length" -> size_t (Applicable to string/blob data types)
MYSQL_SUCCESS | Success |
MYSQL_FAILURE | Failure |
|
static |
|
static |
|
static |
Ensure the sp_head is part of the current THD.
sp | - sp_head pointer. |
|
static |
Helper function that sets return value for DATETIME and TIMESTAMP types.
[in] | sp_runtime_context | stored program runtime context. If null, current runtime context will be used. |
[in] | year | Year part |
[in] | month | Month of the year |
[in] | day | Day of the month |
[in] | hour | Hour of the day |
[in] | minute | Minute of the hour |
[in] | second | Second of the minute |
[in] | micro | Micro second of the second |
[in] | negative | Is negative |
[in] | decimals | Precision information |
[in] | time_zone_offset | Time zone offset in seconds |
[in] | time_zone_aware | Is time zone aware |
MYSQL_SUCCESS | Success |
MYSQL_FAILURE | Failure |
|
static |
Helper function that retrieves runtime argument value for DATETIME and TIMESTAMP types.
[in] | sp_runtime_context | stored program runtime context. If null, current runtime context will be used. |
[in] | index | Argument location |
[out] | year | Year part |
[out] | month | Month of the year |
[out] | day | Day of the month |
[out] | hour | Hour of the day |
[out] | minute | Minute of the hour |
[out] | second | Second of the minute |
[out] | micro | Micro second of the second |
[out] | negative | Is negative |
[out] | time_zone_offset | Time zone offset in seconds |
[out] | is_null | Flag to indicate if value is null |
MYSQL_SUCCESS | Success |
MYSQL_FAILURE | Failure |
|
static |
Helper function that sets runtime argument value for DATETIME and TIMESTAMP types.
[in] | sp_runtime_context | stored program runtime context. If null, current runtime context will be used. |
[in] | index | Argument location |
[in] | year | Year part |
[in] | month | Month of the year |
[in] | day | Day of the month |
[in] | hour | Hour of the day |
[in] | minute | Minute of the hour |
[in] | second | Second of the minute |
[in] | micro | Micro second of the second |
[in] | negative | Is negative |
[in] | decimals | Precision information |
[in] | time_zone_offset | Time zone offset in seconds |
[in] | time_zone_aware | Is time zone aware |
MYSQL_SUCCESS | Success |
MYSQL_FAILURE | Failure |
|
static |
|
static |
|
constexpr |
|
constexpr |