From 259fb1cbed4470636ff35df83e1c4ca966bb8159 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Tue, 26 Nov 2019 19:22:04 +1000 Subject: MDEV-16978 Application-time periods: WITHOUT OVERLAPS * The overlaps check is implemented on a handler level per row command. It creates a separate cursor (actually, another handler instance) and caches it inside the original handler, when ha_update_row or ha_insert_row is issued. Cursor closes on unlocking the handler. * Containing the same key in index means unique constraint violation even in usual terms. So we fetch left and right neighbours and check that they have same key prefix, excluding from the key only the period part. If it doesnt match, then there's no such neighbour, and the check passes. Otherwise, we check if this neighbour intersects with the considered key. * The check does not introduce new error and fails with ER_DUPP_KEY error. This might break REPLACE workflow and should be fixed separately --- sql/structs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/structs.h') diff --git a/sql/structs.h b/sql/structs.h index f6d63051dfe..0993c453e16 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -164,6 +164,7 @@ typedef struct st_key { double actual_rec_per_key(uint i); + bool without_overlaps; } KEY; -- cgit v1.2.1