Skip to content

Commit c3a8ca1

Browse files
Shaohua Wangprashanttekriwal
authored andcommitted
Followup: BUG#23479595 SEGMENTATION FAULT WHEN SELECT FTS INDEX
TABLES IN INFORMATION SCHEMA BUG#23742339 FAILING ASSERTION: SYM_NODE->TABLE != NULL Problem: When we access fts aux tables in information schema,the fts aux tables are dropped by DROP DATABASE in another session. Solution: Block DDL by s-locking dict_operation_lock. Reviewed-by: Jimmy Yang <[email protected]> RB: 13264 (cherry picked from commit c45124a0b582d57ac6cf20b786e0c643ec9ce941)
1 parent 865c5fe commit c3a8ca1

File tree

1 file changed

+25
-0
lines changed
  • storage/innobase/handler

1 file changed

+25
-0
lines changed

storage/innobase/handler/i_s.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,14 +3004,21 @@ i_s_fts_deleted_generic_fill(
30043004
DBUG_RETURN(0);
30053005
}
30063006

3007+
/* Prevent DDL to drop fts aux tables. */
3008+
rw_lock_s_lock(&dict_operation_lock);
3009+
30073010
user_table = dict_table_open_on_name(
30083011
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
30093012

30103013
if (!user_table) {
3014+
rw_lock_s_unlock(&dict_operation_lock);
3015+
30113016
DBUG_RETURN(0);
30123017
} else if (!dict_table_has_fts_index(user_table)) {
30133018
dict_table_close(user_table, FALSE, FALSE);
30143019

3020+
rw_lock_s_unlock(&dict_operation_lock);
3021+
30153022
DBUG_RETURN(0);
30163023
}
30173024

@@ -3044,6 +3051,8 @@ i_s_fts_deleted_generic_fill(
30443051

30453052
dict_table_close(user_table, FALSE, FALSE);
30463053

3054+
rw_lock_s_unlock(&dict_operation_lock);
3055+
30473056
DBUG_RETURN(0);
30483057
}
30493058

@@ -3869,10 +3878,15 @@ i_s_fts_index_table_fill(
38693878
DBUG_RETURN(0);
38703879
}
38713880

3881+
/* Prevent DDL to drop fts aux tables. */
3882+
rw_lock_s_lock(&dict_operation_lock);
3883+
38723884
user_table = dict_table_open_on_name(
38733885
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
38743886

38753887
if (!user_table) {
3888+
rw_lock_s_unlock(&dict_operation_lock);
3889+
38763890
DBUG_RETURN(0);
38773891
}
38783892

@@ -3885,6 +3899,8 @@ i_s_fts_index_table_fill(
38853899

38863900
dict_table_close(user_table, FALSE, FALSE);
38873901

3902+
rw_lock_s_unlock(&dict_operation_lock);
3903+
38883904
DBUG_RETURN(0);
38893905
}
38903906

@@ -4024,14 +4040,21 @@ i_s_fts_config_fill(
40244040

40254041
fields = table->field;
40264042

4043+
/* Prevent DDL to drop fts aux tables. */
4044+
rw_lock_s_lock(&dict_operation_lock);
4045+
40274046
user_table = dict_table_open_on_name(
40284047
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
40294048

40304049
if (!user_table) {
4050+
rw_lock_s_unlock(&dict_operation_lock);
4051+
40314052
DBUG_RETURN(0);
40324053
} else if (!dict_table_has_fts_index(user_table)) {
40334054
dict_table_close(user_table, FALSE, FALSE);
40344055

4056+
rw_lock_s_unlock(&dict_operation_lock);
4057+
40354058
DBUG_RETURN(0);
40364059
}
40374060

@@ -4087,6 +4110,8 @@ i_s_fts_config_fill(
40874110

40884111
dict_table_close(user_table, FALSE, FALSE);
40894112

4113+
rw_lock_s_unlock(&dict_operation_lock);
4114+
40904115
DBUG_RETURN(0);
40914116
}
40924117

0 commit comments

Comments
 (0)