源端:ob-mysql 3.1.4
目标端:ob-mysql 4.2.1.6
预检查和数据表结构同步慢,超级慢;mysql到ob-mysql 4.2.1.6没有此问题
sql root用户加索引失败:ERROR 1044 (42000): Access denied for user ‘root’@’%’ to database ‘information_schema’
异常sql
sql2:
SELECT NON_UNIQUE, INDEX_SCHEMA, INDEX_NAME, SEQ_IN_INDEX, COLUMN_NAME, COLLATION, SUB_PART, INDEX_TYPE, INDEX_COMMENT, IS_VISIBLE FROM information_schema.STATISTICS S WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND NOT EXISTS ( SELECT ? FROM information_schema.TABLE_CONSTRAINTS C WHERE S.TABLE_SCHEMA = C .TABLE_SCHEMA AND S.TABLE_NAME = C .TABLE_NAME AND S.INDEX_NAME = C .CONSTRAINT_NAME ) ORDER BY INDEX_NAME ASC, SEQ_IN_INDEX ASC
sql1:
SELECT C .CONSTRAINT_NAME AS CONSTRAINT_NAME, S.COLUMN_NAME AS COLUMN_NAME, K.ORDINAL_POSITION AS ORDINAL_POSITION, S.COLLATION AS COLLATION, S.SUB_PART AS SUB_PART, S.INDEX_COMMENT AS INDEX_COMMENT FROM information_schema.TABLE_CONSTRAINTS C, information_schema.KEY_COLUMN_USAGE K, information_schema.STATISTICS S WHERE C .TABLE_SCHEMA = K.TABLE_SCHEMA AND C .TABLE_NAME = K.TABLE_NAME AND C .TABLE_SCHEMA = S.TABLE_SCHEMA AND C .TABLE_NAME = S.TABLE_NAME AND C .CONSTRAINT_SCHEMA = K.CONSTRAINT_SCHEMA AND C .CONSTRAINT_NAME = K.CONSTRAINT_NAME AND C .CONSTRAINT_NAME = S.INDEX_NAME AND K.ORDINAL_POSITION = S.SEQ_IN_INDEX AND C .TABLE_SCHEMA = ? AND C .TABLE_NAME = ? AND C .CONSTRAINT_TYPE = ? ORDER BY K.ORDINAL_POSITION ASC