diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-27 12:49:22 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-27 12:49:22 +0300 |
commit | 9cc53e0e48ef0c76b8e72cbae27e9794c0ec3cea (patch) | |
tree | 01d3f2c7d7e56be6e98306837b627c7127b30c38 | |
parent | 844e537e06262904abfad0900982bf4a56ca8b09 (diff) | |
download | mariadb-git-9cc53e0e48ef0c76b8e72cbae27e9794c0ec3cea.tar.gz |
suggested fixup
The test case for MySQL Bug #33053297 is based on
mysql/mysql-server@27130e25078864b010d81266f9613d389d4a229b.
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 19 | ||||
-rw-r--r-- | storage/innobase/include/row0mysql.h | 7 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 12 |
3 files changed, 19 insertions, 19 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 422cf91d59f..d44330e68b5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20251,6 +20251,7 @@ void innobase_report_computed_value_failed(dtuple_t *row) @param[in] ifield index field @param[in] thd MySQL thread handle @param[in,out] mysql_table mysql table object +@param[in,out] mysql_rec MariaDB record buffer @param[in] old_table during ALTER TABLE, this is the old table or NULL. @param[in] update update vector for the row, if any @@ -20269,7 +20270,7 @@ innobase_get_computed_value( TABLE* mysql_table, byte* mysql_rec, const dict_table_t* old_table, - upd_t* update) + const upd_t* update) { byte rec_buf2[REC_VERSION_56_MAX_INDEX_COL_LEN]; byte* buf; @@ -20313,17 +20314,17 @@ innobase_get_computed_value( = index->table->vc_templ->vtempl[col_no]; const byte* data; - if (update != NULL) { - uint clust_no = dict_col_get_clust_pos(base_col, - clust_index); - const upd_field_t *uf = - upd_get_field_by_field_no(update, - clust_no, false); - if (uf != NULL) + if (update) { + ulint f = dict_col_get_clust_pos(base_col, + clust_index); + ut_a(f != ULINT_UNDEFINED); + if (const upd_field_t *uf = upd_get_field_by_field_no( + update, uint16_t(f), false)) { row_field = &uf->new_val; + } } - if (row_field == NULL) { + if (!row_field) { row_field = dtuple_get_nth_field(row, col_no); } diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index b066683dc3b..c4a94a9b5ef 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -809,8 +809,9 @@ void innobase_report_computed_value_failed(dtuple_t *row); @param[in,out] local_heap heap memory for processing large data etc. @param[in,out] heap memory heap that copies the actual index row @param[in] ifield index field -@param[in] thd MySQL thread handle -@param[in,out] mysql_table mysql table object +@param[in] thd connection handle +@param[in,out] mysql_table MariaDB table handle +@param[in,out] mysql_rec MariaDB record buffer @param[in] old_table during ALTER TABLE, this is the old table or NULL. @param[in] update update vector for the parent row @@ -828,7 +829,7 @@ innobase_get_computed_value( TABLE* mysql_table, byte* mysql_rec, const dict_table_t* old_table, - upd_t* parent_update); + const upd_t* update); /** Get the computed value by supplying the base column values. @param[in,out] table the table whose virtual column diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 32ad6df29b8..f3f2ccdcd0a 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -910,13 +910,11 @@ row_ins_foreign_fill_virtual( if (!record) { return DB_OUT_OF_MEMORY; } - bool set_null = - node->is_delete - ? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) - : (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL); - DBUG_ASSERT(set_null || - (!node->is_delete - && (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE))); + ut_ad(!node->is_delete + || (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)); + ut_ad(foreign->type & (DICT_FOREIGN_ON_DELETE_SET_NULL + | DICT_FOREIGN_ON_UPDATE_SET_NULL + | DICT_FOREIGN_ON_UPDATE_CASCADE)); for (uint16_t i = 0; i < n_v_fld; i++) { |