Project

General

Profile

Heads up: redmine:load_default_data fails in MariaDB 10.0.10, Table 'enumerations' is specified twice

Added by the fury almost 8 years ago

On my production server, running Ubuntu server 14.04 and MariaDB 10.0.10

redmine@andromeda:~/redmine-3.3$ ruby bin/about
/home/redmine/.rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466

sh: darcs: command not found
sh: cvs: command not found
sh: bzr: command not found
Environment:
  Redmine version                3.3.1.stable.16076
  Ruby version                   2.3.0-p0 (2015-12-25) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Mercurial                      2.8.2
  Git                            1.9.1
  Filesystem
Redmine plugins:
  no plugin installed
redmine@andromeda:~/redmine-3.3$ RAILS_ENV=production bundle exec rake redmine:load_default_data
/home/redmine/.rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
====================================
Error: Mysql2::Error: Table 'enumerations' is specified twice, both as a target for 'UPDATE' and as a separate source for data: UPDATE `enumerations` SET position = coalesce((
          select position
          from (select id, position from enumerations) as parent
          where parent_id = parent.id), 1) WHERE `enumerations`.`type` IN ('IssuePriority') AND (`enumerations`.`parent_id` IS NOT NULL) ORDER BY `enumerations`.`position` ASC
Default configuration data was not loaded.

In trying to replicate this on my VM, I found that the redmine:load_default_data task completed successfully. My VM is Ubuntu 16.04 with MariaDB 10.0.28

I believe it has something to do with this MariaDB bug report:

https://jira.mariadb.org/browse/MDEV-6163

which was fixed in 10.0.12

Obviously the straightforward answer is to upgrade my production server, which I will at some point (when it is least inconvenient for the 900 people online using it at any given time), but I'm betting I'm not the only one who could run into this who may for whatever reason be stuck (if even temporarily) at 10.0.10.

Would it be possible to fix the offending query, or is there a minimum MariaDB version required for newer versions of Redmine? This may be good information to post on relevant wiki pages.