[MDEV-15964] Handler and system versioning don't work well together: expired rows are returned Created: 2018-04-21  Updated: 2018-04-27  Resolved: 2018-04-27

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Versioned Tables
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None


 Description   

HANDLER .. READ reads everything from a versioned table, regardless the system time, which is not really surprising, but probably not what one would expect (if there is anyone who uses HANDLER at all). If it's intentional, it needs to be documented. If it's not intentional, the best thing to do would be disable HANDLER for versioned tables, if possible; if not possible, then, again, document the current behavior.

create or replace table t1 (a int) with system versioning;
insert into t1 values (1),(2);
delete from t1 where a = 1;
handler t1 open as h;
handler h read first;
handler h read next;
handler h close;

10.3 d71a8855eef

MariaDB [test]> handler h read first;
+------+----------------------------+----------------------------+
| a    | row_start                  | row_end                    |
+------+----------------------------+----------------------------+
|    1 | 2018-04-22 01:25:57.867781 | 2018-04-22 01:26:03.379678 |
+------+----------------------------+----------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> handler h read next;
+------+----------------------------+----------------------------+
| a    | row_start                  | row_end                    |
+------+----------------------------+----------------------------+
|    2 | 2018-04-22 01:25:57.867781 | 2038-01-19 05:14:07.999999 |
+------+----------------------------+----------------------------+
1 row in set (0.01 sec)



 Comments   
Comment by Sergei Golubchik [ 2018-04-22 ]

I would say it's correct. HANDLER, being low-level command, talks directly to the storage, bypassing high-level logic of system versioning.

Comment by Ian Gilfillan [ 2018-04-27 ]

Documented at https://mariadb.com/kb/en/library/handler-commands/

Generated at Thu Feb 08 08:25:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.