Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
16e3cd37
Commit
16e3cd37
authored
Apr 30, 2007
by
acurtis/antony@ltamd64.xiphis.org
Browse files
Options
Browse Files
Download
Plain Diff
Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into xiphis.org:/home/antony/work2/mysql-5.1-engines.fixme
parents
565a67e5
853fc262
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
34 deletions
+42
-34
include/mysql/plugin.h
include/mysql/plugin.h
+13
-13
sql/sql_plugin.cc
sql/sql_plugin.cc
+29
-21
No files found.
include/mysql/plugin.h
View file @
16e3cd37
...
...
@@ -203,9 +203,9 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
type blk_sz; \
} MYSQL_SYSVAR_NAME(name)
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name) struct { \
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name
, type
) struct { \
MYSQL_PLUGIN_VAR_HEADER; \
unsigned long *value, def_val;
\
type *value; type def_val;
\
TYPELIB *typelib; \
} MYSQL_SYSVAR_NAME(name)
...
...
@@ -227,11 +227,11 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
DECLARE_THDVAR_FUNC(type); \
} MYSQL_SYSVAR_NAME(name)
#define DECLARE_MYSQL_THDVAR_TYPELIB(name) struct { \
#define DECLARE_MYSQL_THDVAR_TYPELIB(name
, type
) struct { \
MYSQL_PLUGIN_VAR_HEADER; \
int offset; \
unsigned long def_val;
\
DECLARE_THDVAR_FUNC(
unsigned long);
\
type def_val;
\
DECLARE_THDVAR_FUNC(
type);
\
TYPELIB *typelib; \
} MYSQL_SYSVAR_NAME(name)
...
...
@@ -271,22 +271,22 @@ DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
#name, comment, check, update, &varname, def, min, max, blk }
#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, longlong) = { \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, long
long) = { \
PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, u
long
long) = { \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, u
nsigned long
long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_SYSVAR_TYPELIB(name) = { \
DECLARE_MYSQL_SYSVAR_TYPELIB(name
, unsigned long
) = { \
PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, typelib }
#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_SYSVAR_TYPELIB(name) = { \
DECLARE_MYSQL_SYSVAR_TYPELIB(name
, unsigned long long
) = { \
PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, typelib }
...
...
@@ -321,22 +321,22 @@ DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
#name, comment, check, update, -1, def, min, max, blk, NULL }
#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, longlong) = { \
DECLARE_MYSQL_THDVAR_SIMPLE(name, long
long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, -1, def, min, max, blk, NULL }
#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_THDVAR_SIMPLE(name, u
long
long) = { \
DECLARE_MYSQL_THDVAR_SIMPLE(name, u
nsigned long
long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, -1, def, min, max, blk, NULL }
#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_THDVAR_TYPELIB(name) = { \
DECLARE_MYSQL_THDVAR_TYPELIB(name
, unsigned long
) = { \
PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, -1, def, NULL, typelib }
#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_THDVAR_TYPELIB(name) = { \
DECLARE_MYSQL_THDVAR_TYPELIB(name
, unsigned long long
) = { \
PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, -1, def, NULL, typelib }
...
...
sql/sql_plugin.cc
View file @
16e3cd37
...
...
@@ -1767,8 +1767,10 @@ typedef DECLARE_MYSQL_THDVAR_BASIC(thdvar_bool_t, my_bool);
typedef
DECLARE_MYSQL_SYSVAR_BASIC
(
sysvar_str_t
,
char
*
);
typedef
DECLARE_MYSQL_THDVAR_BASIC
(
thdvar_str_t
,
char
*
);
typedef
DECLARE_MYSQL_SYSVAR_TYPELIB
(
sysvar_typelib_t
);
typedef
DECLARE_MYSQL_THDVAR_TYPELIB
(
thdvar_typelib_t
);
typedef
DECLARE_MYSQL_SYSVAR_TYPELIB
(
sysvar_enum_t
,
unsigned
long
);
typedef
DECLARE_MYSQL_THDVAR_TYPELIB
(
thdvar_enum_t
,
unsigned
long
);
typedef
DECLARE_MYSQL_SYSVAR_TYPELIB
(
sysvar_set_t
,
ulonglong
);
typedef
DECLARE_MYSQL_THDVAR_TYPELIB
(
thdvar_set_t
,
ulonglong
);
typedef
DECLARE_MYSQL_SYSVAR_SIMPLE
(
sysvar_int_t
,
int
);
typedef
DECLARE_MYSQL_SYSVAR_SIMPLE
(
sysvar_long_t
,
long
);
...
...
@@ -1896,9 +1898,9 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
int
length
;
if
(
var
->
flags
&
PLUGIN_VAR_THDLOCAL
)
typelib
=
((
thdvar_
typelib
_t
*
)
var
)
->
typelib
;
typelib
=
((
thdvar_
enum
_t
*
)
var
)
->
typelib
;
else
typelib
=
((
sysvar_
typelib
_t
*
)
var
)
->
typelib
;
typelib
=
((
sysvar_
enum
_t
*
)
var
)
->
typelib
;
if
(
value
->
value_type
(
value
)
==
MYSQL_VALUE_TYPE_STRING
)
{
...
...
@@ -1944,9 +1946,9 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
int
length
;
if
(
var
->
flags
&
PLUGIN_VAR_THDLOCAL
)
typelib
=
((
thdvar_
typelib
_t
*
)
var
)
->
typelib
;
typelib
=
((
thdvar_
set
_t
*
)
var
)
->
typelib
;
else
typelib
=
((
sysvar_
typelib
_t
*
)
var
)
->
typelib
;
typelib
=
((
sysvar_
set
_t
*
)
var
)
->
typelib
;
if
(
value
->
value_type
(
value
)
==
MYSQL_VALUE_TYPE_STRING
)
{
...
...
@@ -2487,13 +2489,17 @@ byte* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
TYPELIB
*
sys_var_pluginvar
::
plugin_var_typelib
(
void
)
{
int
type
=
plugin_var
->
flags
&
PLUGIN_VAR_TYPEMASK
;
if
(
type
==
PLUGIN_VAR_ENUM
||
type
==
PLUGIN_VAR_SET
)
{
if
(
plugin_var
->
flags
&
PLUGIN_VAR_THDLOCAL
)
return
((
thdvar_typelib_t
*
)
plugin_var
)
->
typelib
;
else
return
((
sysvar_typelib_t
*
)
plugin_var
)
->
typelib
;
switch
(
plugin_var
->
flags
&
(
PLUGIN_VAR_TYPEMASK
|
PLUGIN_VAR_THDLOCAL
))
{
case
PLUGIN_VAR_ENUM
:
return
((
sysvar_enum_t
*
)
plugin_var
)
->
typelib
;
case
PLUGIN_VAR_SET
:
return
((
sysvar_set_t
*
)
plugin_var
)
->
typelib
;
case
PLUGIN_VAR_ENUM
|
PLUGIN_VAR_THDLOCAL
:
return
((
thdvar_enum_t
*
)
plugin_var
)
->
typelib
;
case
PLUGIN_VAR_SET
|
PLUGIN_VAR_THDLOCAL
:
return
((
thdvar_set_t
*
)
plugin_var
)
->
typelib
;
default:
return
NULL
;
}
return
NULL
;
}
...
...
@@ -2513,7 +2519,7 @@ byte* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
char
buffer
[
STRING_BUFFER_USUAL_SIZE
];
String
str
(
buffer
,
sizeof
(
buffer
),
system_charset_info
);
TYPELIB
*
typelib
=
plugin_var_typelib
();
ulong
mask
=
1
,
value
=
*
(
u
long
*
)
result
;
ulong
long
mask
=
1
,
value
=
*
(
ulong
long
*
)
result
;
uint
i
;
str
.
length
(
0
);
...
...
@@ -2648,15 +2654,15 @@ static void plugin_opt_set_limits(struct my_option *options,
break
;
case
PLUGIN_VAR_ENUM
:
options
->
var_type
=
GET_ENUM
;
options
->
typelib
=
((
sysvar_
typelib
_t
*
)
opt
)
->
typelib
;
options
->
typelib
=
((
sysvar_
enum
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
min_value
=
options
->
block_size
=
0
;
options
->
max_value
=
options
->
typelib
->
count
-
1
;
break
;
case
PLUGIN_VAR_SET
:
options
->
var_type
=
GET_SET
;
options
->
typelib
=
((
sysvar_
typelib
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
typelib
=
((
sysvar_
set
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
long
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
min_value
=
options
->
block_size
=
0
;
options
->
max_value
=
(
ULL
(
1
)
<<
options
->
typelib
->
count
)
-
1
;
break
;
...
...
@@ -2690,15 +2696,15 @@ static void plugin_opt_set_limits(struct my_option *options,
break
;
case
PLUGIN_VAR_ENUM
|
PLUGIN_VAR_THDLOCAL
:
options
->
var_type
=
GET_ENUM
;
options
->
typelib
=
((
thdvar_
typelib
_t
*
)
opt
)
->
typelib
;
options
->
typelib
=
((
thdvar_
enum
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
min_value
=
options
->
block_size
=
0
;
options
->
max_value
=
options
->
typelib
->
count
-
1
;
break
;
case
PLUGIN_VAR_SET
|
PLUGIN_VAR_THDLOCAL
:
options
->
var_type
=
GET_SET
;
options
->
typelib
=
((
thdvar_
typelib
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
typelib
=
((
thdvar_
set
_t
*
)
opt
)
->
typelib
;
options
->
def_value
=
*
(
ulong
long
*
)
((
int
*
)
(
opt
+
1
)
+
1
);
options
->
min_value
=
options
->
block_size
=
0
;
options
->
max_value
=
(
ULL
(
1
)
<<
options
->
typelib
->
count
)
-
1
;
break
;
...
...
@@ -2815,8 +2821,10 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
SET_PLUGIN_VAR_RESOLVE
((
thdvar_str_t
*
)
opt
);
break
;
case
PLUGIN_VAR_ENUM
:
SET_PLUGIN_VAR_RESOLVE
((
thdvar_enum_t
*
)
opt
);
break
;
case
PLUGIN_VAR_SET
:
SET_PLUGIN_VAR_RESOLVE
((
thdvar_
typelib
_t
*
)
opt
);
SET_PLUGIN_VAR_RESOLVE
((
thdvar_
set
_t
*
)
opt
);
break
;
default:
sql_print_error
(
"Unknown variable type code 0x%x in plugin '%s'."
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment