[MDEV-12571] Incorrect number of affected rows using Connect engine; Created: 2017-04-24  Updated: 2017-05-11  Resolved: 2017-05-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.1.22
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Alice Sherepa Assignee: Olivier Bertrand
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Example below shows 6 rows affected, but should be 3.

CREATE TABLE q (
  id INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV;
 
INSERT INTO q VALUES(1),(2),(3);
 
DELETE FROM q;
Query OK, 6 rows affected (0.00 sec)



 Comments   
Comment by Olivier Bertrand [ 2017-05-10 ]

When doing delete all rows, MariaDB tries to get the number of lines by calling info and the storage engine replies by calling Cardinality. Because this information is often used just to optimize query performance, returning an estimate is generally correct.

For many table types, returning an exact number of rows can be a long process, this is why Connect returns an estimate by default. Setting the connect_exact_info to ON currently works only for info commands.

Do you think I should also do it for DELETE?

Comment by Elena Stepanova [ 2017-05-11 ]

No, I think we'd better leave it as is for now. Until somebody from real world comes with a compelling reason why the accurate number is very important, I think we should prioritize performance over it. We can always get back to it later.
Thus, I'm closing it as "Won't fix".

Generated at Thu Feb 08 07:58:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.