Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
--source include/have_csv.inc
|
 |
CREATE TABLE t1 (v INT NOT NULL) ENGINE=CSV; |
INSERT INTO t1 VALUES (1),(2),(3); |
DELETE FROM a1, a3 USING t1 AS a1 JOIN t1 AS a3 WHERE a1.v=2 AND a3.v=1; |
--echo # asked to remove v=1 and v=2, so v=3 must survive
|
SELECT * FROM t1 ORDER BY v; |
DROP TABLE t1; |
Some pre-analysis:
ha_tina backing CSV deletes the records physically from the file on every delete_row.
position() literally writes a file offset.
rnd_pos locates a record by than file offset
Scenario:
multi-delete records all the positions (=file offsets) to delete.
Then it deletes by those offsets in a single pass.
The offsets are not reverse-sorted, so when off1 < off2 and off1 is deleted first, off2 will point to a wrong record.
The fix is either of three:
a) Implement delete-marking in tina/csv
b) Reverse-sort the position buffer.
c) delete immediately after locating, skipping the buffer
Attachments
Issue Links
- relates to
-
MDEV-41154 multi_delete::rowid_table_deletes() discards every error from ha_rnd_pos()
-
- Closed
-
-
MDEV-41211 Federated multi_delete skips some records
-
- Open
-