Subject: | "type map failed for varbinary" |
Date: | Wed, 3 Aug 2011 16:56:34 +0200 |
To: | bug-MediaWiki-DumpFile [...] rt.cpan.org |
From: | Pierre-Edouard PORTIER <pierre.edouard.portier [...] gmail.com> |
Hi!
1) Configuration :
MediaWiki-DumpFile-0.2.1
perl5 (revision 5 version 12 subversion 3)
Windows 7
2) Error :
I obtained a "type map failed for varbinary" error with the following code :
#--BEGIN----------------------------
use MediaWiki::DumpFile::Compat;
$pmwd = Parse::MediaWikiDump->new;
$links = $pmwd->links('D:\wikipedia\enwiki-latest-pagelinks.sql');
$link = $links->next;
print 'from ', $link->from, ' to ', $link->namespace, ':', $link->to, "\n";
#--END----------------------------
The error is emited by SQL.pm at line 261 :
#--BEGIN----------------------------
if (! defined($type)) {
die "type map failed for $oldtype";
}
#--END----------------------------
3) Reason for the error :
The reason for the bug is that in the sub create_type_map of SQL.pm the
varbinary type is not taken into account.
4) Solution :
I added a varbinary type to the map defined in the sub create_type_map and
it solved the problem :
#--BEGIN----------------------------
varbinary => 'varchar',
#--END----------------------------
Cheers,
Pierre-Edouard