use db1
CREATE TABLE `c_uid` ( `id` bigint(24) NOT NULL AUTO_INCREMENT, `keycode` varchar(100) COLLATE utf8_bin DEFAULT NULL, `uid` varchar(100) COLLATE utf8_bin DEFAULT NULL, `poid` int(11) DEFAULT '1', `createtime` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `c_uid_index_1` (`keycode`), KEY `c_uid_index_2` (`uid`) ) ENGINE=InnoDB
........1000000 rows insert into c_uid .
use db2
CREATE TABLE `uid` ( `id` bigint(24) NOT NULL AUTO_INCREMENT, `keycode` varchar(100) COLLATE utf8_bin DEFAULT NULL, `uid` varchar(100) COLLATE utf8_bin DEFAULT NULL, `poid` int(11) DEFAULT '1', `createtime` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `c_uid_index_1` (`keycode`), KEY `c_uid_index_2` (`uid`) ) ENGINE=InnoDB
use db1 | | use db2 alter table c_uid add col_test int ; | At the same time | insert into uid(keycode,uid,poid,createtime) ...... Query OK, 1000000 rows affected (29.41 sec) | | Query OK, 1 row affected (28.51 sec) Records: 1000000 Duplicates: 0 Warnings: 0 | |
db1 DDL operations blocked the db2 DML oprations .
use db1
CREATE TABLE `c_uid` (
`id` bigint(24) NOT NULL AUTO_INCREMENT,
`keycode` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`uid` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`poid` int(11) DEFAULT '1',
`createtime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `c_uid_index_1` (`keycode`),
KEY `c_uid_index_2` (`uid`)
) ENGINE=InnoDB
........1000000 rows insert into c_uid .
use db2
CREATE TABLE `uid` (
`id` bigint(24) NOT NULL AUTO_INCREMENT,
`keycode` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`uid` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`poid` int(11) DEFAULT '1',
`createtime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `c_uid_index_1` (`keycode`),
KEY `c_uid_index_2` (`uid`)
) ENGINE=InnoDB
use db1 | | use db2 uid,poid, createtime) ......
alter table c_uid add col_test int ; | At the same time | insert into uid(keycode,
Query OK, 1000000 rows affected (29.41 sec) | | Query OK, 1 row affected (28.51 sec)
Records: 1000000 Duplicates: 0 Warnings: 0 | |
db1 DDL operations blocked the db2 DML oprations .