Bug #42878 Federated doesn't distinguish between DELETE FROM t1 and TRUNCATE t1
Submitted: 16 Feb 13:17 Modified: 16 Feb 14:01
Reporter: Sergey Vojtovich
Status: Verified
Category:Server: Federated Severity:S3 (Non-critical)
Version:5.0, 5,1, 6.0 bzr OS:Any
Assigned to: Target Version:
Triage: Triaged: D4 (Minor)

[16 Feb 13:17] Sergey Vojtovich
Description:
Both DELETE FROM t1 and TRUNCATE t1 are sent as TRUNCATE t1 to the remote table, where t1
is a federated table.

How to repeat:
Issue DELETE FROM t1 against Federated table and watch query log on a remote host. There
may be more side effects with transactions (TRUNCATE is a DDL, but DELETE is DML) and
probably with auto increment.

Suggested fix:
Fix ha_federated::delete_all_rows(), so it is issuing proper query to the remote table.
[16 Feb 14:01] Sveta Smirnova
Thank you for the report.

Verified as described: both statements send to remote server as TRUNCATE