简体   繁体   English

mysql截断归档表

[英]mysql truncate archive table

I have a table with the archive storage engine and I would like to clear it. 我有一个存档存储引擎的表,我想清除它。 Neither delete , nor truncate will work because of the engine definition. 由于引擎定义, deletetruncate都不起作用。 But is there any other way than dropping the whole table an recreating it? 但除了放弃整个桌子重新创建之外,还有其他方法吗?

另一种解决方法是将其更改为BLACKHOLE表,然后将其更改回来。

See Bug #15558 truncate doesn't clear table on archive storage engine tables 请参见Bug#15558 truncate不清除存档存储引擎表上的表

Basically, the designers wanted it to work that way. 基本上,设计师希望它以这种方式工作。 The fix to that bug was to make it return an error when you try to use truncate on a table stored with the ARCHIVE storage engine. 该错误的修复是当您尝试在存储有ARCHIVE存储引擎的表上使用truncate时返回错误。

The only workaround is to DROP and the re-CREATE the table. 唯一的解决方法是DROP并重新创建表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM