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
07b25239
Commit
07b25239
authored
Apr 09, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename a handler method to more precisely reflect what kind of a hack it does
parent
5d364e53
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
19 deletions
+19
-19
sql/ha_partition.cc
sql/ha_partition.cc
+4
-4
sql/ha_partition.h
sql/ha_partition.h
+2
-2
sql/handler.cc
sql/handler.cc
+3
-3
sql/handler.h
sql/handler.h
+2
-2
sql/sql_table.cc
sql/sql_table.cc
+6
-6
sql/unireg.cc
sql/unireg.cc
+2
-2
No files found.
sql/ha_partition.cc
View file @
07b25239
...
@@ -511,7 +511,7 @@ int ha_partition::rename_table(const char *from, const char *to)
...
@@ -511,7 +511,7 @@ int ha_partition::rename_table(const char *from, const char *to)
Create the handler file (.par-file)
Create the handler file (.par-file)
SYNOPSIS
SYNOPSIS
create_
handler_files
()
create_
partitioning_metadata
()
name Full path of table name
name Full path of table name
create_info Create info generated for CREATE TABLE
create_info Create info generated for CREATE TABLE
...
@@ -520,19 +520,19 @@ int ha_partition::rename_table(const char *from, const char *to)
...
@@ -520,19 +520,19 @@ int ha_partition::rename_table(const char *from, const char *to)
0 Success
0 Success
DESCRIPTION
DESCRIPTION
create_
handler_files
is called to create any handler specific files
create_
partitioning_metadata
is called to create any handler specific files
before opening the file with openfrm to later call ::create on the
before opening the file with openfrm to later call ::create on the
file object.
file object.
In the partition handler this is used to store the names of partitions
In the partition handler this is used to store the names of partitions
and types of engines in the partitions.
and types of engines in the partitions.
*/
*/
int
ha_partition
::
create_
handler_files
(
const
char
*
path
,
int
ha_partition
::
create_
partitioning_metadata
(
const
char
*
path
,
const
char
*
old_path
,
const
char
*
old_path
,
int
action_flag
,
int
action_flag
,
HA_CREATE_INFO
*
create_info
)
HA_CREATE_INFO
*
create_info
)
{
{
DBUG_ENTER
(
"ha_partition::create_
handler_files
()"
);
DBUG_ENTER
(
"ha_partition::create_
partitioning_metadata
()"
);
/*
/*
We need to update total number of parts since we might write the handler
We need to update total number of parts since we might write the handler
...
...
sql/ha_partition.h
View file @
07b25239
...
@@ -229,7 +229,7 @@ public:
...
@@ -229,7 +229,7 @@ public:
chance for the handler to add any interesting comments to the table
chance for the handler to add any interesting comments to the table
comments not provided by the users comment.
comments not provided by the users comment.
create_
handler_files
is called before opening a new handler object
create_
partitioning_metadata
is called before opening a new handler object
with openfrm to call create. It is used to create any local handler
with openfrm to call create. It is used to create any local handler
object needed in opening the object in openfrm
object needed in opening the object in openfrm
-------------------------------------------------------------------------
-------------------------------------------------------------------------
...
@@ -238,7 +238,7 @@ public:
...
@@ -238,7 +238,7 @@ public:
virtual
int
rename_table
(
const
char
*
from
,
const
char
*
to
);
virtual
int
rename_table
(
const
char
*
from
,
const
char
*
to
);
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
create_info
);
HA_CREATE_INFO
*
create_info
);
virtual
int
create_
handler_files
(
const
char
*
name
,
virtual
int
create_
partitioning_metadata
(
const
char
*
name
,
const
char
*
old_name
,
int
action_flag
,
const
char
*
old_name
,
int
action_flag
,
HA_CREATE_INFO
*
create_info
);
HA_CREATE_INFO
*
create_info
);
virtual
void
update_create_info
(
HA_CREATE_INFO
*
create_info
);
virtual
void
update_create_info
(
HA_CREATE_INFO
*
create_info
);
...
...
sql/handler.cc
View file @
07b25239
...
@@ -3835,16 +3835,16 @@ handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info)
...
@@ -3835,16 +3835,16 @@ handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info)
/**
/**
Create handler files for CREATE TABLE: public interface.
Create handler files for CREATE TABLE: public interface.
@sa handler::create_
handler_files
()
@sa handler::create_
partitioning_metadata
()
*/
*/
int
int
handler
::
ha_create_
handler_files
(
const
char
*
name
,
const
char
*
old_name
,
handler
::
ha_create_
partitioning_metadata
(
const
char
*
name
,
const
char
*
old_name
,
int
action_flag
,
HA_CREATE_INFO
*
info
)
int
action_flag
,
HA_CREATE_INFO
*
info
)
{
{
mark_trx_read_write
();
mark_trx_read_write
();
return
create_
handler_files
(
name
,
old_name
,
action_flag
,
info
);
return
create_
partitioning_metadata
(
name
,
old_name
,
action_flag
,
info
);
}
}
...
...
sql/handler.h
View file @
07b25239
...
@@ -2063,7 +2063,7 @@ public:
...
@@ -2063,7 +2063,7 @@ public:
int
ha_create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
);
int
ha_create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
);
int
ha_create_
handler_files
(
const
char
*
name
,
const
char
*
old_name
,
int
ha_create_
partitioning_metadata
(
const
char
*
name
,
const
char
*
old_name
,
int
action_flag
,
HA_CREATE_INFO
*
info
);
int
action_flag
,
HA_CREATE_INFO
*
info
);
int
ha_change_partitions
(
HA_CREATE_INFO
*
create_info
,
int
ha_change_partitions
(
HA_CREATE_INFO
*
create_info
,
...
@@ -3003,7 +3003,7 @@ private:
...
@@ -3003,7 +3003,7 @@ private:
virtual
void
drop_table
(
const
char
*
name
);
virtual
void
drop_table
(
const
char
*
name
);
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
)
=
0
;
virtual
int
create
(
const
char
*
name
,
TABLE
*
form
,
HA_CREATE_INFO
*
info
)
=
0
;
virtual
int
create_
handler_files
(
const
char
*
name
,
const
char
*
old_name
,
virtual
int
create_
partitioning_metadata
(
const
char
*
name
,
const
char
*
old_name
,
int
action_flag
,
HA_CREATE_INFO
*
info
)
int
action_flag
,
HA_CREATE_INFO
*
info
)
{
return
FALSE
;
}
{
return
FALSE
;
}
...
...
sql/sql_table.cc
View file @
07b25239
...
@@ -1707,7 +1707,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
...
@@ -1707,7 +1707,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
lpt
->
table_name
,
lpt
->
create_info
,
lpt
->
table_name
,
lpt
->
create_info
,
lpt
->
alter_info
->
create_list
,
lpt
->
key_count
,
lpt
->
alter_info
->
create_list
,
lpt
->
key_count
,
lpt
->
key_info_buffer
,
lpt
->
table
->
file
))
||
lpt
->
key_info_buffer
,
lpt
->
table
->
file
))
||
lpt
->
table
->
file
->
ha_create_
handler_files
(
shadow_path
,
NULL
,
lpt
->
table
->
file
->
ha_create_
partitioning_metadata
(
shadow_path
,
NULL
,
CHF_CREATE_FLAG
,
CHF_CREATE_FLAG
,
lpt
->
create_info
))
lpt
->
create_info
))
{
{
...
@@ -1760,13 +1760,13 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
...
@@ -1760,13 +1760,13 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
*/
*/
if
(
mysql_file_delete
(
key_file_frm
,
frm_name
,
MYF
(
MY_WME
))
||
if
(
mysql_file_delete
(
key_file_frm
,
frm_name
,
MYF
(
MY_WME
))
||
#ifdef WITH_PARTITION_STORAGE_ENGINE
#ifdef WITH_PARTITION_STORAGE_ENGINE
lpt
->
table
->
file
->
ha_create_
handler_files
(
path
,
shadow_path
,
lpt
->
table
->
file
->
ha_create_
partitioning_metadata
(
path
,
shadow_path
,
CHF_DELETE_FLAG
,
NULL
)
||
CHF_DELETE_FLAG
,
NULL
)
||
deactivate_ddl_log_entry
(
part_info
->
frm_log_entry
->
entry_pos
)
||
deactivate_ddl_log_entry
(
part_info
->
frm_log_entry
->
entry_pos
)
||
(
sync_ddl_log
(),
FALSE
)
||
(
sync_ddl_log
(),
FALSE
)
||
mysql_file_rename
(
key_file_frm
,
mysql_file_rename
(
key_file_frm
,
shadow_frm_name
,
frm_name
,
MYF
(
MY_WME
))
||
shadow_frm_name
,
frm_name
,
MYF
(
MY_WME
))
||
lpt
->
table
->
file
->
ha_create_
handler_files
(
path
,
shadow_path
,
lpt
->
table
->
file
->
ha_create_
partitioning_metadata
(
path
,
shadow_path
,
CHF_RENAME_FLAG
,
NULL
))
CHF_RENAME_FLAG
,
NULL
))
#else
#else
mysql_file_rename
(
key_file_frm
,
mysql_file_rename
(
key_file_frm
,
...
@@ -4029,7 +4029,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
...
@@ -4029,7 +4029,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
/*
/*
It is impossible to open definition of partitioned table without .par file.
It is impossible to open definition of partitioned table without .par file.
*/
*/
if
(
file
->
ha_create_
handler_files
(
path
,
NULL
,
CHF_CREATE_FLAG
,
create_info
))
if
(
file
->
ha_create_
partitioning_metadata
(
path
,
NULL
,
CHF_CREATE_FLAG
,
create_info
))
return
TRUE
;
return
TRUE
;
init_tmp_table_share
(
thd
,
&
share
,
db
,
0
,
table_name
,
path
);
init_tmp_table_share
(
thd
,
&
share
,
db
,
0
,
table_name
,
path
);
...
@@ -4041,7 +4041,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
...
@@ -4041,7 +4041,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
(
void
)
closefrm
(
&
table
,
0
);
(
void
)
closefrm
(
&
table
,
0
);
free_table_share
(
&
share
);
free_table_share
(
&
share
);
(
void
)
file
->
ha_create_
handler_files
(
path
,
NULL
,
CHF_DELETE_FLAG
,
create_info
);
(
void
)
file
->
ha_create_
partitioning_metadata
(
path
,
NULL
,
CHF_DELETE_FLAG
,
create_info
);
return
result
;
return
result
;
}
}
#endif
#endif
...
@@ -7197,7 +7197,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -7197,7 +7197,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
}
/* Tell the handler that a new frm file is in place. */
/* Tell the handler that a new frm file is in place. */
error
=
t_table_list
->
table
->
file
->
ha_create_
handler_files
(
path
,
NULL
,
error
=
t_table_list
->
table
->
file
->
ha_create_
partitioning_metadata
(
path
,
NULL
,
CHF_INDEX_FLAG
,
CHF_INDEX_FLAG
,
create_info
);
create_info
);
...
...
sql/unireg.cc
View file @
07b25239
...
@@ -476,14 +476,14 @@ int rea_create_table(THD *thd, const char *path,
...
@@ -476,14 +476,14 @@ int rea_create_table(THD *thd, const char *path,
if
(
thd
->
variables
.
keep_files_on_create
)
if
(
thd
->
variables
.
keep_files_on_create
)
create_info
->
options
|=
HA_CREATE_KEEP_FILES
;
create_info
->
options
|=
HA_CREATE_KEEP_FILES
;
if
(
!
create_info
->
frm_only
&&
if
(
!
create_info
->
frm_only
&&
(
file
->
ha_create_
handler_files
(
path
,
NULL
,
CHF_CREATE_FLAG
,
(
file
->
ha_create_
partitioning_metadata
(
path
,
NULL
,
CHF_CREATE_FLAG
,
create_info
)
||
create_info
)
||
ha_create_table
(
thd
,
path
,
db
,
table_name
,
create_info
,
0
)))
ha_create_table
(
thd
,
path
,
db
,
table_name
,
create_info
,
0
)))
goto
err_handler
;
goto
err_handler
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
err_handler:
err_handler:
(
void
)
file
->
ha_create_
handler_files
(
path
,
NULL
,
CHF_DELETE_FLAG
,
create_info
);
(
void
)
file
->
ha_create_
partitioning_metadata
(
path
,
NULL
,
CHF_DELETE_FLAG
,
create_info
);
mysql_file_delete
(
key_file_frm
,
frm_name
,
MYF
(
0
));
mysql_file_delete
(
key_file_frm
,
frm_name
,
MYF
(
0
));
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
/* rea_create_table */
}
/* rea_create_table */
...
...
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