@@ -, +, @@ --- installer/data/mysql/updatedatabase.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9628,6 +9628,27 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + UPDATE statistics + SET itemtype = + ( + SELECT u.itype FROM + ( + SELECT itype,itemnumber FROM items + UNION ALL + SELECT itype,itemnumber FROM deleteditems + ) u + WHERE statistics.itemnumber = u.itemnumber + LIMIT 1 + ) + WHERE type IN ('localuse', 'return') + }); + print "upgrade to $DBversion done (Bug 9351 - item type not recorded correctly in statistics for returns and some local use)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --