@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.

Update MySQL schema inspection code for deprecation of integer display widths

Summary:
Fixes T13536. See that task for discussion.

Older versions of MySQL (roughly, prior to 8.0.19) emit "int(10)" types. Newer versions emit "int" types. Accept these as equivalent.

Test Plan: Ran `bin/storage upgrade --force` against MySQL 8.0.11 and 8.0.20. Got clean adjustment lists on both versions.

Maniphest Tasks: T13536

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

+32 -1
+32 -1
src/applications/config/schema/PhabricatorConfigColumnSchema.php
··· 68 68 return $this->characterSet; 69 69 } 70 70 71 + public function hasSameColumnTypeAs(PhabricatorConfigColumnSchema $other) { 72 + $u_type = $this->getColumnType(); 73 + $v_type = $other->getColumnType(); 74 + 75 + if ($u_type === $v_type) { 76 + return true; 77 + } 78 + 79 + // See T13536. Display widths for integers were deprecated in MySQL 8.0.17 80 + // and removed from some display contexts in or around 8.0.19. Older 81 + // MySQL versions will report "int(10)"; newer versions will report "int". 82 + // Accept these as equivalent. 83 + 84 + static $map = array( 85 + 'int(10) unsigned' => 'int unsigned', 86 + 'int(10)' => 'int', 87 + 'bigint(20) unsigned' => 'bigint unsigned', 88 + 'bigint(20)' => 'bigint', 89 + ); 90 + 91 + if (isset($map[$u_type])) { 92 + $u_type = $map[$u_type]; 93 + } 94 + 95 + if (isset($map[$v_type])) { 96 + $v_type = $map[$v_type]; 97 + } 98 + 99 + return ($u_type === $v_type); 100 + } 101 + 71 102 public function getKeyByteLength($prefix = null) { 72 103 $type = $this->getColumnType(); 73 104 ··· 138 169 $issues[] = self::ISSUE_COLLATION; 139 170 } 140 171 141 - if ($this->getColumnType() != $expect->getColumnType()) { 172 + if (!$this->hasSameColumnTypeAs($expect)) { 142 173 $issues[] = self::ISSUE_COLUMNTYPE; 143 174 } 144 175