瀏覽代碼

fix the 'unknown variable 'column-statistics=0'' error

Olivier Massot 5 年之前
父節點
當前提交
292fd2398a
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      clonedb.py

+ 5 - 2
clonedb.py

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