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
192e22ea
Commit
192e22ea
authored
Aug 27, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: index options don't need hton anymore
parent
dbd996e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
29 deletions
+22
-29
sql/create_options.cc
sql/create_options.cc
+4
-19
sql/create_options.h
sql/create_options.h
+12
-3
sql/handler.cc
sql/handler.cc
+6
-2
sql/handler.h
sql/handler.h
+0
-5
No files found.
sql/create_options.cc
View file @
192e22ea
...
...
@@ -250,7 +250,7 @@ static const size_t ha_option_type_sizeof[]=
@retval FALSE OK
*/
bool
parse_option_list
(
THD
*
thd
,
handlerton
*
hto
n
,
void
*
option_struct_arg
,
bool
parse_option_list
(
THD
*
thd
,
st_plugin_int
*
plugi
n
,
void
*
option_struct_arg
,
engine_option_value
**
option_list
,
ha_create_table_option
*
rules
,
bool
suppress_warning
,
MEM_ROOT
*
root
)
...
...
@@ -326,7 +326,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg,
(
thd
->
lex
->
sql_command
==
SQLCOM_CREATE_TABLE
||
seen
))
{
// take a value from the variable and add it to the list
sys_var
*
sysvar
=
find_
hton_sysvar
(
hto
n
,
opt
->
var
);
sys_var
*
sysvar
=
find_
plugin_sysvar
(
plugi
n
,
opt
->
var
);
DBUG_ASSERT
(
sysvar
);
if
(
!
sysvar
->
session_is_default
(
thd
))
...
...
@@ -368,7 +368,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg,
This is done when an engine is loaded.
*/
static
bool
resolve_sysvars
(
handlerton
*
hton
,
ha_create_table_option
*
rules
)
bool
resolve_sysvar_table_options
(
ha_create_table_option
*
rules
)
{
for
(
ha_create_table_option
*
opt
=
rules
;
rules
&&
opt
->
name
;
opt
++
)
{
...
...
@@ -421,13 +421,6 @@ static bool resolve_sysvars(handlerton *hton, ha_create_table_option *rules)
return
0
;
}
bool
resolve_sysvar_table_options
(
handlerton
*
hton
)
{
return
resolve_sysvars
(
hton
,
hton
->
table_options
)
||
resolve_sysvars
(
hton
,
hton
->
field_options
)
||
resolve_sysvars
(
hton
,
hton
->
index_options
);
}
/*
Restore HA_OPTION_TYPE_SYSVAR options back as they were
before resolve_sysvars().
...
...
@@ -435,7 +428,7 @@ bool resolve_sysvar_table_options(handlerton *hton)
This is done when the engine is unloaded, so that we could
call resolve_sysvars() if the engine is installed again.
*/
static
void
free_sysvars
(
handlerton
*
hton
,
ha_create_table_option
*
rules
)
void
free_sysvar_table_options
(
ha_create_table_option
*
rules
)
{
for
(
ha_create_table_option
*
opt
=
rules
;
rules
&&
opt
->
name
;
opt
++
)
{
...
...
@@ -452,14 +445,6 @@ static void free_sysvars(handlerton *hton, ha_create_table_option *rules)
}
}
void
free_sysvar_table_options
(
handlerton
*
hton
)
{
free_sysvars
(
hton
,
hton
->
table_options
);
free_sysvars
(
hton
,
hton
->
field_options
);
free_sysvars
(
hton
,
hton
->
index_options
);
}
/**
Parses all table/fields/keys options
...
...
sql/create_options.h
View file @
192e22ea
...
...
@@ -89,16 +89,25 @@ class engine_option_value: public Sql_alloc
typedef
struct
st_key
KEY
;
class
Create_field
;
bool
resolve_sysvar_table_options
(
ha
ndlerton
*
hton
);
void
free_sysvar_table_options
(
ha
ndlerton
*
hton
);
bool
resolve_sysvar_table_options
(
ha
_create_table_option
*
rules
);
void
free_sysvar_table_options
(
ha
_create_table_option
*
rules
);
bool
parse_engine_table_options
(
THD
*
thd
,
handlerton
*
ht
,
TABLE_SHARE
*
share
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool
parse_engine_part_options
(
THD
*
thd
,
TABLE
*
table
);
#endif
bool
parse_option_list
(
THD
*
thd
,
handlerton
*
hto
n
,
void
*
option_struct
,
bool
parse_option_list
(
THD
*
thd
,
st_plugin_int
*
plugi
n
,
void
*
option_struct
,
engine_option_value
**
option_list
,
ha_create_table_option
*
rules
,
bool
suppress_warning
,
MEM_ROOT
*
root
);
static
inline
bool
parse_option_list
(
THD
*
thd
,
handlerton
*
hton
,
void
*
option_struct
,
engine_option_value
**
option_list
,
ha_create_table_option
*
rules
,
bool
suppress_warning
,
MEM_ROOT
*
root
)
{
return
parse_option_list
(
thd
,
hton2plugin
[
hton
->
slot
],
option_struct
,
option_list
,
rules
,
suppress_warning
,
root
);
}
bool
engine_table_options_frm_read
(
const
uchar
*
buff
,
size_t
length
,
TABLE_SHARE
*
share
);
bool
merge_engine_options
(
engine_option_value
*
source
,
...
...
sql/handler.cc
View file @
192e22ea
...
...
@@ -607,7 +607,9 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
if
(
plugin
->
plugin
->
deinit
)
deinit_status
=
plugin
->
plugin
->
deinit
(
NULL
);
free_sysvar_table_options
(
hton
);
free_sysvar_table_options
(
hton
->
table_options
);
free_sysvar_table_options
(
hton
->
field_options
);
free_sysvar_table_options
(
hton
->
index_options
);
update_discovery_counters
(
hton
,
-
1
);
/*
...
...
@@ -811,7 +813,9 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
break
;
};
resolve_sysvar_table_options
(
hton
);
resolve_sysvar_table_options
(
hton
->
table_options
);
resolve_sysvar_table_options
(
hton
->
field_options
);
resolve_sysvar_table_options
(
hton
->
index_options
);
update_discovery_counters
(
hton
,
1
);
if
(
ddl_recovery_done
&&
hton
->
signal_ddl_recovery_done
)
...
...
sql/handler.h
View file @
192e22ea
...
...
@@ -1760,11 +1760,6 @@ static inline handlerton *plugin_hton(plugin_ref plugin)
return
plugin_data
(
plugin
,
handlerton
*
);
}
static
inline
sys_var
*
find_hton_sysvar
(
transaction_participant
*
hton
,
st_mysql_sys_var
*
var
)
{
return
find_plugin_sysvar
(
hton2plugin
[
hton
->
slot
],
var
);
}
handlerton
*
ha_default_handlerton
(
THD
*
thd
);
handlerton
*
ha_default_tmp_handlerton
(
THD
*
thd
);
...
...
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