Thread:Project:Support desk/Database error after upgrade

After 3 hours of debugging a corrupted SQLite DB (don't ask, I have no idea) I've finally dumped and reimported all my content. I'm running a locally hosted MediaWiki instance, and when trying to access a specific category page or when running maintenance/populateCategory.php I get an error like:

liamzebedee@xxxx:/var/www$ sudo php maintenance/populateCategory.php A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script

Query: SELECT COUNT(*) AS pages,COUNT( (CASE WHEN page_namespace = '14' THEN 1 ELSE NULL END) ) AS subcats,COUNT( (CASE WHEN page_namespace = '6' THEN 1 ELSE NULL END) ) AS files  FROM categorylinks,page  WHERE cl_to = 'Biological_Level_of_Analysis' AND (page_id = cl_from)  LIMIT 1   LOCK IN SHARE MODE

Function: Category::refreshCounts Error: 1 near "LOCK": syntax error

This error is preventing me from accessing some categories on my wiki. Any ideas how to solve it? I've successfully run update.php, with install details below:

MediaWiki 1.21alpha (6882027) PHP	 5.4.6-1ubuntu1.1 (apache2handler) SQLite	 3.7.13 with full-text search support

Extensions: Math           1.0 ParserFunctions 1.4.1