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
9e3a6897
Commit
9e3a6897
authored
Dec 21, 2005
by
acurtis@xiphis.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin version changes
parent
9d4d1e81
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
61 deletions
+42
-61
include/plugin.h
include/plugin.h
+2
-2
sql/handler.cc
sql/handler.cc
+0
-17
sql/handler.h
sql/handler.h
+1
-1
sql/sql_show.cc
sql/sql_show.cc
+35
-37
storage/csv/ha_tina.cc
storage/csv/ha_tina.cc
+2
-2
storage/example/ha_example.cc
storage/example/ha_example.cc
+2
-2
No files found.
include/plugin.h
View file @
9e3a6897
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
Plugin API. Common for all plugin types.
Plugin API. Common for all plugin types.
*/
*/
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x000
0
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x000
1
/*
/*
The allowable types of plugins
The allowable types of plugins
...
@@ -51,11 +51,11 @@ struct st_mysql_plugin
...
@@ -51,11 +51,11 @@ struct st_mysql_plugin
int
type
;
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
int
type
;
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
void
*
info
;
/* pointer to type-specific plugin descriptor */
void
*
info
;
/* pointer to type-specific plugin descriptor */
const
char
*
name
;
/* plugin name */
const
char
*
name
;
/* plugin name */
uint
version
;
/* plugin version */
const
char
*
author
;
/* plugin author (for SHOW PLUGINS) */
const
char
*
author
;
/* plugin author (for SHOW PLUGINS) */
const
char
*
descr
;
/* general descriptive text (for SHOW PLUGINS ) */
const
char
*
descr
;
/* general descriptive text (for SHOW PLUGINS ) */
int
(
*
init
)(
void
);
/* the function to invoke when plugin is loaded */
int
(
*
init
)(
void
);
/* the function to invoke when plugin is loaded */
int
(
*
deinit
)(
void
);
/* the function to invoke when plugin is unloaded */
int
(
*
deinit
)(
void
);
/* the function to invoke when plugin is unloaded */
uint
version
;
/* plugin version (for SHOW PLUGINS) */
};
};
/*************************************************************************
/*************************************************************************
...
...
sql/handler.cc
View file @
9e3a6897
...
@@ -401,23 +401,6 @@ int ha_initialize_handlerton(handlerton *hton)
...
@@ -401,23 +401,6 @@ int ha_initialize_handlerton(handlerton *hton)
if
(
hton
==
NULL
)
if
(
hton
==
NULL
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
/* check major version */
if
((
hton
->
interface_version
>>
24
)
!=
(
MYSQL_HANDLERTON_INTERFACE_VERSION
>>
24
))
{
sql_print_error
(
"handlerton major version incompatible"
);
DBUG_PRINT
(
"warning"
,
(
"handlerton major version incompatible"
));
DBUG_RETURN
(
1
);
}
/* check minor version */
if
((
hton
->
interface_version
>>
16
)
&
0xff
<
(
MYSQL_HANDLERTON_INTERFACE_VERSION
>>
16
)
&
0xff
)
{
sql_print_error
(
"handlerton minor version incompatible"
);
DBUG_PRINT
(
"warning"
,
(
"handlerton minor version incompatible"
));
DBUG_RETURN
(
1
);
}
switch
(
hton
->
state
)
switch
(
hton
->
state
)
{
{
case
SHOW_OPTION_NO
:
case
SHOW_OPTION_NO
:
...
...
sql/handler.h
View file @
9e3a6897
...
@@ -337,7 +337,7 @@ typedef struct
...
@@ -337,7 +337,7 @@ typedef struct
handlerton structure version
handlerton structure version
*/
*/
const
int
interface_version
;
const
int
interface_version
;
#define MYSQL_HANDLERTON_INTERFACE_VERSION 0x0000
0000
#define MYSQL_HANDLERTON_INTERFACE_VERSION 0x0000
/*
/*
...
...
sql/sql_show.cc
View file @
9e3a6897
...
@@ -101,8 +101,7 @@ bool mysqld_show_storage_engines(THD *thd)
...
@@ -101,8 +101,7 @@ bool mysqld_show_storage_engines(THD *thd)
static
int
make_version_string
(
char
*
buf
,
int
buf_length
,
uint
version
)
static
int
make_version_string
(
char
*
buf
,
int
buf_length
,
uint
version
)
{
{
return
my_snprintf
(
buf
,
buf_length
,
"%d.%d.%d"
,
return
my_snprintf
(
buf
,
buf_length
,
"%d.%d"
,
version
>>
8
,
version
&
0xff
);
(
version
>>
24
)
&
0xff
,
(
version
>>
16
)
&
0xff
,
version
&
0xffff
);
}
}
static
my_bool
show_plugins
(
THD
*
thd
,
st_plugin_int
*
plugin
,
static
my_bool
show_plugins
(
THD
*
thd
,
st_plugin_int
*
plugin
,
...
@@ -117,18 +116,23 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
...
@@ -117,18 +116,23 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
restore_record
(
table
,
s
->
default_values
);
restore_record
(
table
,
s
->
default_values
);
table
->
field
[
0
]
->
store
(
plugin
->
name
.
str
,
plugin
->
name
.
length
,
cs
);
table
->
field
[
0
]
->
store
(
plugin
->
name
.
str
,
plugin
->
name
.
length
,
cs
);
table
->
field
[
1
]
->
store
(
version_buf
,
make_version_string
(
version_buf
,
sizeof
(
version_buf
),
plug
->
version
),
cs
);
switch
(
plugin
->
state
)
switch
(
plugin
->
state
)
{
{
/* case PLUGIN_IS_FREED: does not happen */
/* case PLUGIN_IS_FREED: does not happen */
case
PLUGIN_IS_DELETED
:
case
PLUGIN_IS_DELETED
:
table
->
field
[
1
]
->
store
(
STRING_WITH_LEN
(
"DELETED"
),
cs
);
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"DELETED"
),
cs
);
break
;
break
;
case
PLUGIN_IS_UNINITIALIZED
:
case
PLUGIN_IS_UNINITIALIZED
:
table
->
field
[
1
]
->
store
(
STRING_WITH_LEN
(
"INACTIVE"
),
cs
);
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"INACTIVE"
),
cs
);
break
;
break
;
case
PLUGIN_IS_READY
:
case
PLUGIN_IS_READY
:
table
->
field
[
1
]
->
store
(
STRING_WITH_LEN
(
"ACTIVE"
),
cs
);
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"ACTIVE"
),
cs
);
break
;
break
;
default:
default:
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
...
@@ -137,63 +141,56 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
...
@@ -137,63 +141,56 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
switch
(
plug
->
type
)
switch
(
plug
->
type
)
{
{
case
MYSQL_UDF_PLUGIN
:
case
MYSQL_UDF_PLUGIN
:
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"UDF"
),
cs
);
table
->
field
[
3
]
->
store
(
STRING_WITH_LEN
(
"UDF"
),
cs
);
break
;
break
;
case
MYSQL_STORAGE_ENGINE_PLUGIN
:
case
MYSQL_STORAGE_ENGINE_PLUGIN
:
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"STORAGE"
),
cs
);
table
->
field
[
3
]
->
store
(
STRING_WITH_LEN
(
"STORAGE"
),
cs
);
break
;
break
;
case
MYSQL_FTPARSER_PLUGIN
:
case
MYSQL_FTPARSER_PLUGIN
:
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"FTPARSER"
),
cs
);
table
->
field
[
3
]
->
store
(
STRING_WITH_LEN
(
"FTPARSER"
),
cs
);
break
;
break
;
default:
default:
table
->
field
[
2
]
->
store
(
STRING_WITH_LEN
(
"UNKNOWN"
),
cs
);
table
->
field
[
3
]
->
store
(
STRING_WITH_LEN
(
"UNKNOWN"
),
cs
);
break
;
break
;
}
}
if
(
plug
->
version
)
table
->
field
[
4
]
->
store
(
version_buf
,
{
make_version_string
(
version_buf
,
sizeof
(
version_buf
),
table
->
field
[
3
]
->
store
(
version_buf
,
*
(
uint
*
)
plug
->
info
),
cs
);
make_version_string
(
version_buf
,
sizeof
(
version_buf
),
plug
->
version
),
cs
);
table
->
field
[
3
]
->
set_notnull
();
}
else
table
->
field
[
3
]
->
set_null
();
if
(
plug
->
info
)
{
table
->
field
[
4
]
->
store
(
version_buf
,
make_version_string
(
version_buf
,
sizeof
(
version_buf
),
*
(
uint
*
)
plug
->
info
),
cs
);
table
->
field
[
4
]
->
set_notnull
();
}
else
table
->
field
[
4
]
->
set_null
();
if
(
plugin
->
plugin_dl
)
if
(
plugin
->
plugin_dl
)
{
{
table
->
field
[
5
]
->
store
(
plugin
->
plugin_dl
->
dl
.
str
,
table
->
field
[
5
]
->
store
(
plugin
->
plugin_dl
->
dl
.
str
,
plugin
->
plugin_dl
->
dl
.
length
,
cs
);
plugin
->
plugin_dl
->
dl
.
length
,
cs
);
table
->
field
[
5
]
->
set_notnull
();
table
->
field
[
5
]
->
set_notnull
();
table
->
field
[
6
]
->
store
(
version_buf
,
make_version_string
(
version_buf
,
sizeof
(
version_buf
),
plugin
->
plugin_dl
->
version
),
cs
);
table
->
field
[
6
]
->
set_notnull
();
}
}
else
else
{
table
->
field
[
5
]
->
set_null
();
table
->
field
[
5
]
->
set_null
();
table
->
field
[
6
]
->
set_null
();
}
if
(
plug
->
author
)
if
(
plug
->
author
)
{
{
table
->
field
[
6
]
->
store
(
plug
->
author
,
strlen
(
plug
->
author
),
cs
);
table
->
field
[
7
]
->
store
(
plug
->
author
,
strlen
(
plug
->
author
),
cs
);
table
->
field
[
6
]
->
set_notnull
();
table
->
field
[
7
]
->
set_notnull
();
}
}
else
else
table
->
field
[
6
]
->
set_null
();
table
->
field
[
7
]
->
set_null
();
if
(
plug
->
descr
)
if
(
plug
->
descr
)
{
{
table
->
field
[
7
]
->
store
(
plug
->
descr
,
strlen
(
plug
->
descr
),
cs
);
table
->
field
[
8
]
->
store
(
plug
->
descr
,
strlen
(
plug
->
descr
),
cs
);
table
->
field
[
7
]
->
set_notnull
();
table
->
field
[
8
]
->
set_notnull
();
}
}
else
else
table
->
field
[
7
]
->
set_null
();
table
->
field
[
8
]
->
set_null
();
return
schema_table_store_record
(
thd
,
table
);
return
schema_table_store_record
(
thd
,
table
);
}
}
...
@@ -4293,11 +4290,12 @@ ST_FIELD_INFO variables_fields_info[]=
...
@@ -4293,11 +4290,12 @@ ST_FIELD_INFO variables_fields_info[]=
ST_FIELD_INFO
plugin_fields_info
[]
=
ST_FIELD_INFO
plugin_fields_info
[]
=
{
{
{
"PLUGIN_NAME"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Name"
},
{
"PLUGIN_NAME"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Name"
},
{
"PLUGIN_VERSION"
,
20
,
MYSQL_TYPE_STRING
,
0
,
0
,
0
},
{
"PLUGIN_STATUS"
,
10
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Status"
},
{
"PLUGIN_STATUS"
,
10
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Status"
},
{
"PLUGIN_TYPE"
,
10
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Type"
},
{
"PLUGIN_TYPE"
,
10
,
MYSQL_TYPE_STRING
,
0
,
0
,
"Type"
},
{
"PLUGIN_VERSION"
,
20
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_TYPE_VERSION"
,
20
,
MYSQL_TYPE_STRING
,
0
,
0
,
0
},
{
"PLUGIN_TYPE_VERSION"
,
20
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_LIBRARY"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
1
,
"Library"
},
{
"PLUGIN_LIBRARY"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
1
,
"Library"
},
{
"PLUGIN_LIBRARY_VERSION"
,
20
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_AUTHOR"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_AUTHOR"
,
NAME_LEN
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_DESCRIPTION"
,
65535
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PLUGIN_DESCRIPTION"
,
65535
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
0
,
0
,
MYSQL_TYPE_STRING
,
0
,
0
,
0
}
{
0
,
0
,
MYSQL_TYPE_STRING
,
0
,
0
,
0
}
...
...
storage/csv/ha_tina.cc
View file @
9e3a6897
...
@@ -949,11 +949,11 @@ mysql_declare_plugin
...
@@ -949,11 +949,11 @@ mysql_declare_plugin
MYSQL_STORAGE_ENGINE_PLUGIN
,
MYSQL_STORAGE_ENGINE_PLUGIN
,
&
tina_hton
,
&
tina_hton
,
tina_hton
.
name
,
tina_hton
.
name
,
0x00010000
/* 0.1.0 */
,
"Brian Aker, MySQL AB"
,
"Brian Aker, MySQL AB"
,
"CSV Storage Engine"
,
"CSV Storage Engine"
,
tina_init_func
,
/* Plugin Init */
tina_init_func
,
/* Plugin Init */
tina_done_func
/* Plugin Deinit */
tina_done_func
,
/* Plugin Deinit */
0x0100
/* 1.0 */
,
}
}
mysql_declare_plugin_end
;
mysql_declare_plugin_end
;
storage/example/ha_example.cc
View file @
9e3a6897
...
@@ -730,11 +730,11 @@ mysql_declare_plugin
...
@@ -730,11 +730,11 @@ mysql_declare_plugin
MYSQL_STORAGE_ENGINE_PLUGIN
,
MYSQL_STORAGE_ENGINE_PLUGIN
,
&
example_hton
,
&
example_hton
,
example_hton
.
name
,
example_hton
.
name
,
0x01000000
/* 1.0.0 */
,
"Brian Aker, MySQL AB"
,
"Brian Aker, MySQL AB"
,
"Example Storage Engine"
,
"Example Storage Engine"
,
tina_init_func
,
/* Plugin Init */
tina_init_func
,
/* Plugin Init */
tina_done_func
/* Plugin Deinit */
tina_done_func
,
/* Plugin Deinit */
0x0001
/* 0.1 */
,
}
}
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