MySQL 9.1.0
Source Code Documentation
system_variables_bits.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef COMPONENTS_SERVICES_BITS_SYSTEM_VARIABLES_BITS_H
25#define COMPONENTS_SERVICES_BITS_SYSTEM_VARIABLES_BITS_H
26
27/**
28 @addtogroup group_components_services_sys_var_service_types Variable types
29
30 Possible system variable types. Use at most one of these.
31
32 @sa mysql_service_component_sys_variable_register service.
33
34 @{
35*/
36
37/** bool variable. Use @ref BOOL_CHECK_ARG */
38#define PLUGIN_VAR_BOOL 0x0001
39/** int variable. Use @ref INTEGRAL_CHECK_ARG */
40#define PLUGIN_VAR_INT 0x0002
41/** long variable Use @ref INTEGRAL_CHECK_ARG */
42#define PLUGIN_VAR_LONG 0x0003
43/** longlong variable. Use @ref INTEGRAL_CHECK_ARG */
44#define PLUGIN_VAR_LONGLONG 0x0004
45/** char * variable. Use @ref STR_CHECK_ARG */
46#define PLUGIN_VAR_STR 0x0005
47/** Enum variable. Use @ref ENUM_CHECK_ARG */
48#define PLUGIN_VAR_ENUM 0x0006
49/** A set variable. Use @ref ENUM_CHECK_ARG */
50#define PLUGIN_VAR_SET 0x0007
51/** double variable. Use @ref INTEGRAL_CHECK_ARG */
52#define PLUGIN_VAR_DOUBLE 0x0008
53/** @} */
54/**
55 @addtogroup group_components_services_sys_var_service_flags Variable flags
56
57 Flags to specify the behavior of system variables. Use multiple as needed.
58
59 @sa mysql_service_component_sys_variable_register service.
60
61 @{
62*/
63#define PLUGIN_VAR_UNSIGNED 0x0080 /**< The variable is unsigned */
64#define PLUGIN_VAR_THDLOCAL 0x0100 /**< Variable is per-connection */
65#define PLUGIN_VAR_READONLY 0x0200 /**< Server variable is read only */
66#define PLUGIN_VAR_NOSYSVAR 0x0400 /**< Not a server variable */
67#define PLUGIN_VAR_NOCMDOPT 0x0800 /**< Not a command line option */
68#define PLUGIN_VAR_NOCMDARG 0x1000 /**< No argument for cmd line */
69#define PLUGIN_VAR_RQCMDARG 0x0000 /**< Argument required for cmd line */
70#define PLUGIN_VAR_OPCMDARG 0x2000 /**< Argument optional for cmd line */
71#define PLUGIN_VAR_NODEFAULT 0x4000 /**< SET DEFAULT is prohibited */
72#define PLUGIN_VAR_MEMALLOC 0x8000 /**< String needs memory allocated */
73#define PLUGIN_VAR_NOPERSIST \
74 0x10000 /**< SET PERSIST_ONLY is prohibited for read only variables */
75#define PLUGIN_VAR_PERSIST_AS_READ_ONLY 0x20000
76#define PLUGIN_VAR_INVISIBLE 0x40000 /**< Variable should not be shown */
77#define PLUGIN_VAR_SENSITIVE 0x80000 /**< Sensitive variable */
78/** @} */
79
80/**
81 st_mysql_value struct for reading values from mysqld.
82 Used by server variables framework to parse user-provided values.
83 Will be used for arguments when implementing UDFs.
84
85 Note that val_str() returns a string in temporary memory
86 that will be freed at the end of statement. Copy the string
87 if you need it to persist.
88*/
89
90#define MYSQL_VALUE_TYPE_STRING 0
91#define MYSQL_VALUE_TYPE_REAL 1
92#define MYSQL_VALUE_TYPE_INT 2
93
95 int (*value_type)(struct st_mysql_value *);
96 const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
97 int (*val_real)(struct st_mysql_value *, double *realbuf);
98 int (*val_int)(struct st_mysql_value *, long long *intbuf);
99 int (*is_unsigned)(struct st_mysql_value *);
100};
101
102#endif /* COMPONENTS_SERVICES_BITS_SYSTEM_VARIABLES_BITS_H */
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Definition: system_variables_bits.h:94
int(* val_int)(struct st_mysql_value *, long long *intbuf)
Definition: system_variables_bits.h:98
int(* val_real)(struct st_mysql_value *, double *realbuf)
Definition: system_variables_bits.h:97
int(* is_unsigned)(struct st_mysql_value *)
Definition: system_variables_bits.h:99
int(* value_type)(struct st_mysql_value *)
Definition: system_variables_bits.h:95