From 433ded5bda7adf5a131da54dd9d570a27eeed029 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Sat, 25 Feb 2006 13:47:11 +0000 Subject: [PATCH] allow to disable schema checks - those acquire giant locks on table opens.. --- includes/DefaultSettings.php | 2 ++ includes/Image.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ddbd9cc261..c99bbd7a5a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -432,6 +432,8 @@ $wgDBprefix = ''; $wgDBschema = 'mediawiki'; /**#@-*/ +/** Live high performance sites should disable this - some checks acquire giant mysql locks */ +$wgCheckDBSchema = true; /** diff --git a/includes/Image.php b/includes/Image.php index 8d62b2faa0..96e892fc2f 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1244,6 +1244,10 @@ class Image } function checkDBSchema(&$db) { + global $wgCheckDBSchema; + if (!$wgCheckDBSchema) { + return; + } # img_name must be unique if ( !$db->indexUnique( 'image', 'img_name' ) && !$db->indexExists('image','PRIMARY') ) { wfDebugDieBacktrace( 'Database schema not up to date, please run maintenance/archives/patch-image_name_unique.sql' ); -- 2.20.1