From e946bf96411293f53a08df8eb61af0f488025801 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Mon, 11 Oct 2004 04:10:41 +0000 Subject: [PATCH] bugfix: check for existence of PRIMARY key in addition to UNIQUE key, as MySQL returns "PRIMARY" as key_name. This caused uploads to fail with a "patch required" message in HEAD even if the schema was up to date. --- includes/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Image.php b/includes/Image.php index 438b2e9702..025c13f38c 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -578,7 +578,7 @@ function wfRecordUpload( $name, $oldver, $size, $desc, $copyStatus = "", $source $dbw =& wfGetDB( DB_MASTER ); # img_name must be unique - if ( !$dbw->indexUnique( 'image', 'img_name' ) ) { + if ( !$dbw->indexUnique( 'image', 'img_name' ) && !$dbw->indexExists('image','PRIMARY') ) { wfDebugDieBacktrace( 'Database schema not up to date, please run maintenance/archives/patch-image_name_unique.sql' ); } -- 2.20.1