From: Erik Moeller Date: Mon, 11 Oct 2004 04:10:41 +0000 (+0000) Subject: bugfix: check for existence of PRIMARY key in addition to UNIQUE key, as X-Git-Tag: 1.5.0alpha1~1601 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=e946bf96411293f53a08df8eb61af0f488025801;p=lhc%2Fweb%2Fwiklou.git 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. --- 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' ); }