1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-16546 post-review fixes

* clarify the help text for --system-versioning-insert-history
* move the vers_write=false check from Item_field::fix_fields()
  next to other vers field checks in find_field_in_table()
* move row_start validation from handler::write_row() next to
  vers_update_fields()
* make secure_timestamp check to happen in one place only,
  extract it into a function is_set_timestamp_vorbidden().
* overwriting vers fields is an error, just like setting @@timestamp
* don't run vers_insert_history() for every row
This commit is contained in:
Sergei Golubchik
2022-09-06 19:28:42 +02:00
parent a2cda88631
commit 8d2ec37a40
16 changed files with 162 additions and 88 deletions

View File

@ -7573,30 +7573,6 @@ int handler::ha_write_row(const uchar *buf)
DBUG_RETURN(error);
}
if (table->versioned() && !table->vers_write)
{
Field *row_start= table->vers_start_field();
Field *row_end= table->vers_end_field();
MYSQL_TIME ltime;
bitmap_set_bit(table->read_set, row_start->field_index);
bitmap_set_bit(table->read_set, row_end->field_index);
/*
Inserting the history row directly, check ROW_START <= ROW_END and
ROW_START is non-zero.
*/
if ((row_start->cmp(row_start->ptr, row_end->ptr) >= 0) ||
row_start->get_date(&ltime, Datetime::Options(
TIME_NO_ZERO_DATE, time_round_mode_t(time_round_mode_t::FRAC_NONE))))
{
String val;
row_start->val_str(&val);
my_error(ER_WRONG_VALUE, MYF(0), row_start->field_name.str, val.ptr());
DBUG_RETURN(HA_ERR_GENERIC);
}
}
MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
increment_statistics(&SSV::ha_write_count);