@@ -490,7 +490,7 @@ static bool row_ins_cascade_ancestor_updates_table(
490
490
491
491
n_fields_updated = 0 ;
492
492
493
- *fts_col_affected = false ;
493
+ *fts_col_affected = foreign-> is_fts_col_affected () ;
494
494
495
495
if (table->fts ) {
496
496
doc_id_pos = dict_table_get_nth_col_pos (table, table->fts ->doc_col );
@@ -593,14 +593,6 @@ static bool row_ins_cascade_ancestor_updates_table(
593
593
dfield_set_data (&ufield->new_val , padded_data, min_size);
594
594
}
595
595
596
- /* Check whether the current column has
597
- FTS index on it */
598
- if (table->fts &&
599
- dict_table_is_fts_column (table->fts ->indexes , dict_col_get_no (col),
600
- col->is_virtual ()) != ULINT_UNDEFINED) {
601
- *fts_col_affected = true ;
602
- }
603
-
604
596
/* If Doc ID is updated, check whether the
605
597
Doc ID is valid */
606
598
if (table->fts && ufield->field_no == doc_id_pos) {
@@ -986,7 +978,6 @@ static void row_ins_foreign_fill_virtual(upd_node_t *cascade, const rec_t *rec,
986
978
trx_t *trx;
987
979
mem_heap_t *tmp_heap = nullptr ;
988
980
doc_id_t doc_id = FTS_NULL_DOC_ID;
989
- bool fts_col_affacted = false ;
990
981
991
982
DBUG_TRACE;
992
983
ut_a (thr);
@@ -1191,16 +1182,9 @@ static void row_ins_foreign_fill_virtual(upd_node_t *cascade, const rec_t *rec,
1191
1182
ufield->orig_len = 0 ;
1192
1183
ufield->exp = nullptr ;
1193
1184
dfield_set_null (&ufield->new_val );
1194
-
1195
- if (table->fts &&
1196
- dict_table_is_fts_column (table->fts ->indexes , index->get_col_no (i),
1197
- index->get_col (i)->is_virtual ()) !=
1198
- ULINT_UNDEFINED) {
1199
- fts_col_affacted = true ;
1200
- }
1201
1185
}
1202
1186
1203
- if (fts_col_affacted ) {
1187
+ if (foreign-> is_fts_col_affected () ) {
1204
1188
fts_trx_add_op (trx, table, doc_id, FTS_DELETE, nullptr );
1205
1189
}
1206
1190
@@ -1215,26 +1199,18 @@ static void row_ins_foreign_fill_virtual(upd_node_t *cascade, const rec_t *rec,
1215
1199
1216
1200
} else if (table->fts && cascade->is_delete ) {
1217
1201
/* DICT_FOREIGN_ON_DELETE_CASCADE case */
1218
- for (i = 0 ; i < foreign->n_fields ; i++) {
1219
- if (table->fts &&
1220
- dict_table_is_fts_column (table->fts ->indexes , index->get_col_no (i),
1221
- index->get_col (i)->is_virtual ()) !=
1222
- ULINT_UNDEFINED) {
1223
- fts_col_affacted = true ;
1224
- }
1225
- }
1226
-
1227
- if (fts_col_affacted) {
1202
+ if (foreign->is_fts_col_affected ()) {
1228
1203
fts_trx_add_op (trx, table, doc_id, FTS_DELETE, nullptr );
1229
1204
}
1230
1205
}
1231
1206
1232
1207
if (!node->is_delete && (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)) {
1208
+ bool fts_col_affected = false ;
1233
1209
/* Build the appropriate update vector which sets changing
1234
1210
foreign->n_fields first fields in rec to new values */
1235
1211
1236
1212
n_to_update = row_ins_cascade_calc_update_vec (node, foreign, tmp_heap, trx,
1237
- &fts_col_affacted );
1213
+ &fts_col_affected );
1238
1214
1239
1215
if (foreign->v_cols != nullptr && foreign->v_cols ->size () > 0 ) {
1240
1216
row_ins_foreign_fill_virtual (cascade, clust_rec, clust_index, node,
@@ -1271,7 +1247,7 @@ static void row_ins_foreign_fill_virtual(upd_node_t *cascade, const rec_t *rec,
1271
1247
}
1272
1248
1273
1249
/* Mark the old Doc ID as deleted */
1274
- if (fts_col_affacted ) {
1250
+ if (fts_col_affected ) {
1275
1251
ut_ad (table->fts );
1276
1252
fts_trx_add_op (trx, table, doc_id, FTS_DELETE, nullptr );
1277
1253
}
0 commit comments