Firstly, the issue is for CONNECT that must handle updates or deletes sorted by the position of implied rows in the file.
For the table:
When I do:
I get 4 calls to indx_read each followed by update_row. Knowing it's an indexed command, I can store the needed data, sort it by the file position and do the updates as required.
The problems occur when the index is multiple and partially used:
Now if I do:
The calls to indx_read and indx_next_same are followed by a call to position. Then MariaDB reverts to not indexed rnd_pos reads followed by calls to update_row. It is as if MariaDB used MRR even the optimizer_switch.mrr variable is off. It would be all right if the positions had been sorted (as does MRR) but the problem is that they are not and the calls to update_row are done in the wrong order, CONNECT not being aware to sort it because the reading is no more indexed.
Note that the same occurs whether or not the optimizer_switch mrr variable is set on or off.
The current version of CONNECT returns a clobbered table in that case because intermediate rows are moved or copied several times.