소스 검색

fix Unknown table 'COLUMN_STATISTICS' occasional bug

Olivier Massot 5 년 전
부모
커밋
74285ee5e0
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      clonedb.py

+ 6 - 0
clonedb.py

@@ -315,6 +315,12 @@ class CloningOperation:
                     "--skip-comments"
                     ]
 
+        try:
+            self.from_server.exec_query("SELECT COLUMN_NAME FROM information_schema.COLUMN_STATISTICS;")
+        except pymysql.err.OperationalError:
+            # fix the occasional 'Unknown table 'COLUMN_STATISTICS' in information_schema' bug
+            base_cmd.append("--column-statistics=0")
+
         if self.compress:
             base_cmd.append("--compress")