Closed Bug 1424043 Opened 8 years ago Closed 3 years ago

checksetup.pl failure line 121 when adding new table groups

Categories

(Bugzilla :: Installation & Upgrading, defect)

5.0.3
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 1592129

People

(Reporter: kkuehl, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Steps to reproduce: ./checksetup.pl to create database schema Actual results: root@2cb9ae36f03d:/var/www/html/bugzilla# ./checksetup.pl * This is Bugzilla 5.0.3 on perl 5.22.1 * Running on Linux 4.10.0-22-generic #24-Ubuntu SMP Mon May 22 17:43:20 UTC 2017 Checking perl modules... Checking for CGI.pm (v3.51) ok: found v4.26 Checking for Digest-SHA (any) ok: found v5.95 Checking for TimeDate (v2.23) ok: found v2.24 Checking for DateTime (v0.75) ok: found v1.21 Checking for DateTime-TimeZone (v1.64) ok: found v1.95 Checking for DBI (v1.614) ok: found v1.634 Checking for Template-Toolkit (v2.24) ok: found v2.24 Checking for Email-Sender (v1.300011) ok: found v1.300021 Checking for Email-MIME (v1.904) ok: found v1.937 Checking for URI (v1.55) ok: found v1.71 Checking for List-MoreUtils (v0.32) ok: found v0.413 Checking for Math-Random-ISAAC (v1.0.1) ok: found v1.003 Checking for File-Slurp (v9999.13) ok: found v9999.19 Checking for JSON-XS (v2.01) ok: found v3.04 Checking available perl DBD modules... Checking for DBD-SQLite (v1.29) ok: found v1.54 Checking for DBD-Oracle (v1.19) not found Checking for DBD-Pg (v2.7.0) not found Checking for DBD-mysql (v4.001) ok: found v4.033 The following Perl modules are optional: Checking for GD (v1.20) ok: found v2.53 Checking for Chart (v2.4.1) ok: found v2.4.10 Checking for Template-GD (any) ok: found v1.56 Checking for GDTextUtil (any) ok: found v0.86 Checking for GDGraph (any) ok: found v1.48 Checking for MIME-tools (v5.406) ok: found v5.507 Checking for libwww-perl (any) ok: found v6.15 Checking for XML-Twig (any) ok: found v3.49 Checking for PatchReader (v0.9.6) ok: found v0.9.6 Checking for perl-ldap (any) ok: found v0.65 Checking for Authen-SASL (any) ok: found v2.16 Checking for Net-SMTP-SSL (v1.01) ok: found v1.03 Checking for RadiusPerl (any) ok: found v0.24 Checking for SOAP-Lite (v0.712) ok: found v1.19 Checking for XMLRPC-Lite (v0.712) ok: found v0.717 Checking for JSON-RPC (any) ok: found v1.06 Checking for Test-Taint (v1.06) ok: found v1.06 Checking for HTML-Parser (v3.67) ok: found v3.72 Checking for HTML-Scrubber (any) ok: found v0.15 Checking for Encode (v2.21) ok: found v2.72 Checking for Encode-Detect (any) ok: found v1.01 Checking for Email-Reply (any) ok: found v1.204 Checking for HTML-FormatText-WithLinks (v0.13) ok: found v0.15 Checking for TheSchwartz (v1.07) ok: found v1.07 Checking for Daemon-Generic (any) ok: found v0.84 Checking for mod_perl (v1.999022) ok: found v2.000009 Checking for Apache-SizeLimit (v0.96) ok: found v0.97 Checking for File-MimeInfo (any) ok: found v0.27 Checking for IO-stringy (any) ok: found v2.110 Checking for Cache-Memcached (any) ok: found v1.30 Checking for File-Copy-Recursive (any) ok: found v0.38 Checking for File-Which (any) ok: found v1.22 Checking for mod_env (any) ok Checking for mod_expires (any) ok Checking for mod_headers (any) ok Checking for mod_rewrite (any) ok Checking for mod_version (any) ok Reading ./localconfig... OPTIONAL NOTE: If you want to be able to use the 'difference between two patches' feature of Bugzilla (which requires the PatchReader Perl module as well), you should install patchutils from: http://cyberelk.net/tim/software/patchutils/ Checking for DBD-mysql (v4.001) ok: found v4.033 Checking for MySQL (v5.0.15) ok: found v8.0.3-rc-log Adding new table groups... DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups ( id mediumint auto_increment PRIMARY KEY NOT NULL, name varchar(255) N' at line 1 [for Statement "CREATE TABLE groups ( id mediumint auto_increment PRIMARY KEY NOT NULL, name varchar(255) NOT NULL, description mediumtext NOT NULL, isbuggroup tinyint NOT NULL, userregexp tinytext DEFAULT '' NOT NULL, isactive tinyint DEFAULT 1 NOT NULL, icon_url tinytext ) ENGINE = InnoDB CHARACTER SET utf8"] at Bugzilla/DB.pm line 837, <DATA> line 755. Bugzilla::DB::_bz_add_table_raw(Bugzilla::DB::Mysql=HASH(0x2405600), "groups", HASH(0x7f36868)) called at Bugzilla/DB.pm line 796 Bugzilla::DB::bz_add_table(Bugzilla::DB::Mysql=HASH(0x2405600), "groups", HASH(0x7f36868)) called at Bugzilla/DB.pm line 509 Bugzilla::DB::bz_setup_database(Bugzilla::DB::Mysql=HASH(0x2405600)) called at Bugzilla/DB/Mysql.pm line 558 Bugzilla::DB::Mysql::bz_setup_database(Bugzilla::DB::Mysql=HASH(0x2405600)) called at ./checksetup.pl line 121 Expected results: command completed properly without error
This is because mysql 8 doesn't support utf8 -- which is incredibly good news. Can I ask you to try an experimental patch?
Flags: needinfo?(kkuehl)
Sure, I can try a patch.
Flags: needinfo?(kkuehl)
Unfortunately it doesn't cleanly merge from BMO so I can't upload it right now, but I can show you the diff. Basically we s/utf8/utf8mb4/ in Bugzilla/DB/Mysql.pm. https://github.com/mozilla-bteam/bmo/pull/282/files#diff-511c9fd41b7cbaad89779a8f505fe31a The other changes shouldn't be needed, they are a midway refactor to remove the Bugzilla->params->{utf8} option entirely. In addition, three innodb options need to be set. I think that's all default in 5.8. I'm so happy mysql has done this, even if it breaks out setup script -- previously, on mysql, we suffered silent truncation of emoji. My day job is quite busy, but I can fix up a working patch on the weekend. Cheers.
Thanks for the quick response, I can wait for the patch. If I upgrade to the master branch on github would it contain this fix already?
I tried master and it failed as well.
With my patch (attached), I got the following: No language defines the string 'mysql_innodb_settings' at Bugzilla/Install/Util.pm line 295. :~/bmo$ git checkout bmo-emoji Branch bmo-emoji set up to track remote branch bmo-emoji from origin. Switched to a new branch 'bmo-emoji' :~/bmo$ grep -rn innodb_file_format * Bugzilla/DB/Mysql.pm:328: = $global{innodb_file_format} eq 'Barracuda' template/en/default/setup/strings.txt.pl:308:innodb_file_format = Barracuda vagrant_support/my.cnf:33:innodb_file_format = Barracuda And I wasn't sure what to do from there.
Any progress on the test patch?
Unfortunately I got very busy in the first part of the year. This is still on my radar, but I don't (still) have a mysql 8 to test against, and my own install is still stuck on on tables that can't support utf8mb4.
Assignee: general → installation
Severity: normal → major
Status: UNCONFIRMED → NEW
Component: Bugzilla-General → Installation & Upgrading
Ever confirmed: true
As per Bug 1464686, `GROUPS` is a reserved word in MySQL 8.0.2+ https://dev.mysql.com/doc/refman/8.0/en/keywords.html

If you want to get around having to quote everything, you could prefix all table names. So "groups" would become "bugzilla_groups". This should also work across different DBMS, which may be interesting to simplify postgres/oracle support. I believe these use different quote characters for table names than mysql.

I hate to make this a duplicate of a newer bug, but the other bug appears to be where the current action on this topic is actually happening, and we need to consolidate the two anyway.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: