mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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
This commit is contained in:
committed by
Sergei Golubchik
parent
0515577d12
commit
259fb1cbed
@ -1423,6 +1423,7 @@ BEGIN
|
||||
CALL p1(name, 'SELECT name VALUE FROM t1');
|
||||
CALL p1(name, 'SELECT name VERSIONING FROM t1');
|
||||
CALL p1(name, 'SELECT name WITHOUT FROM t1');
|
||||
CALL p1(name, 'SELECT name OVERLAPS FROM t1');
|
||||
DROP TABLE t1;
|
||||
END;
|
||||
$$
|
||||
@ -1442,6 +1443,7 @@ CALL p2('transaction');
|
||||
CALL p2('value');
|
||||
CALL p2('versioning');
|
||||
CALL p2('without');
|
||||
CALL p2('overlaps');
|
||||
--enable_column_names
|
||||
|
||||
DROP PROCEDURE p2;
|
||||
|
Reference in New Issue
Block a user