Skip to content

Commit 34be415

Browse files
committed
Revert "[upstream] PS-7940: Bug #105290 ON DELETE CASCADE with generated column crashes in innobase_get_computed_value"
This reverts commit 595623e.
1 parent 2df90d5 commit 34be415

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

storage/innobase/row/row0ins.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,14 +1153,8 @@ static void row_ins_foreign_fill_virtual(upd_node_t *cascade, const rec_t *rec,
11531153
if (table->fts) {
11541154
doc_id = fts_get_doc_id_from_rec(table, clust_rec, clust_index, tmp_heap);
11551155
}
1156-
/* A cascade delete from the parent table triggers delete on the child
1157-
table. Before a clustered index record is deleted in the child table,
1158-
a copy of row is built to remove secondary index records. This copy of
1159-
the row requires virtual columns to be materialized. Hence, if child
1160-
table has any virtual columns, we have to initialize virtual column
1161-
template */
1162-
if (cascade->is_delete && dict_table_get_n_v_cols(table) > 0 &&
1163-
table->vc_templ == nullptr) {
1156+
if (cascade->is_delete && foreign->v_cols != nullptr &&
1157+
foreign->v_cols->size() > 0 && table->vc_templ == nullptr) {
11641158
innobase_init_vc_templ(table);
11651159
}
11661160

0 commit comments

Comments
 (0)