diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-05-06 10:12:31 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-05-06 10:12:31 +0300 |
commit | 26d46234e8316c010d40c02654803aaa7deb370c (patch) | |
tree | 8c28393932366894c1c7c9a8e804fad12a291147 /storage/innobase/gis | |
parent | 1421d1f2967f1546d2f38de31bc29159b5c9d540 (diff) | |
download | mariadb-git-26d46234e8316c010d40c02654803aaa7deb370c.tar.gz |
MDEV-28478: INSERT into SPATIAL INDEX in TEMPORARY table writes log
This is based on commit 20ae4816bba712a3faa0110c973e197d92f43b42
with some adjustments for MDEV-12353.
row_ins_sec_index_entry_low(): If a separate mini-transaction is
needed to adjust the minimum bounding rectangle (MBR) in the parent
page, we must disable redo logging if the table is a temporary table.
For temporary tables, no log is supposed to be written, because
the temporary tablespace will be reinitialized on server restart.
rtr_update_mbr_field(), rtr_merge_and_update_mbr(): Changed the return
type to void and removed unreachable code. In older versions, these
used to return a different value for temporary tables.
page_id_t: Add constexpr to most member functions.
mtr_t::log_write(): Catch log writes to invalid tablespaces
so that the test case would crash without the fix to
row_ins_sec_index_entry_low().
Diffstat (limited to 'storage/innobase/gis')
-rw-r--r-- | storage/innobase/gis/gis0rtree.cc | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index 66fa3670ebd..19e7003f1ea 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -1,7 +1,13 @@ /***************************************************************************** Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. +<<<<<<< HEAD Copyright (c) 2018, 2021, MariaDB Corporation. +||||||| parent of 20ae4816bba (MDEV-28478: INSERT into SPATIAL INDEX in TEMPORARY table writes log) +Copyright (c) 2019, 2020, MariaDB Corporation. +======= +Copyright (c) 2019, 2022, MariaDB Corporation. +>>>>>>> 20ae4816bba (MDEV-28478: INSERT into SPATIAL INDEX in TEMPORARY table writes log) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -185,9 +191,8 @@ rtr_index_build_node_ptr( } /**************************************************************//** -Update the mbr field of a spatial index row. -@return true if update is successful */ -bool +Update the mbr field of a spatial index row. */ +void rtr_update_mbr_field( /*=================*/ btr_cur_t* cursor, /*!< in/out: cursor pointed to rec.*/ @@ -535,8 +540,6 @@ update_mbr: page_is_comp(page)))); mem_heap_free(heap); - - return(true); } /**************************************************************//** @@ -1264,12 +1267,8 @@ rtr_ins_enlarge_mbr( page = buf_block_get_frame(block); /* Update the mbr field of the rec. */ - if (!rtr_update_mbr_field(&cursor, offsets, NULL, page, - &new_mbr, NULL, mtr)) { - err = DB_ERROR; - break; - } - + rtr_update_mbr_field(&cursor, offsets, NULL, page, + &new_mbr, NULL, mtr); page_cursor = btr_cur_get_page_cur(&cursor); block = page_cur_get_block(page_cursor); } @@ -1579,7 +1578,7 @@ rtr_merge_mbr_changed( /****************************************************************//** Merge 2 mbrs and update the the mbr that cursor is on. */ -dberr_t +void rtr_merge_and_update_mbr( /*=====================*/ btr_cur_t* cursor, /*!< in/out: cursor */ @@ -1589,27 +1588,15 @@ rtr_merge_and_update_mbr( page_t* child_page, /*!< in: the page. */ mtr_t* mtr) /*!< in: mtr */ { - dberr_t err = DB_SUCCESS; rtr_mbr_t new_mbr; - bool changed = false; - - ut_ad(dict_index_is_spatial(cursor->index)); - changed = rtr_merge_mbr_changed(cursor, cursor2, offsets, offsets2, - &new_mbr); - - /* Update the mbr field of the rec. And will delete the record - pointed by cursor2 */ - if (changed) { - if (!rtr_update_mbr_field(cursor, offsets, cursor2, child_page, - &new_mbr, NULL, mtr)) { - err = DB_ERROR; - } + if (rtr_merge_mbr_changed(cursor, cursor2, offsets, offsets2, + &new_mbr)) { + rtr_update_mbr_field(cursor, offsets, cursor2, child_page, + &new_mbr, NULL, mtr); } else { rtr_node_ptr_delete(cursor2, mtr); } - - return(err); } /*************************************************************//** |