Last modified: 2014-10-17 10:43:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 72171 - Cant replace image when using SQL Server backend: varchar vs. varbinary
Cant replace image when using SQL Server backend: varchar vs. varbinary
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
PC Windows Server 2008
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: mssql
  Show dependency treegraph
Reported: 2014-10-17 02:21 UTC by wikimedia
Modified: 2014-10-17 10:43 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description wikimedia 2014-10-17 02:21:51 UTC
The bug is that the column datatype of oldimage.oi_metadata is varchar when it needs to match image.img_metadata, which is varbinary(MAX)


Database error
A database query error has occurred. This may indicate a bug in the software.

INSERT INTO [MediaWiki].[oldimage] (oi_name,oi_archive_name,oi_size,oi_width,oi_height,oi_bits,oi_timestamp,oi_description,oi_user,oi_user_text,oi_metadata,oi_media_type,oi_major_mime,oi_minor_mime,oi_sha1) SELECT img_name,'20141017015118!DocumentManagementService_Soak.gif',img_size,img_width,img_height,img_bits,img_timestamp,img_description,img_user,img_user_text,img_metadata,img_media_type,img_major_mime,img_minor_mime,img_sha1 FROM [MediaWiki].[image] WHERE img_name = 'DocumentManagementService_Soak.gif'
Function: LocalFile::recordUpload2
Error: 257 [SQLSTATE 42000][Error Code 257][Microsoft][SQL Server Native Client 11.0][SQL Server]Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query. [SQLSTATE 42000][Error Code 8180][Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.

#0 C:\inetpub\wwwroot\mediawiki\includes\db\Database.php(1123): DatabaseBase->reportQueryError('[SQLSTATE 42000...', 257, 'INSERT  INTO [M...', 'LocalFile::reco...', false)
#1 C:\inetpub\wwwroot\mediawiki\includes\db\Database.php(2976): DatabaseBase->query('INSERT  INTO [M...', 'LocalFile::reco...')
#2 C:\inetpub\wwwroot\mediawiki\includes\db\DatabaseMssql.php(733): DatabaseBase->insertSelect('oldimage', 'image', Array, Array, 'LocalFile::reco...', Array, Array)
#3 C:\inetpub\wwwroot\mediawiki\includes\filerepo\file\LocalFile.php(1317): DatabaseMssql->insertSelect('oldimage', 'image', Array, Array, 'LocalFile::reco...')
#4 C:\inetpub\wwwroot\mediawiki\includes\filerepo\file\LocalFile.php(1174): LocalFile->recordUpload2('20141017015118!...', '', false, Array, false, Object(User))
#5 C:\inetpub\wwwroot\mediawiki\includes\upload\UploadBase.php(694): LocalFile->upload('C:\\temp\\phpCB83...', '', false, 1, Array, false, Object(User))
#6 C:\inetpub\wwwroot\mediawiki\includes\specials\SpecialUpload.php(466): UploadBase->performUpload('', false, true, Object(User))
#7 C:\inetpub\wwwroot\mediawiki\includes\specials\SpecialUpload.php(185): SpecialUpload->processUpload()
#8 C:\inetpub\wwwroot\mediawiki\includes\specialpage\SpecialPage.php(379): SpecialUpload->execute(NULL)
#9 C:\inetpub\wwwroot\mediawiki\includes\specialpage\SpecialPageFactory.php(503): SpecialPage->run(NULL)
#10 C:\inetpub\wwwroot\mediawiki\includes\Wiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#11 C:\inetpub\wwwroot\mediawiki\includes\Wiki.php(588): MediaWiki->performRequest()
#12 C:\inetpub\wwwroot\mediawiki\includes\Wiki.php(447): MediaWiki->main()
#13 C:\inetpub\wwwroot\mediawiki\index.php(46): MediaWiki->run()
#14 {main}

Note You need to log in before you can comment on or make changes to this bug.