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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
95e7cccf
Commit
95e7cccf
authored
Nov 14, 2007
by
gshchepa/uchum@gleb.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.1-opt-32034
into gleb.loc:/home/uchum/work/bk/5.1-opt
parents
82ce901d
70f36562
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
2 deletions
+55
-2
mysql-test/r/plugin.result
mysql-test/r/plugin.result
+10
-0
mysql-test/t/plugin.test
mysql-test/t/plugin.test
+15
-0
sql/sql_plugin.cc
sql/sql_plugin.cc
+1
-1
storage/example/ha_example.cc
storage/example/ha_example.cc
+29
-1
No files found.
mysql-test/r/plugin.result
View file @
95e7cccf
...
@@ -17,3 +17,13 @@ UNINSTALL PLUGIN EXAMPLE;
...
@@ -17,3 +17,13 @@ UNINSTALL PLUGIN EXAMPLE;
ERROR 42000: PLUGIN EXAMPLE does not exist
ERROR 42000: PLUGIN EXAMPLE does not exist
UNINSTALL PLUGIN non_exist;
UNINSTALL PLUGIN non_exist;
ERROR 42000: PLUGIN non_exist does not exist
ERROR 42000: PLUGIN non_exist does not exist
#
# Bug#32034: check_func_enum() does not check correct values but set it
# to impossible int val
#
INSTALL PLUGIN example SONAME 'ha_example.so';
SET GLOBAL example_enum_var= e1;
SET GLOBAL example_enum_var= e2;
SET GLOBAL example_enum_var= impossible;
ERROR 42000: Variable 'enum_var' can't be set to the value of 'impossible'
UNINSTALL PLUGIN example;
mysql-test/t/plugin.test
View file @
95e7cccf
...
@@ -24,3 +24,18 @@ UNINSTALL PLUGIN EXAMPLE;
...
@@ -24,3 +24,18 @@ UNINSTALL PLUGIN EXAMPLE;
--
error
1305
--
error
1305
UNINSTALL
PLUGIN
non_exist
;
UNINSTALL
PLUGIN
non_exist
;
--
echo
#
--
echo
# Bug#32034: check_func_enum() does not check correct values but set it
--
echo
# to impossible int val
--
echo
#
INSTALL
PLUGIN
example
SONAME
'ha_example.so'
;
SET
GLOBAL
example_enum_var
=
e1
;
SET
GLOBAL
example_enum_var
=
e2
;
--
error
1231
SET
GLOBAL
example_enum_var
=
impossible
;
UNINSTALL
PLUGIN
example
;
sql/sql_plugin.cc
View file @
95e7cccf
...
@@ -1944,7 +1944,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
...
@@ -1944,7 +1944,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
length
=
sizeof
(
buff
);
length
=
sizeof
(
buff
);
if
(
!
(
str
=
value
->
val_str
(
value
,
buff
,
&
length
)))
if
(
!
(
str
=
value
->
val_str
(
value
,
buff
,
&
length
)))
goto
err
;
goto
err
;
if
((
result
=
find_type
(
typelib
,
str
,
length
,
1
)
-
1
)
<
0
)
if
((
result
=
(
long
)
find_type
(
typelib
,
str
,
length
,
1
)
-
1
)
<
0
)
{
{
strvalue
=
str
;
strvalue
=
str
;
goto
err
;
goto
err
;
...
...
storage/example/ha_example.cc
View file @
95e7cccf
...
@@ -848,6 +848,34 @@ int ha_example::create(const char *name, TABLE *table_arg,
...
@@ -848,6 +848,34 @@ int ha_example::create(const char *name, TABLE *table_arg,
struct
st_mysql_storage_engine
example_storage_engine
=
struct
st_mysql_storage_engine
example_storage_engine
=
{
MYSQL_HANDLERTON_INTERFACE_VERSION
};
{
MYSQL_HANDLERTON_INTERFACE_VERSION
};
static
ulong
srv_enum_var
=
0
;
const
char
*
enum_var_names
[]
=
{
"e1"
,
"e2"
,
NullS
};
TYPELIB
enum_var_typelib
=
{
array_elements
(
enum_var_names
)
-
1
,
"enum_var_typelib"
,
enum_var_names
,
NULL
};
static
MYSQL_SYSVAR_ENUM
(
enum_var
,
// name
srv_enum_var
,
// varname
PLUGIN_VAR_RQCMDARG
,
// opt
"Sample ENUM system variable."
,
// comment
NULL
,
// check
NULL
,
// update
0
,
// def
&
enum_var_typelib
);
// typelib
static
struct
st_mysql_sys_var
*
example_system_variables
[]
=
{
MYSQL_SYSVAR
(
enum_var
),
NULL
};
mysql_declare_plugin
(
example
)
mysql_declare_plugin
(
example
)
{
{
MYSQL_STORAGE_ENGINE_PLUGIN
,
MYSQL_STORAGE_ENGINE_PLUGIN
,
...
@@ -860,7 +888,7 @@ mysql_declare_plugin(example)
...
@@ -860,7 +888,7 @@ mysql_declare_plugin(example)
example_done_func
,
/* Plugin Deinit */
example_done_func
,
/* Plugin Deinit */
0x0001
/* 0.1 */
,
0x0001
/* 0.1 */
,
NULL
,
/* status variables */
NULL
,
/* status variables */
NULL
,
/* system variables */
example_system_variables
,
/* system variables */
NULL
/* config options */
NULL
/* config options */
}
}
mysql_declare_plugin_end
;
mysql_declare_plugin_end
;
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