@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Config / setup - check for ONLY_FULL_GROUP_BY and warn the user

Summary: Fixes T6243.

Test Plan: simulated having this on by adding 'ONLY_FULL_GROUP_BY' to the $modes array. verified the error message looked nice {F233954}.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6243

Differential Revision: https://secure.phabricator.com/D10856

+40
+40
src/applications/config/check/PhabricatorSetupCheckMySQL.php
··· 34 34 35 35 $modes = self::loadRawConfigValue('sql_mode'); 36 36 $modes = explode(',', $modes); 37 + 37 38 if (!in_array('STRICT_ALL_TABLES', $modes)) { 38 39 $summary = pht( 39 40 'MySQL is not in strict mode, but using strict mode is strongly '. ··· 63 64 64 65 $this->newIssue('mysql.mode') 65 66 ->setName(pht('MySQL STRICT_ALL_TABLES Mode Not Set')) 67 + ->setSummary($summary) 68 + ->setMessage($message) 69 + ->addMySQLConfig('sql_mode'); 70 + } 71 + if (in_array('ONLY_FULL_GROUP_BY', $modes)) { 72 + $summary = pht( 73 + 'MySQL is in ONLY_FULL_GROUP_BY mode, but using this mode is strongly '. 74 + 'discouraged.'); 75 + 76 + $message = pht( 77 + "On your MySQL instance, the global %s is set to %s. ". 78 + "It is strongly encouraged that you disable this mode when running ". 79 + "Phabricator.\n\n". 80 + "With %s enabled, MySQL rejects queries for which the select list ". 81 + "or (as of MySQL 5.0.23) %s list refer to nonaggregated columns ". 82 + "that are not named in the %s clause. More importantly, Phabricator ". 83 + "does not work properly with this mode enabled.\n\n". 84 + "You can find more information about this mode (and how to configure ". 85 + "it) in the MySQL manual. Usually, it is sufficient to change the %s ". 86 + "in your %s file (in the %s section) and then restart %s:\n\n". 87 + "%s\n". 88 + "(Note that if you run other applications against the same database, ". 89 + "they may not work with %s. Be careful about enabling ". 90 + "it in these cases and consider migrating Phabricator to a different ". 91 + "database.)", 92 + phutil_tag('tt', array(), 'sql_mode'), 93 + phutil_tag('tt', array(), 'ONLY_FULL_GROUP_BY'), 94 + phutil_tag('tt', array(), 'ONLY_FULL_GROUP_BY'), 95 + phutil_tag('tt', array(), 'HAVING'), 96 + phutil_tag('tt', array(), 'GROUP BY'), 97 + phutil_tag('tt', array(), 'sql_mode'), 98 + phutil_tag('tt', array(), 'my.cnf'), 99 + phutil_tag('tt', array(), '[mysqld]'), 100 + phutil_tag('tt', array(), 'mysqld'), 101 + phutil_tag('pre', array(), 'sql_mode=STRICT_ALL_TABLES'), 102 + phutil_tag('tt', array(), 'ONLY_FULL_GROUP_BY')); 103 + 104 + $this->newIssue('mysql.mode') 105 + ->setName(pht('MySQL ONLY_FULL_GROUP_BY Mode Set')) 66 106 ->setSummary($summary) 67 107 ->setMessage($message) 68 108 ->addMySQLConfig('sql_mode');