| 8088 | */ |
| 8089 | |
| 8090 | void TABLE::mark_columns_needed_for_insert() |
| 8091 | { |
| 8092 | DBUG_ENTER("mark_columns_needed_for_insert"); |
| 8093 | |
| 8094 | if (triggers) |
| 8095 | { |
| 8096 | /* |
| 8097 | We don't need to mark columns which are used by ON DELETE and |
| 8098 | ON UPDATE triggers, which may be invoked in case of REPLACE or |
| 8099 | INSERT ... ON DUPLICATE KEY UPDATE, since before doing actual |
| 8100 | row replacement or update write_record() will mark all table |
| 8101 | fields as used. |
| 8102 | */ |
| 8103 | triggers->mark_fields_used(TRG_EVENT_INSERT); |
| 8104 | } |
| 8105 | if (found_next_number_field) |
| 8106 | mark_auto_increment_column(true); |
| 8107 | if (default_field) |
| 8108 | mark_default_fields_for_write(TRUE); |
| 8109 | if (s->versioned) |
| 8110 | { |
| 8111 | bitmap_set_bit(write_set, s->vers.start_fieldno); |
| 8112 | bitmap_set_bit(write_set, s->vers.end_fieldno); |
| 8113 | bitmap_set_bit(read_set, s->vers.end_fieldno); |
| 8114 | } |
| 8115 | /* Mark virtual columns for insert */ |
| 8116 | if (vfield) |
| 8117 | mark_virtual_columns_for_write(TRUE); |
| 8118 | mark_columns_per_binlog_row_image(); |
| 8119 | |
| 8120 | /* FULL_NODUP is for replacing FULL mode, insert includes all columns. */ |
| 8121 | if (in_use->variables.binlog_row_image == BINLOG_ROW_IMAGE_FULL_NODUP) |
| 8122 | rpl_write_set= read_set; |
| 8123 | |
| 8124 | if (check_constraints) |
| 8125 | mark_check_constraint_columns_for_read(); |
| 8126 | DBUG_VOID_RETURN; |
| 8127 | } |
| 8128 | |
| 8129 | /* |
| 8130 | Mark columns according the binlog row image option |
no test coverage detected