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
094f140c
Commit
094f140c
authored
Sep 27, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.6.33
parent
b4f97a14
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
12 deletions
+97
-12
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+31
-0
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+7
-2
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+6
-3
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+2
-0
storage/innobase/include/fts0fts.h
storage/innobase/include/fts0fts.h
+10
-0
storage/innobase/row/row0log.cc
storage/innobase/row/row0log.cc
+7
-7
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+34
-0
No files found.
storage/innobase/fts/fts0fts.cc
View file @
094f140c
...
@@ -108,6 +108,7 @@ UNIV_INTERN mysql_pfs_key_t fts_pll_tokenize_mutex_key;
...
@@ -108,6 +108,7 @@ UNIV_INTERN mysql_pfs_key_t fts_pll_tokenize_mutex_key;
/** variable to record innodb_fts_internal_tbl_name for information
/** variable to record innodb_fts_internal_tbl_name for information
schema table INNODB_FTS_INSERTED etc. */
schema table INNODB_FTS_INSERTED etc. */
UNIV_INTERN
char
*
fts_internal_tbl_name
=
NULL
;
UNIV_INTERN
char
*
fts_internal_tbl_name
=
NULL
;
UNIV_INTERN
char
*
fts_internal_tbl_name2
=
NULL
;
/** InnoDB default stopword list:
/** InnoDB default stopword list:
There are different versions of stopwords, the stop words listed
There are different versions of stopwords, the stop words listed
...
@@ -6569,6 +6570,36 @@ fts_check_corrupt_index(
...
@@ -6569,6 +6570,36 @@ fts_check_corrupt_index(
return
(
0
);
return
(
0
);
}
}
/* Get parent table name if it's a fts aux table
@param[in] aux_table_name aux table name
@param[in] aux_table_len aux table length
@return parent table name, or NULL */
char
*
fts_get_parent_table_name
(
const
char
*
aux_table_name
,
ulint
aux_table_len
)
{
fts_aux_table_t
aux_table
;
char
*
parent_table_name
=
NULL
;
if
(
fts_is_aux_table_name
(
&
aux_table
,
aux_table_name
,
aux_table_len
))
{
dict_table_t
*
parent_table
;
parent_table
=
dict_table_open_on_id
(
aux_table
.
parent_id
,
TRUE
,
DICT_TABLE_OP_NORMAL
);
if
(
parent_table
!=
NULL
)
{
parent_table_name
=
mem_strdupl
(
parent_table
->
name
,
strlen
(
parent_table
->
name
));
dict_table_close
(
parent_table
,
TRUE
,
FALSE
);
}
}
return
(
parent_table_name
);
}
/** Check the validity of the parent table.
/** Check the validity of the parent table.
@param[in] aux_table auxiliary table
@param[in] aux_table auxiliary table
@return true if it is a valid table or false if it is not */
@return true if it is a valid table or false if it is not */
...
...
storage/innobase/handler/ha_innodb.cc
View file @
094f140c
...
@@ -14505,7 +14505,12 @@ innodb_internal_table_update(
...
@@ -14505,7 +14505,12 @@ innodb_internal_table_update(
my_free
(
old
);
my_free
(
old
);
}
}
fts_internal_tbl_name
=
*
(
char
**
)
var_ptr
;
fts_internal_tbl_name2
=
*
(
char
**
)
var_ptr
;
if
(
fts_internal_tbl_name2
==
NULL
)
{
fts_internal_tbl_name
=
const_cast
<
char
*>
(
"default"
);
}
else
{
fts_internal_tbl_name
=
fts_internal_tbl_name2
;
}
}
}
/****************************************************************//**
/****************************************************************//**
...
@@ -16253,7 +16258,7 @@ static MYSQL_SYSVAR_BOOL(disable_sort_file_cache, srv_disable_sort_file_cache,
...
@@ -16253,7 +16258,7 @@ static MYSQL_SYSVAR_BOOL(disable_sort_file_cache, srv_disable_sort_file_cache,
"Whether to disable OS system file cache for sort I/O"
,
"Whether to disable OS system file cache for sort I/O"
,
NULL
,
NULL
,
FALSE
);
NULL
,
NULL
,
FALSE
);
static
MYSQL_SYSVAR_STR
(
ft_aux_table
,
fts_internal_tbl_name
,
static
MYSQL_SYSVAR_STR
(
ft_aux_table
,
fts_internal_tbl_name
2
,
PLUGIN_VAR_NOCMDARG
,
PLUGIN_VAR_NOCMDARG
,
"FTS internal auxiliary table to be checked"
,
"FTS internal auxiliary table to be checked"
,
innodb_internal_table_validate
,
innodb_internal_table_validate
,
...
...
storage/innobase/handler/handler0alter.cc
View file @
094f140c
...
@@ -201,7 +201,10 @@ innobase_need_rebuild(
...
@@ -201,7 +201,10 @@ innobase_need_rebuild(
/*==================*/
/*==================*/
const
Alter_inplace_info
*
ha_alter_info
)
const
Alter_inplace_info
*
ha_alter_info
)
{
{
if
(
ha_alter_info
->
handler_flags
Alter_inplace_info
::
HA_ALTER_FLAGS
alter_inplace_flags
=
ha_alter_info
->
handler_flags
&
~
(
INNOBASE_INPLACE_IGNORE
);
if
(
alter_inplace_flags
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
&&
!
(
ha_alter_info
->
create_info
->
used_fields
&&
!
(
ha_alter_info
->
create_info
->
used_fields
&
(
HA_CREATE_USED_ROW_FORMAT
&
(
HA_CREATE_USED_ROW_FORMAT
...
@@ -3760,7 +3763,7 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -3760,7 +3763,7 @@ ha_innobase::prepare_inplace_alter_table(
}
}
if
(
!
(
ha_alter_info
->
handler_flags
&
INNOBASE_ALTER_DATA
)
if
(
!
(
ha_alter_info
->
handler_flags
&
INNOBASE_ALTER_DATA
)
||
(
ha_alter_info
->
handler_flags
||
(
(
ha_alter_info
->
handler_flags
&
~
INNOBASE_INPLACE_IGNORE
)
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
&&
!
innobase_need_rebuild
(
ha_alter_info
)))
{
&&
!
innobase_need_rebuild
(
ha_alter_info
)))
{
...
@@ -3926,7 +3929,7 @@ ha_innobase::inplace_alter_table(
...
@@ -3926,7 +3929,7 @@ ha_innobase::inplace_alter_table(
DBUG_RETURN
(
false
);
DBUG_RETURN
(
false
);
}
}
if
(
ha_alter_info
->
handler_flags
if
(
(
ha_alter_info
->
handler_flags
&
~
INNOBASE_INPLACE_IGNORE
)
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
==
Alter_inplace_info
::
CHANGE_CREATE_OPTION
&&
!
innobase_need_rebuild
(
ha_alter_info
))
{
&&
!
innobase_need_rebuild
(
ha_alter_info
))
{
goto
ok_exit
;
goto
ok_exit
;
...
...
storage/innobase/handler/i_s.cc
View file @
094f140c
...
@@ -4038,6 +4038,8 @@ i_s_fts_config_fill(
...
@@ -4038,6 +4038,8 @@ i_s_fts_config_fill(
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
DEBUG_SYNC_C
(
"i_s_fts_config_fille_check"
);
fields
=
table
->
field
;
fields
=
table
->
field
;
/* Prevent DDL to drop fts aux tables. */
/* Prevent DDL to drop fts aux tables. */
...
...
storage/innobase/include/fts0fts.h
View file @
094f140c
...
@@ -375,6 +375,7 @@ extern bool fts_need_sync;
...
@@ -375,6 +375,7 @@ extern bool fts_need_sync;
/** Variable specifying the table that has Fulltext index to display its
/** Variable specifying the table that has Fulltext index to display its
content through information schema table */
content through information schema table */
extern
char
*
fts_internal_tbl_name
;
extern
char
*
fts_internal_tbl_name
;
extern
char
*
fts_internal_tbl_name2
;
#define fts_que_graph_free(graph) \
#define fts_que_graph_free(graph) \
do { \
do { \
...
@@ -823,6 +824,15 @@ void
...
@@ -823,6 +824,15 @@ void
fts_drop_orphaned_tables
(
void
);
fts_drop_orphaned_tables
(
void
);
/*==========================*/
/*==========================*/
/* Get parent table name if it's a fts aux table
@param[in] aux_table_name aux table name
@param[in] aux_table_len aux table length
@return parent table name, or NULL */
char
*
fts_get_parent_table_name
(
const
char
*
aux_table_name
,
ulint
aux_table_len
);
/******************************************************************//**
/******************************************************************//**
Since we do a horizontal split on the index table, we need to drop
Since we do a horizontal split on the index table, we need to drop
all the split tables.
all the split tables.
...
...
storage/innobase/row/row0log.cc
View file @
094f140c
...
@@ -613,7 +613,7 @@ row_log_table_delete(
...
@@ -613,7 +613,7 @@ row_log_table_delete(
&
old_pk_extra_size
);
&
old_pk_extra_size
);
ut_ad
(
old_pk_extra_size
<
0x100
);
ut_ad
(
old_pk_extra_size
<
0x100
);
mrec_size
=
4
+
old_pk_size
;
mrec_size
=
6
+
old_pk_size
;
/* Log enough prefix of the BLOB unless both the
/* Log enough prefix of the BLOB unless both the
old and new table are in COMPACT or REDUNDANT format,
old and new table are in COMPACT or REDUNDANT format,
...
@@ -643,8 +643,8 @@ row_log_table_delete(
...
@@ -643,8 +643,8 @@ row_log_table_delete(
*
b
++
=
static_cast
<
byte
>
(
old_pk_extra_size
);
*
b
++
=
static_cast
<
byte
>
(
old_pk_extra_size
);
/* Log the size of external prefix we saved */
/* Log the size of external prefix we saved */
mach_write_to_
2
(
b
,
ext_size
);
mach_write_to_
4
(
b
,
ext_size
);
b
+=
2
;
b
+=
4
;
rec_convert_dtuple_to_temp
(
rec_convert_dtuple_to_temp
(
b
+
old_pk_extra_size
,
new_index
,
b
+
old_pk_extra_size
,
new_index
,
...
@@ -2268,14 +2268,14 @@ row_log_table_apply_op(
...
@@ -2268,14 +2268,14 @@ row_log_table_apply_op(
break
;
break
;
case
ROW_T_DELETE
:
case
ROW_T_DELETE
:
/* 1 (extra_size) +
2
(ext_size) + at least 1 (payload) */
/* 1 (extra_size) +
4
(ext_size) + at least 1 (payload) */
if
(
mrec
+
4
>=
mrec_end
)
{
if
(
mrec
+
6
>=
mrec_end
)
{
return
(
NULL
);
return
(
NULL
);
}
}
extra_size
=
*
mrec
++
;
extra_size
=
*
mrec
++
;
ext_size
=
mach_read_from_
2
(
mrec
);
ext_size
=
mach_read_from_
4
(
mrec
);
mrec
+=
2
;
mrec
+=
4
;
ut_ad
(
mrec
<
mrec_end
);
ut_ad
(
mrec
<
mrec_end
);
/* We assume extra_size < 0x100 for the PRIMARY KEY prefix.
/* We assume extra_size < 0x100 for the PRIMARY KEY prefix.
...
...
storage/innobase/row/row0mysql.cc
View file @
094f140c
...
@@ -2676,6 +2676,10 @@ row_drop_tables_for_mysql_in_background(void)
...
@@ -2676,6 +2676,10 @@ row_drop_tables_for_mysql_in_background(void)
return
(
n_tables
+
n_tables_dropped
);
return
(
n_tables
+
n_tables_dropped
);
}
}
DBUG_EXECUTE_IF
(
"row_drop_tables_in_background_sleep"
,
os_thread_sleep
(
5000000
);
);
table
=
dict_table_open_on_name
(
drop
->
table_name
,
FALSE
,
FALSE
,
table
=
dict_table_open_on_name
(
drop
->
table_name
,
FALSE
,
FALSE
,
DICT_ERR_IGNORE_NONE
);
DICT_ERR_IGNORE_NONE
);
...
@@ -2686,6 +2690,16 @@ row_drop_tables_for_mysql_in_background(void)
...
@@ -2686,6 +2690,16 @@ row_drop_tables_for_mysql_in_background(void)
goto
already_dropped
;
goto
already_dropped
;
}
}
if
(
!
table
->
to_be_dropped
)
{
/* There is a scenario: the old table is dropped
just after it's added into drop list, and new
table with the same name is created, then we try
to drop the new table in background. */
dict_table_close
(
table
,
FALSE
,
FALSE
);
goto
already_dropped
;
}
ut_a
(
!
table
->
can_be_evicted
);
ut_a
(
!
table
->
can_be_evicted
);
dict_table_close
(
table
,
FALSE
,
FALSE
);
dict_table_close
(
table
,
FALSE
,
FALSE
);
...
@@ -3945,6 +3959,13 @@ row_drop_table_for_mysql(
...
@@ -3945,6 +3959,13 @@ row_drop_table_for_mysql(
}
}
}
}
DBUG_EXECUTE_IF
(
"row_drop_table_add_to_background"
,
row_add_table_to_background_drop_list
(
table
->
name
);
err
=
DB_SUCCESS
;
goto
funct_exit
;
);
/* TODO: could we replace the counter n_foreign_key_checks_running
/* TODO: could we replace the counter n_foreign_key_checks_running
with lock checks on the table? Acquire here an exclusive lock on the
with lock checks on the table? Acquire here an exclusive lock on the
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that
...
@@ -4561,6 +4582,19 @@ row_drop_database_for_mysql(
...
@@ -4561,6 +4582,19 @@ row_drop_database_for_mysql(
row_mysql_lock_data_dictionary
(
trx
);
row_mysql_lock_data_dictionary
(
trx
);
while
((
table_name
=
dict_get_first_table_name_in_db
(
name
)))
{
while
((
table_name
=
dict_get_first_table_name_in_db
(
name
)))
{
/* Drop parent table if it is a fts aux table, to
avoid accessing dropped fts aux tables in information
scheam when parent table still exists.
Note: Drop parent table will drop fts aux tables. */
char
*
parent_table_name
;
parent_table_name
=
fts_get_parent_table_name
(
table_name
,
strlen
(
table_name
));
if
(
parent_table_name
!=
NULL
)
{
mem_free
(
table_name
);
table_name
=
parent_table_name
;
}
ut_a
(
memcmp
(
table_name
,
name
,
namelen
)
==
0
);
ut_a
(
memcmp
(
table_name
,
name
,
namelen
)
==
0
);
table
=
dict_table_open_on_name
(
table
=
dict_table_open_on_name
(
...
...
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