diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-03-24 01:02:26 +0300 |
---|---|---|
committer | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-04-27 11:51:17 +0300 |
commit | 43e879c717952fa84e2914609a13b8f05da2daba (patch) | |
tree | 2c39a3b6e206119dbd950bdcbe9cb3387e08af29 /sql/field.h | |
parent | f85afa5124b91d43105d32825a46584047975de7 (diff) | |
download | mariadb-git-43e879c717952fa84e2914609a13b8f05da2daba.tar.gz |
MDEV-24583 SELECT aborts after failed REPLACE into table with vcol
table->move_fields wasn't undone in case of error.
1. move_fields is unconditionally undone even when error is occurred
2. cherry-pick an assertion in `ptr_in_record`, which is already in 10.5
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/field.h b/sql/field.h index 18e44f1d9d4..f63fb670211 100644 --- a/sql/field.h +++ b/sql/field.h @@ -972,8 +972,9 @@ public: virtual void reset_fields() {} const uchar *ptr_in_record(const uchar *record) const { - my_ptrdiff_t l_offset= (my_ptrdiff_t) (record - table->record[0]); - return ptr + l_offset; + my_ptrdiff_t l_offset= (my_ptrdiff_t) (ptr - table->record[0]); + DBUG_ASSERT(l_offset >= 0 && table->s->rec_buff_length - l_offset > 0); + return record + l_offset; } virtual int set_default(); |