From 9c902aec18d4ff077efa70779a23a5a19c73e7ba Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 15 Jan 2017 13:25:21 -0300 Subject: [PATCH] Turn "vacuum analyze" into two commands (fix for sqlite 3.15) Before sqlite 3.15, the parameter to vacuum was ignored. Since sqlite 3.15, it became a database name parameter. The "vacuum analyze" syntax was never supported by sqlite, seems to be just a psql thing. The error for this is "OperationalError: unknown database analyze", and happens when doing a media sync. --- anki/media.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/media.py b/anki/media.py index 88b5333c8..c1f783b28 100644 --- a/anki/media.py +++ b/anki/media.py @@ -446,7 +446,8 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0); self.db.execute("update meta set lastUsn=0,dirMod=0") self.db.commit() self.db.setAutocommit(True) - self.db.execute("vacuum analyze") + self.db.execute("vacuum") + self.db.execute("analyze") self.db.setAutocommit(False) # Media syncing: zips