Bug #101689 Allow IF EXISTS for TRUNCATE TABLE
Submitted: 20 Nov 2020 6:41 Modified: 20 Nov 2020 7:05
Reporter: Darrell Duane Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:5.7, 8.0 OS:Any
Assigned to: CPU Architecture:Any

[20 Nov 2020 6:41] Darrell Duane
Description:
I have a script that I run to truncate tables on various instances of the Drupal CMS.  Some instances don't have the same cache tables as others.

Its very nice that DROP TABLE IF EXISTS 'table_name'   works
and frustrating that
TRUNCATE TABLE IF EXISTS 'table_name'  is not supported.  Please support "IF EXISTS" for TRUNCATE.

How to repeat:
thats all

Suggested fix:
Implement the same code that supports IF EXISTS for DROP to also work for TRUNCATE
[20 Nov 2020 7:05] MySQL Verification Team
Hello Darrell Duane,

Thank you for the feature request.
Imho this is duplicate of Bug #61890, please see Bug #61890

regards,
Umesh