我正在使用MySQL Server version: 5.6.15 Homebrew
. 我需要添加新null
列。alter table
不需要metadata
锁。为了避免这种MySQL 5.6
引入algorithm=inplace
。这里是参考文章http://www.mysqlperformanceblog.com/2013/07/05/schema-changes-whats-new-in-mysql-5-6/。
执行以下sql抛出
mysql> alter table candidate_candidate add column responsible_user_id int, algorithm=INPLACE, lock=NONE;
ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation.
Try ALGORITHM=COPY.
Run Code Online (Sandbox Code Playgroud)
有没有办法add column
不影响应用程序read/write
?