sql - Aplication Deadlocks (ERROR 1213 (40001)) when running an alter table command -


when i'm running following alter table, application still live hitting deadlocks: error 1213 (40001) @ line 2: deadlock found when trying lock; try restarting transaction

query:

alter table `comm` add column `thumb_url` varchar(256) null default null comment '' after `search_index_version`, add column `thumb_src_url` varchar(256) null default null comment '', lock = none; 

when read mysql 5.6 documentation shouldn't lock, or wrong?

version: server version: 5.6.27-76.0-56-log percona xtradb cluster (gpl), release rel76.0, revision 2a6d4e5, wsrep version 25.13, wsrep_25.13 pointers here?

thanks in advance assistance!

if try add column table beeing continuously used application, can meet deadlock - means process waiting other process finish, , other process waiting process finish. every select/insert/update make kind of lock on table.

you can try turning off application, make database changes , turning on.

you can try lock table moment. guess syntax that:

lock table comm write, comm read; alter table `comm` add column `thumb_url` varchar(256) null default null comment '' after `search_index_version`, add column `thumb_src_url` varchar(256) null default null comment ''; unlock tables; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -